[compiler-rt] r248328 - [builtins] Fixing atomic builtins to be compiled out if stdatomic.h isn't available.
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 14:50:44 PDT 2015
Author: cbieneman
Date: Tue Sep 22 16:50:43 2015
New Revision: 248328
URL: http://llvm.org/viewvc/llvm-project?rev=248328&view=rev
Log:
[builtins] Fixing atomic builtins to be compiled out if stdatomic.h isn't available.
This should fix the bots broken by r248322.
Reviewed by bogner over my shoulder.
Modified:
compiler-rt/trunk/lib/builtins/atomic_flag_clear.c
compiler-rt/trunk/lib/builtins/atomic_flag_clear_explicit.c
compiler-rt/trunk/lib/builtins/atomic_flag_test_and_set.c
compiler-rt/trunk/lib/builtins/atomic_flag_test_and_set_explicit.c
compiler-rt/trunk/lib/builtins/atomic_signal_fence.c
compiler-rt/trunk/lib/builtins/atomic_thread_fence.c
Modified: compiler-rt/trunk/lib/builtins/atomic_flag_clear.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/atomic_flag_clear.c?rev=248328&r1=248327&r2=248328&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/atomic_flag_clear.c (original)
+++ compiler-rt/trunk/lib/builtins/atomic_flag_clear.c Tue Sep 22 16:50:43 2015
@@ -12,8 +12,12 @@
*===------------------------------------------------------------------------===
*/
+#if __has_include(<stdatomic.h>)
+
#include <stdatomic.h>
#undef atomic_flag_clear
void atomic_flag_clear(volatile atomic_flag *object) {
return __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST);
}
+
+#endif
Modified: compiler-rt/trunk/lib/builtins/atomic_flag_clear_explicit.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/atomic_flag_clear_explicit.c?rev=248328&r1=248327&r2=248328&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/atomic_flag_clear_explicit.c (original)
+++ compiler-rt/trunk/lib/builtins/atomic_flag_clear_explicit.c Tue Sep 22 16:50:43 2015
@@ -12,9 +12,13 @@
*===------------------------------------------------------------------------===
*/
+#if __has_include(<stdatomic.h>)
+
#include <stdatomic.h>
#undef atomic_flag_clear_explicit
void atomic_flag_clear_explicit(volatile atomic_flag *object,
memory_order order) {
return __c11_atomic_store(&(object)->_Value, 0, order);
}
+
+#endif
Modified: compiler-rt/trunk/lib/builtins/atomic_flag_test_and_set.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/atomic_flag_test_and_set.c?rev=248328&r1=248327&r2=248328&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/atomic_flag_test_and_set.c (original)
+++ compiler-rt/trunk/lib/builtins/atomic_flag_test_and_set.c Tue Sep 22 16:50:43 2015
@@ -12,8 +12,12 @@
*===------------------------------------------------------------------------===
*/
+#if __has_include(<stdatomic.h>)
+
#include <stdatomic.h>
#undef atomic_flag_test_and_set
_Bool atomic_flag_test_and_set(volatile atomic_flag *object) {
return __c11_atomic_exchange(&(object)->_Value, 1, __ATOMIC_SEQ_CST);
}
+
+#endif
Modified: compiler-rt/trunk/lib/builtins/atomic_flag_test_and_set_explicit.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/atomic_flag_test_and_set_explicit.c?rev=248328&r1=248327&r2=248328&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/atomic_flag_test_and_set_explicit.c (original)
+++ compiler-rt/trunk/lib/builtins/atomic_flag_test_and_set_explicit.c Tue Sep 22 16:50:43 2015
@@ -12,9 +12,13 @@
*===------------------------------------------------------------------------===
*/
+#if __has_include(<stdatomic.h>)
+
#include <stdatomic.h>
#undef atomic_flag_test_and_set_explicit
_Bool atomic_flag_test_and_set_explicit(volatile atomic_flag *object,
memory_order order) {
return __c11_atomic_exchange(&(object)->_Value, 1, order);
}
+
+#endif
Modified: compiler-rt/trunk/lib/builtins/atomic_signal_fence.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/atomic_signal_fence.c?rev=248328&r1=248327&r2=248328&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/atomic_signal_fence.c (original)
+++ compiler-rt/trunk/lib/builtins/atomic_signal_fence.c Tue Sep 22 16:50:43 2015
@@ -12,8 +12,12 @@
*===------------------------------------------------------------------------===
*/
+#if __has_include(<stdatomic.h>)
+
#include <stdatomic.h>
#undef atomic_signal_fence
void atomic_signal_fence(memory_order order) {
__c11_atomic_signal_fence(order);
}
+
+#endif
Modified: compiler-rt/trunk/lib/builtins/atomic_thread_fence.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/atomic_thread_fence.c?rev=248328&r1=248327&r2=248328&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/atomic_thread_fence.c (original)
+++ compiler-rt/trunk/lib/builtins/atomic_thread_fence.c Tue Sep 22 16:50:43 2015
@@ -12,8 +12,12 @@
*===------------------------------------------------------------------------===
*/
+#if __has_include(<stdatomic.h>)
+
#include <stdatomic.h>
#undef atomic_thread_fence
void atomic_thread_fence(memory_order order) {
__c11_atomic_thread_fence(order);
}
+
+#endif
More information about the llvm-commits
mailing list