aboutsummaryrefslogtreecommitdiff
path: root/lib/AST
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-04-11 17:55:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-04-11 17:55:32 +0000
commitfafbf06732746f3ceca21d452d77b144ba8652ae (patch)
tree828df18dd161d468f4d3be6f25fcad877d37afce /lib/AST
parent5d70cfddc8a8a450d1425e190f10512a51352e5d (diff)
Provide, and document, a set of __c11_atomic_* intrinsics to implement C11's
<stdatomic.h> header. In passing, fix LanguageExtensions to note that C11 and C++11 are no longer "upcoming standards" but are now actually standardized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154513 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r--lib/AST/ExprConstant.cpp3
-rw-r--r--lib/AST/StmtPrinter.cpp22
2 files changed, 13 insertions, 12 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 435d94c1d4..ce41308344 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -4365,7 +4365,8 @@ bool IntExprEvaluator::VisitCallExpr(const CallExpr *E) {
return Error(E);
- case Builtin::BI__atomic_is_lock_free: {
+ case Builtin::BI__atomic_is_lock_free:
+ case Builtin::BI__c11_atomic_is_lock_free: {
APSInt SizeVal;
if (!EvaluateInteger(E->getArg(0), SizeVal, Info))
return false;
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index ef5eefb306..651b88b5d3 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -1109,37 +1109,37 @@ void StmtPrinter::VisitAtomicExpr(AtomicExpr *Node) {
const char *Name = 0;
switch (Node->getOp()) {
case AtomicExpr::Init:
- Name = "__atomic_init(";
+ Name = "__c11_atomic_init(";
break;
case AtomicExpr::Load:
- Name = "__atomic_load(";
+ Name = "__c11_atomic_load(";
break;
case AtomicExpr::Store:
- Name = "__atomic_store(";
+ Name = "__c11_atomic_store(";
break;
case AtomicExpr::CmpXchgStrong:
- Name = "__atomic_compare_exchange_strong(";
+ Name = "__c11_atomic_compare_exchange_strong(";
break;
case AtomicExpr::CmpXchgWeak:
- Name = "__atomic_compare_exchange_weak(";
+ Name = "__c11_atomic_compare_exchange_weak(";
break;
case AtomicExpr::Xchg:
- Name = "__atomic_exchange(";
+ Name = "__c11_atomic_exchange(";
break;
case AtomicExpr::Add:
- Name = "__atomic_fetch_add(";
+ Name = "__c11_atomic_fetch_add(";
break;
case AtomicExpr::Sub:
- Name = "__atomic_fetch_sub(";
+ Name = "__c11_atomic_fetch_sub(";
break;
case AtomicExpr::And:
- Name = "__atomic_fetch_and(";
+ Name = "__c11_atomic_fetch_and(";
break;
case AtomicExpr::Or:
- Name = "__atomic_fetch_or(";
+ Name = "__c11_atomic_fetch_or(";
break;
case AtomicExpr::Xor:
- Name = "__atomic_fetch_xor(";
+ Name = "__c11_atomic_fetch_xor(";
break;
}
OS << Name;