diff options
| author | Stuart Hastings <stuart@apple.com> | 2010-07-19 23:56:30 +0000 |
|---|---|---|
| committer | Stuart Hastings <stuart@apple.com> | 2010-07-19 23:56:30 +0000 |
| commit | 61475c5c3c30662d82efe16076d31303b9d28637 (patch) | |
| tree | aa8593379734a21b76463d17331c53c3a84d6dfa /llvm/lib/CodeGen/AsmPrinter | |
| parent | b792b463afd6884554b9397bdf54743099dea7c5 (diff) | |
| download | bcm5719-llvm-61475c5c3c30662d82efe16076d31303b9d28637.tar.gz bcm5719-llvm-61475c5c3c30662d82efe16076d31303b9d28637.zip | |
Correct line info for declarations/definitions. Radar 8063111.
llvm-svn: 108784
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index d891ce8a475..a1f646a4253 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2683,18 +2683,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; @@ -2900,16 +2903,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)); |

