[llvm] r204528 - Dwarf Debug: Remove some cargo-cult type uniquing. Scopes do not have

Eric Christopher echristo at gmail.com
Mon Mar 24 16:18:20 PDT 2014


On Mon, Mar 24, 2014 at 4:12 PM, Manman Ren <manman.ren at gmail.com> wrote:
>
>
>
> On Fri, Mar 21, 2014 at 3:16 PM, Adrian Prantl <aprantl at apple.com> wrote:
>>
>> Author: adrian
>> Date: Fri Mar 21 17:16:32 2014
>> New Revision: 204528
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=204528&view=rev
>> Log:
>> Dwarf Debug: Remove some cargo-cult type uniquing. Scopes do not have
>> an ID, so this is a noop.
>> Thanks Manman for catching this!
>>
>> 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=204528&r1=204527&r2=204528&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Mar 21 17:16:32
>> 2014
>> @@ -604,7 +604,7 @@ DIE *DwarfDebug::constructScopeDIE(Dwarf
>>      return NULL;
>>
>>    // Unique scope where applicable.
>> -  DIScope DS(resolve(DIScope(Scope->getScopeNode()).getRef()));
>> +  DIScope DS(Scope->getScopeNode());
>
>
> Right now, DICompositeType has an ID and it is also one kind of DIScope, so
> the statement "scopes do not have an ID" sounds incorrect :]
>
> DISubprogram does not have an ID and we should remove the following noop:
>
> /// getOrCreateSubprogramDIE - Create new DIE using SP.
> DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
>   ...
>   // Unique declarations based on the ODR, where applicable.
>   SP = DISubprogram(DD->resolve(SP.getRef()));
>

Yeah, where are we on using references for all types? I thought when
you'd finished that we used them everywhere but apparently not. We
should get that fixed so there's less confusion here.

-eric



More information about the llvm-commits mailing list