[Mesa-dev] [PATCH] st/clover: Fix build against LLVM SVN >= r215967
Francisco Jerez
currojerez at riseup.net
Wed Aug 20 00:27:41 PDT 2014
Michel Dänzer <michel at daenzer.net> writes:
> On 20.08.2014 15:48, Francisco Jerez wrote:
>> Michel Dänzer <michel at daenzer.net> writes:
>>
>>> From: Michel Dänzer <michel.daenzer at amd.com>
>>>
>>> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
>>> ---
>>> src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>>
>>> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
>>> index 5d2efc4..2643cc3 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().get();
>>
>> You probably want to call .release() instead
>
> Right, that works better, i.e. doesn't crash. :)
>
>> and deallocate it manually later on, otherwise the module will be
>> destroyed here before the end of the function.
>
> Are you sure anything else needs to be done for destruction? valgrind
> doesn't seem to show any leaks obviously related to this. If something
> else does need to be done, I'll have to defer to you or someone else for
> the proper fix.
Yeah, I'm afraid. Apparently since clang r215979
CodeGenAction::takeModule() gives up ownership on the module object.
>
>
> --
> Earthling Michel Dänzer | http://www.amd.com
> Libre software enthusiast | Mesa and X developer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140820/553c3946/attachment.sig>
More information about the mesa-dev
mailing list