aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_test_sincos.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-07-29 12:49:12 -0600
committerBrian Paul <[email protected]>2010-07-29 12:51:45 -0600
commitd05cb9f0187984e461b41eb1ba6ca2adf0593c74 (patch)
tree0be1dde26a25e4d9e00ea7836a8ecdcb64fc9374 /src/gallium/drivers/llvmpipe/lp_test_sincos.c
parent8f3fe7e2f0a3ce1a5c45fd204b0105f3b501e641 (diff)
llvmpipe: don't call LLVMCreateJITCompiler() twice
Fixes a failed assertion with LLVM 2.6: <unnamed>::JITResolver::JITResolver(llvm::JIT&): Assertion `TheJITResolver == 0&& "Multiple JIT resolvers?"' failed. Though, not everyone seems to experience this problem.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test_sincos.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_sincos.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_sincos.c b/src/gallium/drivers/llvmpipe/lp_test_sincos.c
index 1366ecddcbc..e93c1b7859d 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_sincos.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_sincos.c
@@ -30,7 +30,7 @@
#include <stdio.h>
#include "gallivm/lp_bld.h"
-#include "gallivm/lp_bld_printf.h"
+#include "gallivm/lp_bld_init.h"
#include "gallivm/lp_bld_arit.h"
#include <llvm-c/Analysis.h>
@@ -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);