summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-02-13 07:55:47 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-02-13 07:55:47 +0000
commita9bdd3bc26f77faf9f3310b2924f89a7a56dc981 (patch)
treee10250df23fa869763b8ab54356165cdb8648e69 /lib/CodeGen/CGExprComplex.cpp
parentf8bd6d398823be8306407e6daa07e4067e9de4df (diff)
downloadclang-a9bdd3bc26f77faf9f3310b2924f89a7a56dc981.tar.gz
MS ABI: Implement /volatile:ms
The /volatile:ms semantics turn volatile loads and stores into atomic acquire and release operations. This distinction is important because volatile memory operations do not form a happens-before relationship with non-atomic memory. This means that a volatile store is not sufficient for implementing a mutex unlock routine. Differential Revision: http://reviews.llvm.org/D7580 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229082 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--lib/CodeGen/CGExprComplex.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index ceec85a9a8..1fea5a127c 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -336,7 +336,8 @@ ComplexPairTy ComplexExprEmitter::EmitLoadOfLValue(LValue lvalue,
/// specified value pointer.
void ComplexExprEmitter::EmitStoreOfComplex(ComplexPairTy Val, LValue lvalue,
bool isInit) {
- if (lvalue.getType()->isAtomicType())
+ if (lvalue.getType()->isAtomicType() ||
+ (!isInit && CGF.LValueIsSuitableForInlineAtomic(lvalue)))
return CGF.EmitAtomicStore(RValue::getComplex(Val), lvalue, isInit);
llvm::Value *Ptr = lvalue.getAddress();