diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-04-30 23:22:31 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-04-30 23:22:31 +0000 |
commit | a26eae64ddf607549f9e47046d46ea5b9ec648b4 (patch) | |
tree | c120bcc5dae1ed6c28cdf9b86b0dac5b9c71a65e /lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 19fee415f63ddb78fca703085fe56510be3e058c (diff) |
Make DebugLoc independent of DwarfWriter.
-Replace DebugLocTuple's Source ID with CompileUnit's GlobalVariable*
-Remove DwarfWriter::getOrCreateSourceID
-Make necessary changes for the above (fix callsites, etc.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 09ac586dd5..58e8490882 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -329,13 +329,10 @@ bool FastISel::SelectCall(User *I) { DbgStopPointInst *SPI = cast<DbgStopPointInst>(I); if (DW && DW->ValidDebugInfo(SPI->getContext(), CodeGenOpt::None)) { DICompileUnit CU(cast<GlobalVariable>(SPI->getContext())); - std::string Dir, FN; - unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir), - CU.getFilename(FN)); unsigned Line = SPI->getLine(); unsigned Col = SPI->getColumn(); - unsigned ID = DW->RecordSourceLine(Line, Col, SrcFile); - unsigned Idx = MF.getOrCreateDebugLocID(SrcFile, Line, Col); + unsigned ID = DW->RecordSourceLine(Line, Col, CU); + unsigned Idx = MF.getOrCreateDebugLocID(CU.getGV(), Line, Col); setCurDebugLoc(DebugLoc::get(Idx)); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); BuildMI(MBB, DL, II).addImm(ID); @@ -386,9 +383,6 @@ bool FastISel::SelectCall(User *I) { DebugLoc PrevLoc = DL; DISubprogram Subprogram(cast<GlobalVariable>(SP)); DICompileUnit CompileUnit = Subprogram.getCompileUnit(); - std::string Dir, FN; - unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(Dir), - CompileUnit.getFilename(FN)); if (!Subprogram.describes(MF.getFunction())) { // This is a beginning of an inlined function. @@ -400,21 +394,23 @@ bool FastISel::SelectCall(User *I) { return true; // Record the source line. unsigned Line = Subprogram.getLineNumber(); - unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile); - setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(SrcFile, Line, 0))); + unsigned LabelID = DW->RecordSourceLine(Line, 0, CompileUnit); + setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID( + CompileUnit.getGV(), Line, 0))); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); BuildMI(MBB, DL, II).addImm(LabelID); DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc); DW->RecordInlinedFnStart(FSI, Subprogram, LabelID, - PrevLocTpl.Src, + DICompileUnit(PrevLocTpl.CompileUnit), PrevLocTpl.Line, PrevLocTpl.Col); } else { // Record the source line. unsigned Line = Subprogram.getLineNumber(); - setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(SrcFile, Line, 0))); - DW->RecordSourceLine(Line, 0, SrcFile); + setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID( + CompileUnit.getGV(), Line, 0))); + DW->RecordSourceLine(Line, 0, CompileUnit); // llvm.dbg.func_start also defines beginning of function scope. DW->RecordRegionStart(cast<GlobalVariable>(FSI->getSubprogram())); } |