[llvm-commits] [llvm] r69252 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Devang Patel
dpatel at apple.com
Wed Apr 15 18:31:55 PDT 2009
Author: dpatel
Date: Wed Apr 15 20:31:54 2009
New Revision: 69252
URL: http://llvm.org/viewvc/llvm-project?rev=69252&view=rev
Log:
If location where the function was inlined is not know then do not emit debug info describing inlinied region.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=69252&r1=69251&r2=69252&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Apr 15 20:31:54 2009
@@ -387,12 +387,14 @@
unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(Dir),
CompileUnit.getFilename(FN));
- // Record the source line.
- unsigned Line = Subprogram.getLineNumber();
- unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
- setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(SrcFile, Line, 0)));
- if (!Subprogram.describes(MF.getFunction())) {
+ if (!Subprogram.describes(MF.getFunction()) && !PrevLoc.isUnknown()) {
// This is a beginning of an inlined function.
+
+ // Record the source line.
+ unsigned Line = Subprogram.getLineNumber();
+ unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
+ setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(SrcFile, Line, 0)));
+
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
BuildMI(MBB, DL, II).addImm(LabelID);
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
@@ -401,6 +403,10 @@
PrevLocTpl.Line,
PrevLocTpl.Col);
} else {
+ // Record the source line.
+ unsigned Line = Subprogram.getLineNumber();
+ setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(SrcFile, Line, 0)));
+
// llvm.dbg.func_start also defines beginning of function scope.
DW->RecordRegionStart(cast<GlobalVariable>(FSI->getSubprogram()));
}
More information about the llvm-commits
mailing list