[llvm] r268658 - LTOCodeGenerator: handle correctly "unnamed" symbol

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 13:50:58 PDT 2016


No test: it is dead code, reverted in r268680)

-- 
Mehdi

> On May 5, 2016, at 1:03 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> 
> Can you add a testcase?
> 
> Thanks,
> Rafael
> 
> 
> On 5 May 2016 at 14:14, Mehdi Amini via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>> Author: mehdi_amini
>> Date: Thu May  5 13:14:55 2016
>> New Revision: 268658
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=268658&view=rev
>> Log:
>> LTOCodeGenerator: handle correctly "unnamed" symbol
>> 
>> This should fix the assertions in a clang LTO bootstrap we're seeing.
>> 
>> From: Mehdi Amini <mehdi.amini at apple.com>
>> 
>> Modified:
>>    llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
>> 
>> Modified: llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOCodeGenerator.cpp?rev=268658&r1=268657&r2=268658&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/LTO/LTOCodeGenerator.cpp (original)
>> +++ llvm/trunk/lib/LTO/LTOCodeGenerator.cpp Thu May  5 13:14:55 2016
>> @@ -364,7 +364,7 @@ static void preserveDiscardableGVs(
>>   }
>>   llvm::Type *i8PTy = llvm::Type::getInt8PtrTy(TheModule.getContext());
>>   auto mayPreserveGlobal = [&](GlobalValue &GV) {
>> -    if (!GV.isDiscardableIfUnused() || GV.isDeclaration())
>> +    if (!GV.isDiscardableIfUnused() || GV.isDeclaration() || !GV.hasName())
>>       return;
>>     if (!mustPreserveGV(GV))
>>       return;
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list