diff options
author | José Fonseca <[email protected]> | 2014-05-12 14:03:47 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2014-05-14 11:05:00 +0100 |
commit | 69f0835ff1dbf1d70418b56af9c97bb3aaecef27 (patch) | |
tree | 79d2b31ebddc7ae069c2ed45d068ccf39afab977 /src/gallium | |
parent | 9cf67e51b06b4b136d03e642b18b4a4e36a1dabb (diff) |
gallivm: Stop using module providers.
Nowadays LLVMModuleProviderRef is just an alias for LLVMModuleRef, so
its use just causes unnecessary confusion.
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_init.c | 33 | ||||
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_init.h | 1 |
2 files changed, 7 insertions, 27 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index 85faef508b9..6934a28891b 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -122,7 +122,7 @@ create_pass_manager(struct gallivm_state *gallivm) assert(!gallivm->passmgr); assert(gallivm->target); - gallivm->passmgr = LLVMCreateFunctionPassManager(gallivm->provider); + gallivm->passmgr = LLVMCreateFunctionPassManagerForModule(gallivm->module); if (!gallivm->passmgr) return FALSE; @@ -177,26 +177,16 @@ create_pass_manager(struct gallivm_state *gallivm) static void free_gallivm_state(struct gallivm_state *gallivm) { - /* This leads to crashes w/ some versions of LLVM */ - LLVMModuleRef mod; - char *error; - - if (gallivm->engine && gallivm->provider) - LLVMRemoveModuleProvider(gallivm->engine, gallivm->provider, - &mod, &error); - if (gallivm->passmgr) { LLVMDisposePassManager(gallivm->passmgr); } -#if 0 - /* XXX this seems to crash with all versions of LLVM */ - if (gallivm->provider) - LLVMDisposeModuleProvider(gallivm->provider); -#endif - - /* This will already destroy any associated module */ - LLVMDisposeExecutionEngine(gallivm->engine); + if (gallivm->engine) { + /* This will already destroy any associated module */ + LLVMDisposeExecutionEngine(gallivm->engine); + } else if (gallivm->module) { + LLVMDisposeModule(gallivm->module); + } #if !USE_MCJIT /* Don't free the TargetData, it's owned by the exec engine */ @@ -219,7 +209,6 @@ free_gallivm_state(struct gallivm_state *gallivm) gallivm->engine = NULL; gallivm->target = NULL; gallivm->module = NULL; - gallivm->provider = NULL; gallivm->passmgr = NULL; gallivm->context = NULL; gallivm->builder = NULL; @@ -253,8 +242,6 @@ init_gallivm_engine(struct gallivm_state *gallivm) } } - LLVMAddModuleProvider(gallivm->engine, gallivm->provider);//new - #if !USE_MCJIT gallivm->target = LLVMGetExecutionEngineTargetData(gallivm->engine); if (!gallivm->target) @@ -311,7 +298,6 @@ init_gallivm_state(struct gallivm_state *gallivm) { assert(!gallivm->context); assert(!gallivm->module); - assert(!gallivm->provider); lp_build_init(); @@ -327,11 +313,6 @@ init_gallivm_state(struct gallivm_state *gallivm) if (!gallivm->module) goto fail; - gallivm->provider = - LLVMCreateModuleProviderForExistingModule(gallivm->module); - if (!gallivm->provider) - goto fail; - gallivm->builder = LLVMCreateBuilderInContext(gallivm->context); if (!gallivm->builder) goto fail; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.h b/src/gallium/auxiliary/gallivm/lp_bld_init.h index 7edea616c4e..68f400661a3 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.h @@ -40,7 +40,6 @@ struct gallivm_state { LLVMModuleRef module; LLVMExecutionEngineRef engine; - LLVMModuleProviderRef provider; LLVMTargetDataRef target; LLVMPassManagerRef passmgr; LLVMContextRef context; |