aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp b/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
index b5e0929..d2b4eec 100644
--- a/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
+++ b/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp
@@ -190,8 +190,11 @@ void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
return;
assert(FI.End && "Don't know where the function ends?");
- StringRef FuncName = getDISubprogram(GV).getDisplayName(),
- GVName = GV->getName();
+ StringRef GVName = GV->getName();
+ StringRef FuncName;
+ if (DISubprogram SP = getDISubprogram(GV))
+ FuncName = SP.getDisplayName();
+
// FIXME Clang currently sets DisplayName to "bar" for a C++
// "namespace_foo::bar" function, see PR21528. Luckily, dbghelp.dll is trying
// to demangle display names anyways, so let's just put a mangled name into
@@ -364,10 +367,7 @@ void WinCodeViewLineTables::endFunction(const MachineFunction *MF) {
FnDebugInfo.erase(GV);
VisitedFunctions.pop_back();
} else {
- // Define end label for subprogram.
- MCSymbol *FunctionEndSym = Asm->OutStreamer.getContext().CreateTempSymbol();
- Asm->OutStreamer.EmitLabel(FunctionEndSym);
- CurFn->End = FunctionEndSym;
+ CurFn->End = Asm->getFunctionEnd();
}
CurFn = nullptr;
}