summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-04-09 03:57:26 +0000
committerChris Lattner <sabre@nondot.org>2011-04-09 03:57:26 +0000
commit9cb59fa8346608a6663acbc03ff82a5e61427117 (patch)
treea6a8589d1eed9d337162e8073e00004c6d372b71 /clang/lib/Sema/SemaChecking.cpp
parented47ed4e80d9add78932bafff99701a87d54923c (diff)
downloadbcm5719-llvm-9cb59fa8346608a6663acbc03ff82a5e61427117.tar.gz
bcm5719-llvm-9cb59fa8346608a6663acbc03ff82a5e61427117.zip
add a __sync_swap builtin to fill out the rest of the __sync builtins.
Patch by Dave Zarzycki! llvm-svn: 129189
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 105fb52ddb5..e1adfd48396 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -180,6 +180,7 @@ Sema::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
case Builtin::BI__sync_bool_compare_and_swap:
case Builtin::BI__sync_lock_test_and_set:
case Builtin::BI__sync_lock_release:
+ case Builtin::BI__sync_swap:
return SemaBuiltinAtomicOverloaded(move(TheCallResult));
}
@@ -415,7 +416,8 @@ Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) {
BUILTIN_ROW(__sync_val_compare_and_swap),
BUILTIN_ROW(__sync_bool_compare_and_swap),
BUILTIN_ROW(__sync_lock_test_and_set),
- BUILTIN_ROW(__sync_lock_release)
+ BUILTIN_ROW(__sync_lock_release),
+ BUILTIN_ROW(__sync_swap)
};
#undef BUILTIN_ROW
@@ -468,6 +470,7 @@ Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) {
NumFixed = 0;
ResultType = Context.VoidTy;
break;
+ case Builtin::BI__sync_swap: BuiltinIndex = 14; break;
}
// Now that we know how many fixed arguments we expect, first check that we
OpenPOWER on IntegriCloud