diff options
author | Devang Patel <dpatel@apple.com> | 2010-02-05 23:09:20 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-02-05 23:09:20 +0000 |
commit | d4be4ced766f8456ee70c7ff645c4be986525c60 (patch) | |
tree | a87a52902334535d2cab14253b1d03743422af0c /llvm/lib | |
parent | 9d624778a32e5ec7c94f286d9f415a04b3665699 (diff) | |
download | bcm5719-llvm-d4be4ced766f8456ee70c7ff645c4be986525c60.tar.gz bcm5719-llvm-d4be4ced766f8456ee70c7ff645c4be986525c60.zip |
Do not generate specification DIE for nested functions.
llvm-svn: 95452
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index e46916e6d9c..f0aa9f5eb84 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1327,7 +1327,13 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(MDNode *SPNode) { 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(); |