aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-04-16 01:31:54 +0000
committerDevang Patel <dpatel@apple.com>2009-04-16 01:31:54 +0000
commit682e0e6a72af42f31e6fcf329c7bb5cfaff7459d (patch)
tree089184f8fdfccc366d2c0860c46f4db2c5821d8f
parentd0d3494b2f279a2a8be8642c87c1d3f210dd437f (diff)
downloadexternal_llvm-682e0e6a72af42f31e6fcf329c7bb5cfaff7459d.zip
external_llvm-682e0e6a72af42f31e6fcf329c7bb5cfaff7459d.tar.gz
external_llvm-682e0e6a72af42f31e6fcf329c7bb5cfaff7459d.tar.bz2
If location where the function was inlined is not know then do not emit debug info describing inlinied region.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69252 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 71092c1..ef7250f 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -387,12 +387,14 @@ bool FastISel::SelectCall(User *I) {
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 @@ bool FastISel::SelectCall(User *I) {
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()));
}