summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2014-03-26 11:24:36 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2014-03-26 11:24:36 +0000
commitb5b7a616460e40d81260a4e6fc866d4fc7440cef (patch)
tree64cb4da8b27cc8305b5aa087b6a7147baf95760a /llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
parent7caa0b9e369d0861797acf9b31bb958ac820c4be (diff)
downloadbcm5719-llvm-b5b7a616460e40d81260a4e6fc866d4fc7440cef.tar.gz
bcm5719-llvm-b5b7a616460e40d81260a4e6fc866d4fc7440cef.zip
Follow-up to r204790: don't try to emit line tables if there are no functions with DI in the TU
llvm-svn: 204795
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp b/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
index 9363303572f..50b2ca82ec0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
@@ -304,11 +304,18 @@ void WinCodeViewLineTables::beginFunction(const MachineFunction *MF) {
}
}
-void WinCodeViewLineTables::endFunction(const MachineFunction *) {
+void WinCodeViewLineTables::endFunction(const MachineFunction *MF) {
if (!Asm || !CurFn) // We haven't created any debug info for this function.
return;
- if (!CurFn->Instrs.empty()) {
+ const Function *GV = MF->getFunction();
+ assert(FnDebugInfo.count(GV) == true);
+ assert(CurFn == &FnDebugInfo[GV]);
+
+ if (CurFn->Instrs.empty()) {
+ FnDebugInfo.erase(GV);
+ VisitedFunctions.pop_back();
+ } else {
// Define end label for subprogram.
MCSymbol *FunctionEndSym = Asm->OutStreamer.getContext().CreateTempSymbol();
Asm->OutStreamer.EmitLabel(FunctionEndSym);
OpenPOWER on IntegriCloud