From d05cb9f0187984e461b41eb1ba6ca2adf0593c74 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jul 2010 12:49:12 -0600 Subject: llvmpipe: don't call LLVMCreateJITCompiler() twice Fixes a failed assertion with LLVM 2.6: ::JITResolver::JITResolver(llvm::JIT&): Assertion `TheJITResolver == 0&& "Multiple JIT resolvers?"' failed. Though, not everyone seems to experience this problem. --- src/gallium/drivers/llvmpipe/lp_test_sincos.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/gallium/drivers/llvmpipe/lp_test_sincos.c') diff --git a/src/gallium/drivers/llvmpipe/lp_test_sincos.c b/src/gallium/drivers/llvmpipe/lp_test_sincos.c index 1366ecddcb..e93c1b7859 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_sincos.c +++ b/src/gallium/drivers/llvmpipe/lp_test_sincos.c @@ -30,7 +30,7 @@ #include #include "gallivm/lp_bld.h" -#include "gallivm/lp_bld_printf.h" +#include "gallivm/lp_bld_init.h" #include "gallivm/lp_bld_arit.h" #include @@ -101,8 +101,7 @@ test_sincos(unsigned verbose, FILE *fp) { LLVMModuleRef module = NULL; LLVMValueRef test_sin = NULL, test_cos = NULL; - LLVMExecutionEngineRef engine = NULL; - LLVMModuleProviderRef provider = NULL; + LLVMExecutionEngineRef engine = lp_build_engine; LLVMPassManagerRef pass = NULL; char *error = NULL; test_sincos_t sin_func; @@ -122,13 +121,6 @@ test_sincos(unsigned verbose, FILE *fp) } LLVMDisposeMessage(error); - provider = LLVMCreateModuleProviderForExistingModule(module); - if (LLVMCreateJITCompiler(&engine, provider, 1, &error)) { - fprintf(stderr, "%s\n", error); - LLVMDisposeMessage(error); - abort(); - } - #if 0 pass = LLVMCreatePassManager(); LLVMAddTargetData(LLVMGetExecutionEngineTargetData(engine), pass); @@ -162,7 +154,6 @@ test_sincos(unsigned verbose, FILE *fp) LLVMFreeMachineCodeForFunction(engine, test_sin); LLVMFreeMachineCodeForFunction(engine, test_cos); - LLVMDisposeExecutionEngine(engine); if(pass) LLVMDisposePassManager(pass); -- cgit v1.2.3