diff options
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp | 11 |
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); |