From b5b7a616460e40d81260a4e6fc866d4fc7440cef Mon Sep 17 00:00:00 2001 From: Timur Iskhodzhanov Date: Wed, 26 Mar 2014 11:24:36 +0000 Subject: Follow-up to r204790: don't try to emit line tables if there are no functions with DI in the TU llvm-svn: 204795 --- llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter') 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); -- cgit v1.2.3