Mesa (master): gallivm: Fix build with llvm-3.1svn.

Vinson Lee vlee at kemper.freedesktop.org
Sat Dec 17 05:24:47 UTC 2011


Module: Mesa
Branch: master
Commit: 95aa0e5d84a4f46f2f0809b26f5899b8e39f5afc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=95aa0e5d84a4f46f2f0809b26f5899b8e39f5afc

Author: Vinson Lee <vlee at vmware.com>
Date:   Mon Dec 12 17:54:54 2011 -0800

gallivm: Fix build with llvm-3.1svn.

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 at vmware.com>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/auxiliary/gallivm/lp_bld_debug.cpp |   14 +++++++++++++-
 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp  |    2 ++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
index 62825a2..a50a51d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
@@ -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, "");
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 222241a..fe7616b 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -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
    /*




More information about the mesa-commit mailing list