Mesa (master): gallivm: Fix MCJIT with LLVM 3.3.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Apr 19 10:32:39 UTC 2016


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

Author: Jose Fonseca <jfonseca at vmware.com>
Date:   Thu Apr 14 16:47:14 2016 +0100

gallivm: Fix MCJIT with LLVM 3.3.

One needs to call setJITMemoryManager for LLVM 3.3, instead of
setMCJITMemoryManager.

This regressed in commits 065256df/75ad4fe7 when trying to make the
code to build with LLVM 3.6.

Tested MCJIT with LLVM 3.3 to 3.6.

Reviewed-by: Roland Scheidegger <sroland at vmware.com>

---

 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 77069ef..e47146a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -602,7 +602,6 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
 
    ShaderMemoryManager *MM = NULL;
    if (useMCJIT) {
-#if HAVE_LLVM > 0x0303
        BaseMemoryManager* JMM = reinterpret_cast<BaseMemoryManager*>(CMM);
        MM = new ShaderMemoryManager(JMM);
        *OutCode = MM->getGeneratedCode();
@@ -610,9 +609,10 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
 #if HAVE_LLVM >= 0x0306
        builder.setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager>(MM));
        MM = NULL; // ownership taken by std::unique_ptr
-#else
+#elif HAVE_LLVM > 0x0303
        builder.setMCJITMemoryManager(MM);
-#endif
+#else
+       builder.setJITMemoryManager(MM);
 #endif
    } else {
 #if HAVE_LLVM < 0x0306




More information about the mesa-commit mailing list