diff options
author | JF Bastien <jfb@chromium.org> | 2013-08-01 15:06:01 -0700 |
---|---|---|
committer | JF Bastien <jfb@chromium.org> | 2013-08-01 15:06:01 -0700 |
commit | a7665e96f34c4a981d59c78b0b872b8f0b100cb9 (patch) | |
tree | aa05a7a1f915980654ae61c5a2f5952abfc7e561 /include/llvm/IR/Intrinsics.td | |
parent | b9657234ee8b1951db5977a8ffb55a2e5df6d76c (diff) |
Add Intrinsic::nacl_atomic_is_lock_free
This is part of a bigger CL to fix C++11 in PNaCl, to commit in the following order:
- https://codereview.chromium.org/20552002
- https://codereview.chromium.org/20554002
- https://codereview.chromium.org/20560002
- https://codereview.chromium.org/20561002
This should be the last PNaCl ABI change for C11/C+11 atomic support.
Note that Clang already has a builtin for lock-free, but it's partly resolved by Clang's ExprConstant.cpp and CGBuiltin.cpp, whereas what we want is a call that becomes a constant at translation-time. I made the translation part fairly general so it's easy to support architectures where ``true`` isn't always the right answer.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3475
TEST= ./scons run_synchronization_cpp11_test --verbose bitcode=1 platform=x86-64
TEST= ninja check-all
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/20554002
Diffstat (limited to 'include/llvm/IR/Intrinsics.td')
-rw-r--r-- | include/llvm/IR/Intrinsics.td | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/IR/Intrinsics.td b/include/llvm/IR/Intrinsics.td index ef15ceb158..15567eb2db 100644 --- a/include/llvm/IR/Intrinsics.td +++ b/include/llvm/IR/Intrinsics.td @@ -526,6 +526,9 @@ def int_nacl_atomic_cmpxchg : Intrinsic<[llvm_anyint_ty], [IntrReadWriteArgMem]>; def int_nacl_atomic_fence : Intrinsic<[], [llvm_i32_ty], [IntrReadWriteArgMem]>; +def int_nacl_atomic_is_lock_free : Intrinsic<[llvm_i1_ty], + [llvm_i32_ty, llvm_ptr_ty], [IntrNoMem]>, + GCCBuiltin<"__nacl_atomic_is_lock_free">; // @LOCALMOD-END //===----------------------------------------------------------------------===// |