summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorStuart Hastings <stuart@apple.com>2010-07-08 22:28:59 +0000
committerStuart Hastings <stuart@apple.com>2010-07-08 22:28:59 +0000
commit43d226deeac18cdfcedee8ff44954ac742dc9b9d (patch)
tree3e7552e65ff47c46966f8c33dd57f154902ec9cd /llvm/lib/CodeGen
parent9f034c1e5d061559cae3c58d01affc0e45f122ed (diff)
downloadbcm5719-llvm-43d226deeac18cdfcedee8ff44954ac742dc9b9d.tar.gz
bcm5719-llvm-43d226deeac18cdfcedee8ff44954ac742dc9b9d.zip
Fix decl/def debug info for template functions. Radar 8063111.
llvm-svn: 107919
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 6f2634bee71..959644641ab 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2682,18 +2682,21 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
if (FDL.isUnknown()) return;
const MDNode *Scope = FDL.getScope(MF->getFunction()->getContext());
+ const MDNode *TheScope = 0;
DISubprogram SP = getDISubprogram(Scope);
unsigned Line, Col;
if (SP.Verify()) {
Line = SP.getLineNumber();
Col = 0;
+ TheScope = SP;
} else {
Line = FDL.getLine();
Col = FDL.getCol();
+ TheScope = Scope;
}
- recordSourceLine(Line, Col, Scope);
+ recordSourceLine(Line, Col, TheScope);
/// ProcessedArgs - Collection of arguments already processed.
SmallPtrSet<const MDNode *, 8> ProcessedArgs;
@@ -2899,16 +2902,6 @@ MCSymbol *DwarfDebug::recordSourceLine(unsigned Line, unsigned Col,
Src = GetOrCreateSourceID(Dir, Fn);
}
-#if 0
- if (!Lines.empty()) {
- SrcLineInfo lastSrcLineInfo = Lines.back();
- // Emitting sequential line records with the same line number (but
- // different addresses) seems to confuse GDB. Avoid this.
- if (lastSrcLineInfo.getLine() == Line)
- return NULL;
- }
-#endif
-
MCSymbol *Label = MMI->getContext().CreateTempSymbol();
Lines.push_back(SrcLineInfo(Line, Col, Src, Label));
OpenPOWER on IntegriCloud