diff options
author | Devang Patel <dpatel@apple.com> | 2009-04-13 17:02:03 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-04-13 17:02:03 +0000 |
commit | 80be3511edf9ce81d93c0cf5167b666c637a53f3 (patch) | |
tree | 633d282fc2864ec62dc5a975ed243761b1ea0c6b /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 4c7626e7b6824fd088f1ac1a496a13e9d3886089 (diff) | |
download | bcm5719-llvm-80be3511edf9ce81d93c0cf5167b666c637a53f3.tar.gz bcm5719-llvm-80be3511edf9ce81d93c0cf5167b666c637a53f3.zip |
Reapply 68847.
Now debug_inlined section is covered by TAI->doesDwarfUsesInlineInfoSection(), which is false by default.
llvm-svn: 68964
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 251e96a771c..cc425e51190 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -377,11 +377,23 @@ bool FastISel::SelectCall(User *I) { // Record the source line. unsigned Line = Subprogram.getLineNumber(); - DW->RecordSourceLine(Line, 0, SrcFile); + unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile); setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(SrcFile, Line, 0))); - // llvm.dbg.func_start also defines beginning of function scope. - DW->RecordRegionStart(cast<GlobalVariable>(FSI->getSubprogram())); + std::string SPName; + Subprogram.getLinkageName(SPName); + if (!SPName.empty() + && strcmp(SPName.c_str(), MF.getFunction()->getNameStart())) { + // This is a beginning of inlined function. + DW->RecordRegionStart(cast<GlobalVariable>(FSI->getSubprogram()), + LabelID); + const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); + BuildMI(MBB, DL, II).addImm(LabelID); + DW->RecordInlineInfo(Subprogram.getGV(), LabelID); + } else { + // llvm.dbg.func_start also defines beginning of function scope. + DW->RecordRegionStart(cast<GlobalVariable>(FSI->getSubprogram())); + } } return true; |