Add some macro magic: user __USER_LABEL_PREFIX__ instead of hardcoding it for each platform

llvm-svn: 129818
This commit is contained in:
Anton Korobeynikov 2011-04-19 21:22:14 +00:00
parent 2b9b0e3748
commit 3c5199042a
1 changed files with 4 additions and 4 deletions

View File

@ -22,18 +22,18 @@
#define SEPARATOR ; #define SEPARATOR ;
#endif #endif
/* We can't use __USER_LABEL_PREFIX__ here, it isn't possible to concatenate the
*values* of two macros. This is quite brittle, though. */
#if defined(__APPLE__) #if defined(__APPLE__)
#define SYMBOL_NAME(name) _##name
#define HIDDEN_DIRECTIVE .private_extern #define HIDDEN_DIRECTIVE .private_extern
#define LOCAL_LABEL(name) L_##name #define LOCAL_LABEL(name) L_##name
#else #else
#define SYMBOL_NAME(name) name
#define HIDDEN_DIRECTIVE .hidden #define HIDDEN_DIRECTIVE .hidden
#define LOCAL_LABEL(name) .L_##name #define LOCAL_LABEL(name) .L_##name
#endif #endif
#define GLUE2(a, b) a ## b
#define GLUE(a, b) GLUE2(a, b)
#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
#ifdef VISIBILITY_HIDDEN #ifdef VISIBILITY_HIDDEN
#define DEFINE_COMPILERRT_FUNCTION(name) \ #define DEFINE_COMPILERRT_FUNCTION(name) \
.globl SYMBOL_NAME(name) SEPARATOR \ .globl SYMBOL_NAME(name) SEPARATOR \