[llvm] r255256 - [ThinLTO] Release files in gold plugin during combined index (take 2)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 06:39:12 PST 2015


On Sun, Dec 13, 2015 at 4:12 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>
> On Thu, Dec 10, 2015 at 8:11 AM, Teresa Johnson via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>>
>> Author: tejohnson
>> Date: Thu Dec 10 10:11:23 2015
>> New Revision: 255256
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=255256&view=rev
>> Log:
>> [ThinLTO] Release files in gold plugin during combined index (take 2)
>
>
> Could we use an RAII wrapper to ensure this is more reliably handled?

Great idea. I will add that.

Thanks,
Teresa

>
>>
>>
>> Ensure we release the files even when they don't hold a function index
>> summary section, by restructuring the control flow a little bit.
>>
>> Modified:
>>     llvm/trunk/tools/gold/gold-plugin.cpp
>>
>> Modified: llvm/trunk/tools/gold/gold-plugin.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=255256&r1=255255&r2=255256&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/tools/gold/gold-plugin.cpp (original)
>> +++ llvm/trunk/tools/gold/gold-plugin.cpp Thu Dec 10 10:11:23 2015
>> @@ -855,10 +855,8 @@ static ld_plugin_status allSymbolsReadHo
>>            getFunctionIndexForFile(F, File);
>>
>>        // Skip files without a function summary.
>> -      if (!Index)
>> -        continue;
>> -
>> -      CombinedIndex.mergeFrom(std::move(Index), ++NextModuleId);
>> +      if (Index)
>> +        CombinedIndex.mergeFrom(std::move(Index), ++NextModuleId);
>>
>>        if (release_input_file(F.handle) != LDPS_OK)
>>          message(LDPL_FATAL, "Failed to release file information");
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>



-- 
Teresa Johnson | Software Engineer | tejohnson at google.com | 408-460-2413


More information about the llvm-commits mailing list