[llvm-commits] [llvm] r49176 - /llvm/trunk/lib/CodeGen/DwarfWriter.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Thu Apr 3 10:37:43 PDT 2008
Author: alenhar2
Date: Thu Apr 3 12:37:43 2008
New Revision: 49176
URL: http://llvm.org/viewvc/llvm-project?rev=49176&view=rev
Log:
if some functions don't have debug info, we were outputing the same label at the start of each of those functions. This makes assemblers unhappy
Modified:
llvm/trunk/lib/CodeGen/DwarfWriter.cpp
Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=49176&r1=49175&r2=49176&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Thu Apr 3 12:37:43 2008
@@ -2720,8 +2720,11 @@
// 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.
More information about the llvm-commits
mailing list