summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/DwarfWriter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/DwarfWriter.cpp b/llvm/lib/CodeGen/DwarfWriter.cpp
index 010dfa0a793..947b420cd51 100644
--- a/llvm/lib/CodeGen/DwarfWriter.cpp
+++ b/llvm/lib/CodeGen/DwarfWriter.cpp
@@ -2720,8 +2720,11 @@ public:
// Emit label for the implicitly defined dbg.stoppoint at the start of
// the function.
- const SourceLineInfo &LineInfo = MMI->getSourceLines()[0];
- Asm->printLabel(LineInfo.getLabelID());
+ const std::vector<SourceLineInfo> &LineInfos = MMI->getSourceLines();
+ if (!LineInfos.empty()) {
+ const SourceLineInfo &LineInfo = LineInfos[0];
+ Asm->printLabel(LineInfo.getLabelID());
+ }
}
/// EndFunction - Gather and emit post-function debug information.
OpenPOWER on IntegriCloud