[llvm-commits] [llvm] r70630 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp

Nick Lewycky nicholas at mxc.ca
Sat May 2 10:42:00 PDT 2009


Chris Lattner wrote:
> 
> On May 2, 2009, at 9:21 AM, Nick Lewycky wrote:
> 
>> Author: nicholas
>> Date: Sat May  2 11:21:50 2009
>> New Revision: 70630
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=70630&view=rev
>> Log:
>> Don't append ".b" to the names of globals that are being shrunk to 
>> booleans.
> 
> Why not?  This is useful to know when looking at dumps, what does this fix?

It caused a unit failure for something internally when the global's name 
could no longer be interpreted by c++filt.

I'm not wedded to this approach but I thought this change would be 
pretty uncontroversial.

Nick

>>
>>
>> Modified:
>>    llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
>>
>> Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=70630&r1=70629&r2=70630&view=diff 
>>
>>
>> ============================================================================== 
>>
>> --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
>> +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Sat May  2 11:21:50 2009
>> @@ -1549,10 +1549,12 @@
>>
>>   // Create the new global, initializing it to false.
>>   GlobalVariable *NewGV = new GlobalVariable(Type::Int1Ty, false,
>> -         GlobalValue::InternalLinkage, ConstantInt::getFalse(),
>> -                                             GV->getName()+".b",
>> +                                             
>> GlobalValue::InternalLinkage,
>> +                                             ConstantInt::getFalse(),
>> +                                             "",
>>                                              (Module *)NULL,
>>                                              GV->isThreadLocal());
>> +  NewGV->takeName(GV);
>>   GV->getParent()->getGlobalList().insert(GV, NewGV);
>>
>>   Constant *InitVal = GV->getInitializer();
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> 




More information about the llvm-commits mailing list