[llvm] r178941 - Dwarf: use utostr on CUID to append to SmallString.

Manman Ren mren at apple.com
Thu Apr 11 16:35:14 PDT 2013


Oops I thought I replied to Rafael's comment but I didn't.

Basically this is a straight-forward fix for CUID >= 256. When CUID is 256, NamePair += CUID will be equivalent to NamePair += 0, which will take us to
an entry for CUID 0. To test this fix, we need to have at least 256 CUs in the testing case and some actual line tables.

Thanks,
Manman

On Apr 11, 2013, at 3:39 PM, Eric Christopher wrote:

> Did you ever commit the testcase that Rafael requested?
> 
> -eric
> 
> On Fri, Apr 5, 2013 at 6:02 PM, Manman Ren <mren at apple.com> wrote:
>> Author: mren
>> Date: Fri Apr  5 20:02:38 2013
>> New Revision: 178941
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=178941&view=rev
>> Log:
>> Dwarf: use utostr on CUID to append to SmallString.
>> 
>> We used to do "SmallString += CUID", which is incorrect, since CUID will
>> be truncated to a char.
>> 
>> rdar://problem/13573833
>> 
>> Modified:
>>    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
>> 
>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=178941&r1=178940&r2=178941&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Apr  5 20:02:38 2013
>> @@ -643,7 +643,7 @@ unsigned DwarfDebug::getOrCreateSourceID
>> 
>>   // We look up the CUID/file/dir by concatenating them with a zero byte.
>>   SmallString<128> NamePair;
>> -  NamePair += CUID;
>> +  NamePair += utostr(CUID);
>>   NamePair += '\0';
>>   NamePair += DirName;
>>   NamePair += '\0'; // Zero bytes are not allowed in paths.
>> 
>> 
>> _______________________________________________
>> 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