diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-13 00:45:38 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-13 00:45:38 +0000 |
commit | 2c39d71bb7cefdfe6116fa52454f3b3dc5abd517 (patch) | |
tree | 392cd2bf791d9bd77edc058462ae4a43678adf51 /include | |
parent | e2d87bc0be8e5a5b2e45118675ff878d89daee44 (diff) |
Implement the missing pieces needed to support libstdc++4.7's <atomic>:
__atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_*
predefined macros.
Implement library fallback for __atomic_is_lock_free and
__c11_atomic_is_lock_free, and implement __atomic_always_lock_free.
Contrary to their documentation, GCC's __atomic_fetch_add family don't
multiply the operand by sizeof(T) when operating on a pointer type.
libstdc++ relies on this quirk. Remove this handling for all but the
__c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins.
Contrary to their documentation, __atomic_test_and_set and __atomic_clear
take a first argument of type 'volatile void *', not 'void *' or 'bool *',
and __atomic_is_lock_free and __atomic_always_lock_free have an argument
of type 'const volatile void *', not 'void *'.
With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite,
except for a couple of libstdc++ bugs and some cases where libc++'s test
suite tests for properties which implementations have latitude to vary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154640 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/Builtins.def | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def index 2823190ca4..7e3a245133 100644 --- a/include/clang/Basic/Builtins.def +++ b/include/clang/Basic/Builtins.def @@ -635,12 +635,12 @@ ATOMIC_BUILTIN(__atomic_sub_fetch, "v.", "t") ATOMIC_BUILTIN(__atomic_and_fetch, "v.", "t") ATOMIC_BUILTIN(__atomic_or_fetch, "v.", "t") ATOMIC_BUILTIN(__atomic_xor_fetch, "v.", "t") -BUILTIN(__atomic_test_and_set, "vv*i", "n") -BUILTIN(__atomic_clear, "vb*i", "n") +BUILTIN(__atomic_test_and_set, "bvD*i", "n") +BUILTIN(__atomic_clear, "vvD*i", "n") BUILTIN(__atomic_thread_fence, "vi", "n") BUILTIN(__atomic_signal_fence, "vi", "n") -BUILTIN(__atomic_always_lock_free, "izv*", "n") -BUILTIN(__atomic_is_lock_free, "izv*", "n") +BUILTIN(__atomic_always_lock_free, "izvCD*", "n") +BUILTIN(__atomic_is_lock_free, "izvCD*", "n") #undef ATOMIC_BUILTIN |