diff options
author | Eric Christopher <echristo@apple.com> | 2010-08-30 18:34:48 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-08-30 18:34:48 +0000 |
commit | 753f3265dafdcfeec07b561ca278524c35477583 (patch) | |
tree | c8adfeeb491b48394175af2929c2ba38323604ae /include/llvm/Target/TargetSelect.h | |
parent | 2027362e8d99df1780ba604cff624b116a4e6ecf (diff) |
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!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetSelect.h')
-rw-r--r-- | include/llvm/Target/TargetSelect.h | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/include/llvm/Target/TargetSelect.h b/include/llvm/Target/TargetSelect.h index ab6b62b74e..1891f87974 100644 --- a/include/llvm/Target/TargetSelect.h +++ b/include/llvm/Target/TargetSelect.h @@ -100,15 +100,10 @@ namespace llvm { /// It is legal for a client to make multiple calls to this function. inline bool InitializeNativeTarget() { // If we have a native target, initialize it to ensure it is linked in. -#ifdef LLVM_NATIVE_ARCHNAME -#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 false; -#undef DoInit -#undef DoInit2 #else return true; #endif @@ -118,14 +113,9 @@ namespace llvm { /// this function to initialize the native target asm printer. inline bool InitializeNativeTargetAsmPrinter() { // If we have a native target, initialize the corresponding asm printer. -#ifdef LLVM_NATIVE_ARCH -#define DoInit2(TARG) \ - LLVMInitialize ## TARG ## AsmPrinter (); -#define DoInit(T) DoInit2(T) - DoInit(LLVM_NATIVE_ARCHNAME); +#ifdef LLVM_NATIVE_ASMPRINTER + LLVM_NATIVE_ASMPRINTER(); return false; -#undef DoInit -#undef DoInit2 #else return true; #endif |