diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-06-03 00:26:35 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-06-03 00:26:35 +0000 |
| commit | c6eb650120b879e6fa64a6507b2a03365304d9f1 (patch) | |
| tree | b28ba018e53df6dd9ec0a74a847ac9a90eb00b61 /clang/lib/Sema/SemaChecking.cpp | |
| parent | 8e42190d2038d129f9ebec8e83a5380cf0fcff30 (diff) | |
| download | bcm5719-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.cpp | 4 |
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; |

