gallivm: Replace architecture test with PIPE_ARCH_*
authorStéphane Marchesin <marcheu@chromium.org>
Fri, 10 Feb 2012 03:50:59 +0000 (19:50 -0800)
committerStéphane Marchesin <marcheu@chromium.org>
Mon, 13 Feb 2012 00:32:15 +0000 (16:32 -0800)
X86Target is a variable, and therefore isn't defined at compile time. So
 LLVM_NATIVE_ARCH == X86Target
is translated into
 0 == 0
and since X86 is first, we always pick it.

Therefore we replace the logic with PIPE_ARCH_*.

https://bugs.freedesktop.org/show_bug.cgi?id=45420

src/gallium/auxiliary/gallivm/lp_bld_debug.cpp

index 5d98763d8024617e21b8fa01e1c88df9379ed09d..7f4d227d5ebf651f0de54e9f876e728bcc99232d 100644 (file)
@@ -207,15 +207,17 @@ lp_disassemble(const void* func)
 
 #if HAVE_LLVM >= 0x0208
    InitializeNativeTargetAsmPrinter();
-#elif LLVM_NATIVE_ARCH == X86Target
+#elif defined(PIPE_ARCH_X86)
    LLVMInitializeX86AsmPrinter();
-#elif LLVM_NATIVE_ARCH == ARMTarget
+#elif defined(PIPE_ARCH_ARM)
    LLVMInitializeARMAsmPrinter();
+#elif defined(PIPE_ARCH_PPC)
+   LLVMInitializePowerPCAsmPrinter();
 #endif
 
-#if (LLVM_NATIVE_ARCH == X86 || LLVM_NATIVE_ARCH == X86Target)
+#if defined(PIPE_ARCH_X86)
    LLVMInitializeX86Disassembler();
-#elif (LLVM_NATIVE_ARCH == ARM || LLVM_NATIVE_ARCH == ARMTarget)
+#elif defined(PIPE_ARCH_ARM)
    LLVMInitializeARMDisassembler();
 #endif