diff options
author | Jose Fonseca <[email protected]> | 2016-04-15 11:27:02 +0100 |
---|---|---|
committer | Jose Fonseca <[email protected]> | 2016-04-19 11:31:26 +0100 |
commit | b5ca689ceea39dc54ffa47d263dc1a6705702c6e (patch) | |
tree | 8e237e817797c451e79bddc8b97736bb1429bdff /src/gallium/auxiliary/gallivm/lp_bld_init.c | |
parent | 969ba8bfa7de544d2782a96ff6b66fe912f5e290 (diff) |
gallivm: Remove lp_get_module_id.
Just keep a copy of the module_name in gallivm.
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_init.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_init.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index bf2b65b52cb..687c01f1619 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -187,6 +187,8 @@ gallivm_free_ir(struct gallivm_state *gallivm) LLVMDisposeModule(gallivm->module); } + FREE(gallivm->module_name); + if (!USE_MCJIT) { /* Don't free the TargetData, it's owned by the exec engine */ } else { @@ -203,6 +205,7 @@ gallivm_free_ir(struct gallivm_state *gallivm) gallivm->engine = NULL; gallivm->target = NULL; gallivm->module = NULL; + gallivm->module_name = NULL; gallivm->passmgr = NULL; gallivm->context = NULL; gallivm->builder = NULL; @@ -306,6 +309,15 @@ init_gallivm_state(struct gallivm_state *gallivm, const char *name, if (!gallivm->context) goto fail; + gallivm->module_name = NULL; + if (name) { + size_t size = strlen(name) + 1; + gallivm->module_name = MALLOC(size); + if (gallivm->module_name) { + memcpy(gallivm->module_name, name, size); + } + } + gallivm->module = LLVMModuleCreateWithNameInContext(name, gallivm->context); if (!gallivm->module) @@ -574,8 +586,9 @@ gallivm_compile_module(struct gallivm_state *gallivm) if (gallivm_debug & GALLIVM_DEBUG_PERF) { int64_t time_end = os_time_get(); int time_msec = (int)(time_end - time_begin) / 1000; + assert(gallivm->module_name); debug_printf("optimizing module %s took %d msec\n", - lp_get_module_id(gallivm->module), time_msec); + gallivm->module_name, time_msec); } /* Dump byte code to a file */ |