diff options
author | Michel Dänzer <[email protected]> | 2014-08-21 06:30:22 -0400 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2014-08-21 07:55:23 -0400 |
commit | 3ba225c1ab3682fcba33c8b4103afed22e3b3621 (patch) | |
tree | 2da8c47ec7aedea4ac7c9bc56fe85d3ef5280e99 /src/gallium/state_trackers/clover/llvm | |
parent | d682ebec0bb8716dfa7747c46d5bfad732ead06c (diff) |
st/clover: Fix build against LLVM SVN >= r215967 v2
v2: Tom Stellard
- Properly destroy the Module
Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover/llvm')
-rw-r--r-- | src/gallium/state_trackers/clover/llvm/invocation.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 5d2efc4461c..d351bc5c3a2 100644 --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp @@ -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; } |