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

Manman Ren manman.ren at gmail.com
Mon Mar 24 16:12:30 PDT 2014


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()));


Thanks,
Manman


>    SmallVector<DIE *, 8> Children;
>    DIE *ObjectPointer = NULL;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140324/4f854038/attachment.html>


More information about the llvm-commits mailing list