1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00

If location where the function was inlined is not know then do not emit debug info describing inlinied region.

llvm-svn: 69252
This commit is contained in:
Devang Patel 2009-04-16 01:31:54 +00:00
parent 1d21ddd345
commit c6c6759194

View File

@ -387,12 +387,14 @@ bool FastISel::SelectCall(User *I) {
unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(Dir),
CompileUnit.getFilename(FN));
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)));
if (!Subprogram.describes(MF.getFunction())) {
// This is a beginning of an inlined function.
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()));
}