summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-02-14 01:35:12 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-02-14 01:35:12 +0000
commita5b195a1dcc252916f68cadb81163a47d8995ee3 (patch)
tree6fd0ab86477d2a77778c391df234200c6412390e /clang/lib/CodeGen/CGExpr.cpp
parent6866a3c6f4c6ac4c368f4292b6567e456646b07b (diff)
downloadbcm5719-llvm-a5b195a1dcc252916f68cadb81163a47d8995ee3.tar.gz
bcm5719-llvm-a5b195a1dcc252916f68cadb81163a47d8995ee3.zip
Revert "Revert r229082 for a bit, it caused PR22577."
This reverts commit r229123. It was a red herring, the bug was present without r229082. llvm-svn: 229205
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index d82fff85dd3..ead8531c5f1 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -1136,7 +1136,7 @@ llvm::Value *CodeGenFunction::EmitLoadOfScalar(llvm::Value *Addr, bool Volatile,
}
// Atomic operations have to be done on integral types.
- if (Ty->isAtomicType()) {
+ if (Ty->isAtomicType() || typeIsSuitableForInlineAtomic(Ty, Volatile)) {
LValue lvalue = LValue::MakeAddr(Addr, Ty,
CharUnits::fromQuantity(Alignment),
getContext(), TBAAInfo);
@@ -1255,7 +1255,8 @@ void CodeGenFunction::EmitStoreOfScalar(llvm::Value *Value, llvm::Value *Addr,
Value = EmitToMemory(Value, Ty);
- if (Ty->isAtomicType()) {
+ if (Ty->isAtomicType() ||
+ (!isInit && typeIsSuitableForInlineAtomic(Ty, Volatile))) {
EmitAtomicStore(RValue::get(Value),
LValue::MakeAddr(Addr, Ty,
CharUnits::fromQuantity(Alignment),
OpenPOWER on IntegriCloud