summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins/atomic.c
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-12-19 18:54:13 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-12-19 18:54:13 +0000
commit5bbc71853945cacf59fd857e5b3043eaa7e397ed (patch)
tree9e3090d37384daad91200f2c8561d8844a3762a0 /compiler-rt/lib/builtins/atomic.c
parentabd5bead3fc1636ae6fcb5cb689d5701e77d86a9 (diff)
downloadbcm5719-llvm-5bbc71853945cacf59fd857e5b3043eaa7e397ed.tar.gz
bcm5719-llvm-5bbc71853945cacf59fd857e5b3043eaa7e397ed.zip
builtins: rely on the compiler for user label prefix
clang does not like the definition of builtins. In order to work around this, we use a SUN CC to redefine the generated name. However, this requires that we account for the user label prefix. Rather than hard coding that into the file, rely on the compiler to tell us the information and use the preprocessor to generate the name as we do in the assembly routines. NFC. llvm-svn: 224597
Diffstat (limited to 'compiler-rt/lib/builtins/atomic.c')
-rw-r--r--compiler-rt/lib/builtins/atomic.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/compiler-rt/lib/builtins/atomic.c b/compiler-rt/lib/builtins/atomic.c
index 02429a653d2..35c8837dcec 100644
--- a/compiler-rt/lib/builtins/atomic.c
+++ b/compiler-rt/lib/builtins/atomic.c
@@ -28,20 +28,14 @@
#include <stdint.h>
#include <string.h>
+#include "assembly.h"
+
// Clang objects if you redefine a builtin. This little hack allows us to
// define a function with the same name as an intrinsic.
-#if __APPLE__
-// mach-o has extra leading underscore
-#pragma redefine_extname __atomic_load_c ___atomic_load
-#pragma redefine_extname __atomic_store_c ___atomic_store
-#pragma redefine_extname __atomic_exchange_c ___atomic_exchange
-#pragma redefine_extname __atomic_compare_exchange_c ___atomic_compare_exchange
-#else
-#pragma redefine_extname __atomic_load_c __atomic_load
-#pragma redefine_extname __atomic_store_c __atomic_store
-#pragma redefine_extname __atomic_exchange_c __atomic_exchange
-#pragma redefine_extname __atomic_compare_exchange_c __atomic_compare_exchange
-#endif
+#pragma redefine_extname __atomic_load_c SYMBOL_NAME(__atomic_load)
+#pragma redefine_extname __atomic_store_c SYMBOL_NAME(__atomic_store)
+#pragma redefine_extname __atomic_exchange_c SYMBOL_NAME(__atomic_exchange)
+#pragma redefine_extname __atomic_compare_exchange_c SYMBOL_NAME(__atomic_compare_exchange)
/// Number of locks. This allocates one page on 32-bit platforms, two on
/// 64-bit. This can be specified externally if a different trade between
OpenPOWER on IntegriCloud