gallivm: Fix build with llvm-3.1svn.
authorVinson Lee <vlee@vmware.com>
Tue, 13 Dec 2011 01:54:54 +0000 (17:54 -0800)
committerVinson Lee <vlee@vmware.com>
Sat, 17 Dec 2011 05:22:39 +0000 (21:22 -0800)
llvm-3.1svn r145714 moved global variables into a new TargetOptions
class. TargetMachine constructor now needs a TargetOptions object as
well.

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp

index 62825a29b999d35e9c304a5a435f4aab936d9daa..a50a51d7d26b819869ca654de925ea2b5865c141 100644 (file)
@@ -250,7 +250,19 @@ lp_disassemble(const void* func)
       return;
    }
 
-#if HAVE_LLVM >= 0x0300
+#if HAVE_LLVM >= 0x0301
+   TargetOptions options;
+#if defined(DEBUG)
+   options.JITEmitDebugInfo = true;
+#endif
+#if defined(PIPE_ARCH_X86)
+   options.StackAlignmentOverride = 4;
+#endif
+#if defined(DEBUG) || defined(PROFILE)
+   options.NoFramePointerElim = true;
+#endif
+   TargetMachine *TM = T->createTargetMachine(Triple, sys::getHostCPUName(), "", options);
+#elif HAVE_LLVM == 0x0300
    TargetMachine *TM = T->createTargetMachine(Triple, sys::getHostCPUName(), "");
 #else
    TargetMachine *TM = T->createTargetMachine(Triple, "");
index 222241a140a20376e4402114c870ec61a84cb443..fe7616b9ecfd584ffb27cab41e77386681bec15f 100644 (file)
@@ -69,6 +69,7 @@ lp_register_oprofile_jit_event_listener(LLVMExecutionEngineRef EE)
 extern "C" void
 lp_set_target_options(void)
 {
+#if HAVE_LLVM <= 0x0300
 #if defined(DEBUG)
 #if HAVE_LLVM >= 0x0207
    llvm::JITEmitDebugInfo = true;
@@ -102,6 +103,7 @@ lp_set_target_options(void)
 #if 0
    llvm::UnsafeFPMath = true;
 #endif
+#endif  /* HAVE_LLVM <= 0x0300 */
 
 #if HAVE_LLVM < 0x0209
    /*