Skip to content

Commit

Permalink
If location where the function was inlined is not know then do not em…
Browse files Browse the repository at this point in the history
…it debug info describing inlinied region.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69252 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Devang Patel committed Apr 16, 2009
1 parent cf02157 commit 9205f38
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/CodeGen/SelectionDAG/FastISel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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()));
}
Expand Down

0 comments on commit 9205f38

Please sign in to comment.