summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_test_sincos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test_sincos.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_sincos.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_sincos.c b/src/gallium/drivers/llvmpipe/lp_test_sincos.c
index 1366ecddcb..7ab357f162 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_sincos.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_sincos.c
@@ -30,8 +30,9 @@
#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 "util/u_pointer.h"
#include <llvm-c/Analysis.h>
#include <llvm-c/ExecutionEngine.h>
@@ -101,8 +102,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 +122,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);
@@ -144,8 +137,8 @@ test_sincos(unsigned verbose, FILE *fp)
(void)pass;
#endif
- sin_func = (test_sincos_t)LLVMGetPointerToGlobal(engine, test_sin);
- cos_func = (test_sincos_t)LLVMGetPointerToGlobal(engine, test_cos);
+ sin_func = (test_sincos_t) pointer_to_func(LLVMGetPointerToGlobal(engine, test_sin));
+ cos_func = (test_sincos_t) pointer_to_func(LLVMGetPointerToGlobal(engine, test_cos));
memset(unpacked, 0, sizeof unpacked);
@@ -162,7 +155,6 @@ test_sincos(unsigned verbose, FILE *fp)
LLVMFreeMachineCodeForFunction(engine, test_sin);
LLVMFreeMachineCodeForFunction(engine, test_cos);
- LLVMDisposeExecutionEngine(engine);
if(pass)
LLVMDisposePassManager(pass);