[llvm-commits] [llvm] r90281 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Devang Patel
dpatel at apple.com
Tue Dec 1 15:07:59 PST 2009
Author: dpatel
Date: Tue Dec 1 17:07:59 2009
New Revision: 90281
URL: http://llvm.org/viewvc/llvm-project?rev=90281&view=rev
Log:
Reuse existing subprogram DIE.
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=90281&r1=90280&r2=90281&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Dec 1 17:07:59 2009
@@ -1087,7 +1087,11 @@
const DISubprogram &SP,
bool IsConstructor,
bool IsInlined) {
- DIE *SPDie = new DIE(dwarf::DW_TAG_subprogram);
+ DIE *SPDie = ModuleCU->getDIE(SP.getNode());
+ if (SPDie)
+ return SPDie;
+
+ SPDie = new DIE(dwarf::DW_TAG_subprogram);
addString(SPDie, dwarf::DW_AT_name, dwarf::DW_FORM_string, SP.getName());
StringRef LinkageName = SP.getLinkageName();
@@ -1669,7 +1673,8 @@
ModuleCU->insertDIE(N, SubprogramDie);
// Add to context owner.
- ModuleCU->getCUDie()->addChild(SubprogramDie);
+ if (SP.getContext().getNode() == SP.getCompileUnit().getNode())
+ ModuleCU->getCUDie()->addChild(SubprogramDie);
// Expose as global.
ModuleCU->addGlobal(SP.getName(), SubprogramDie);
More information about the llvm-commits
mailing list