summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-06-03 00:26:35 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-06-03 00:26:35 +0000
commitc6eb650120b879e6fa64a6507b2a03365304d9f1 (patch)
treeb28ba018e53df6dd9ec0a74a847ac9a90eb00b61 /clang/lib/Sema/SemaChecking.cpp
parent8e42190d2038d129f9ebec8e83a5380cf0fcff30 (diff)
downloadbcm5719-llvm-c6eb650120b879e6fa64a6507b2a03365304d9f1.tar.gz
bcm5719-llvm-c6eb650120b879e6fa64a6507b2a03365304d9f1.zip
[Sema] Make the atomic builtins more efficient by reducing volatility
The parameter types and return type do not need to be volatile just because the pointer type's pointee type is volatile qualified. This is an unnecessary pessimization. llvm-svn: 238892
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 23a6fc3c4cd..c3b81b6683d 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -1604,6 +1604,10 @@ ExprResult Sema::SemaAtomicOpsOverloaded(ExprResult TheCallResult,
return ExprError();
}
+ // atomic_fetch_or takes a pointer to a volatile 'A'. We shouldn't let the
+ // volatile-ness of the pointee-type inject itself into the result or the
+ // other operands.
+ ValType.removeLocalVolatile();
QualType ResultType = ValType;
if (Form == Copy || Form == GNUXchg || Form == Init)
ResultType = Context.VoidTy;
OpenPOWER on IntegriCloud