forked from OSchip/llvm-project
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
This commit is contained in:
parent
abd5bead3f
commit
5bbc718539
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue