aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorDiogo Sampaio <diogo.sampaio@arm.com>2020-02-07 10:03:59 +0000
committerDiogo Sampaio <diogo.sampaio@arm.com>2020-02-07 10:11:54 +0000
commit9d869180c4adba42d68c14dab51fba8093ccf91c (patch)
tree9d1d19a557572bca969bd5a57e978147751f804b /clang/lib/Frontend/CompilerInvocation.cpp
parente8c3a6c2606abdbf4f207c8b22e0f532d6247564 (diff)
downloadllvm-9d869180c4adba42d68c14dab51fba8093ccf91c.zip
llvm-9d869180c4adba42d68c14dab51fba8093ccf91c.tar.gz
llvm-9d869180c4adba42d68c14dab51fba8093ccf91c.tar.bz2
[ARM] Follow AACPS for preserving number of loads/stores of volatile bit-fields
Summary: Following the AAPCS, every store to a volatile bit-field requires to generate one load of that field, even if all the bits are going to be replaced. This patch allows the user to opt-in in following such rule, whenever the a. AAPCS Release 2019Q1.1 (https://static.docs.arm.com/ihi0042/g/aapcs32.pdf) section 8.1 Data Types, page 35, paragraph: Volatile bit-fields – preserving number and width of container accesses ``` When a volatile bit-field is written, and its container does not overlap with any non-bit-field member, its container must be read exactly once and written exactly once using the access width appropriate to the type of the container. The two accesses are not atomic. ``` Reviewers: lebedev.ri, ostannard, jfb, eli.friedman Reviewed By: jfb Subscribers: rsmith, rjmccall, dexonsmith, kristof.beyls, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67399
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index eb30a19..463b265 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1439,6 +1439,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.SymbolPartition =
std::string(Args.getLastArgValue(OPT_fsymbol_partition_EQ));
+ Opts.ForceAAPCSBitfieldLoad = Args.hasArg(OPT_ForceAAPCSBitfieldLoad);
return Success;
}