summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-04-30 23:22:31 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-04-30 23:22:31 +0000
commita5037484a4999e2f4e15b5e97da2a4d47ac22576 (patch)
treebefe0187d86d03c253605879ae39ad5e08fbe36c /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parent5e965472b95824ea251c7adfa7205d22d3fcaa05 (diff)
downloadbcm5719-llvm-a5037484a4999e2f4e15b5e97da2a4d47ac22576.tar.gz
bcm5719-llvm-a5037484a4999e2f4e15b5e97da2a4d47ac22576.zip
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.) llvm-svn: 70520
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 09ac586dd5e..58e84908820 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/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()));
}
OpenPOWER on IntegriCloud