[llvm-branch-commits] [llvm-branch] r95443 - /llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Devang Patel
dpatel at apple.com
Fri Feb 5 14:42:43 PST 2010
Author: dpatel
Date: Fri Feb 5 16:42:43 2010
New Revision: 95443
URL: http://llvm.org/viewvc/llvm-project?rev=95443&view=rev
Log:
Do not generate specification DIE for nested functions.
Modified:
llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=95443&r1=95442&r2=95443&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Feb 5 16:42:43 2010
@@ -1293,7 +1293,13 @@
DIE *SPDie = ModuleCU->getDIE(SPNode);
assert (SPDie && "Unable to find subprogram DIE!");
DISubprogram SP(SPNode);
- if (SP.isDefinition() && !SP.getContext().isCompileUnit()) {
+ // There is not any need to generate specification DIE for a function
+ // defined at compile unit level. If a function is defined inside another
+ // function then gdb prefers the definition at top level and but does not
+ // expect specification DIE in parent function. So avoid creating
+ // specification DIE for a function defined inside a function.
+ if (SP.isDefinition() && !SP.getContext().isCompileUnit()
+ && !SP.getContext().isSubprogram()) {
addUInt(SPDie, dwarf::DW_AT_declaration, dwarf::DW_FORM_flag, 1);
// Add arguments.
DICompositeType SPTy = SP.getType();
More information about the llvm-branch-commits
mailing list