mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
st/clover: Fix build against LLVM SVN >= r215967 v2
v2: Tom Stellard - Properly destroy the Module Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
parent
d682ebec0b
commit
3ba225c1ab
1 changed files with 14 additions and 2 deletions
|
|
@ -234,7 +234,11 @@ namespace {
|
|||
memcpy(address_spaces, c.getTarget().getAddressSpaceMap(),
|
||||
sizeof(address_spaces));
|
||||
|
||||
#if HAVE_LLVM >= 0x0306
|
||||
return act.takeModule().release();
|
||||
#else
|
||||
return act.takeModule();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -415,13 +419,21 @@ clover::compile_program_llvm(const compat::string &source,
|
|||
|
||||
internalize_functions(mod, kernels);
|
||||
|
||||
module m;
|
||||
// Build the clover::module
|
||||
switch (ir) {
|
||||
case PIPE_SHADER_IR_TGSI:
|
||||
//XXX: Handle TGSI
|
||||
assert(0);
|
||||
return module();
|
||||
m = module();
|
||||
break;
|
||||
default:
|
||||
return build_module_llvm(mod, kernels, address_spaces);
|
||||
m = build_module_llvm(mod, kernels, address_spaces);
|
||||
break;
|
||||
}
|
||||
#if HAVE_LLVM >= 0x0306
|
||||
// LLVM 3.6 and newer, the user takes ownership of the module.
|
||||
delete mod;
|
||||
#endif
|
||||
return m;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue