diff options
author | Devang Patel <dpatel@apple.com> | 2009-04-16 01:31:54 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-04-16 01:31:54 +0000 |
commit | 43fc7e481b9a39e766925d25312b2cbd18b78d1b (patch) | |
tree | 26dde5edcd870b38b79c1cc8bf0eea716b0e0301 /llvm/lib | |
parent | 38676d50dc05b75f410e79a57e2d5ae357b93c68 (diff) | |
download | bcm5719-llvm-43fc7e481b9a39e766925d25312b2cbd18b78d1b.tar.gz bcm5719-llvm-43fc7e481b9a39e766925d25312b2cbd18b78d1b.zip |
If location where the function was inlined is not know then do not emit debug info describing inlinied region.
llvm-svn: 69252
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 71092c1d612..ef7250f944c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/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())); } |