summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-c
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-08-30 18:34:48 +0000
committerEric Christopher <echristo@apple.com>2010-08-30 18:34:48 +0000
commite7a9db16bb8e6d9fbe96a7616fd7fce4422b1dd3 (patch)
treed1e9fcc87b6fba55ce80febc8f040ba5ac3664c0 /llvm/include/llvm-c
parent470e84cfeb2b4a3f3d149d18ad5a741807df14dd (diff)
downloadbcm5719-llvm-e7a9db16bb8e6d9fbe96a7616fd7fce4422b1dd3.tar.gz
bcm5719-llvm-e7a9db16bb8e6d9fbe96a7616fd7fce4422b1dd3.zip
Fix LLVM target initialization to deal with sociopathic outside projects
that like to randomly define things like "X86", regenerate autoconf bits and update cmake. Fixes PR7852. Patch by Xerxes RÄnby! llvm-svn: 112499
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r--llvm/include/llvm-c/Target.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/include/llvm-c/Target.h b/llvm/include/llvm-c/Target.h
index 29bd6fec9a4..2cd15c3fa30 100644
--- a/llvm/include/llvm-c/Target.h
+++ b/llvm/include/llvm-c/Target.h
@@ -64,15 +64,10 @@ static inline void LLVMInitializeAllTargets(void) {
for JIT applications to ensure that the target gets linked in correctly. */
static inline LLVMBool LLVMInitializeNativeTarget(void) {
/* If we have a native target, initialize it to ensure it is linked in. */
-#ifdef LLVM_NATIVE_ARCH
-#define DoInit2(TARG) \
- LLVMInitialize ## TARG ## Info (); \
- LLVMInitialize ## TARG ()
-#define DoInit(T) DoInit2(T)
- DoInit(LLVM_NATIVE_ARCH);
+#ifdef LLVM_NATIVE_TARGET
+ LLVM_NATIVE_TARGETINFO();
+ LLVM_NATIVE_TARGET();
return 0;
-#undef DoInit
-#undef DoInit2
#else
return 1;
#endif
OpenPOWER on IntegriCloud