diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-30 21:32:28 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-30 21:32:28 +0000 |
commit | fd07a2af23c6999c854d351bf865ce6407cee629 (patch) | |
tree | ca9452948f9e195f7624e1b1ef368d842ab24818 /llvm/lib/CodeGen/AsmPrinter | |
parent | c02e85859bcd58a16828104c3cfc06208ab7efd4 (diff) | |
download | bcm5719-llvm-fd07a2af23c6999c854d351bf865ce6407cee629.tar.gz bcm5719-llvm-fd07a2af23c6999c854d351bf865ce6407cee629.zip |
DwarfDebug: Avoid creating new DebugLocs in the backend
Don't use `DebugLoc::getFnDebugLoc()`, which creates new `MDLocation`s,
in the backend. We just want to grab the subprogram here anyway.
llvm-svn: 233601
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 2d9c311029a..9303865d7ca 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1168,13 +1168,11 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { // Record beginning of function. PrologEndLoc = findPrologueEndLoc(MF); - if (PrologEndLoc) { - DebugLoc FnStartDL = PrologEndLoc.getFnDebugLoc(); - + if (MDLocation *L = PrologEndLoc) { // We'd like to list the prologue as "not statements" but GDB behaves // poorly if we do that. Revisit this with caution/GDB (7.5+) testing. - recordSourceLine(FnStartDL.getLine(), FnStartDL.getCol(), - FnStartDL.getScope(), DWARF2_FLAG_IS_STMT); + auto *SP = L->getInlinedAtScope()->getSubprogram(); + recordSourceLine(SP->getScopeLine(), 0, SP, DWARF2_FLAG_IS_STMT); } } |