diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-05-20 03:23:24 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-05-20 03:23:24 +0000 |
commit | 956583e98e57bea245137a7833a4b329edd897cf (patch) | |
tree | 1110a0d5a762be3ffbcdf00fed484f7f20229e0d /lib/CodeGen/AsmPrinter | |
parent | 53d560e8eb3877d6214dd97f0f1ee07b56730398 (diff) | |
download | llvm-956583e98e57bea245137a7833a4b329edd897cf.tar.gz llvm-956583e98e57bea245137a7833a4b329edd897cf.tar.bz2 llvm-956583e98e57bea245137a7833a4b329edd897cf.tar.xz |
DebugInfo: Emit function definitions within their namespace scope.
This workaround (presumably for ancient GDB) doesn't appear to be
required (GDB 7.5 seems to tolerate function definition DIEs in
namespace scope just fine).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index c649aa1345..5688d55faf 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -326,28 +326,6 @@ DIE &DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU, // Pick up abstract subprogram DIE. SPDie = &SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie()); SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_abstract_origin, *AbsSPDIE); - } else if (!SP.getFunctionDeclaration()) { - // 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. - DIScope SPContext = resolve(SP.getContext()); - if (SP.isDefinition() && !SPContext.isCompileUnit() && - !SPContext.isFile() && !isSubprogramContext(SPContext)) { - SPCU.addFlag(*SPDie, dwarf::DW_AT_declaration); - - // Add arguments. - DICompositeType SPTy = SP.getType(); - DIArray Args = SPTy.getTypeArray(); - uint16_t SPTag = SPTy.getTag(); - if (SPTag == dwarf::DW_TAG_subroutine_type) - SPCU.constructSubprogramArguments(*SPDie, Args); - DIE *SPDeclDie = SPDie; - SPDie = - &SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie()); - SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_specification, *SPDeclDie); - } } attachLowHighPC(SPCU, *SPDie, FunctionBeginSym, FunctionEndSym); |