summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-02-25 07:04:34 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-02-25 07:04:34 +0000
commit86673f2806cf9693f474f1a7ec6f555b98a2de54 (patch)
tree9568410e14006584ac73cbf398b28a0983ed34ec /llvm/lib/CodeGen/SelectionDAG
parent5c10a3aa7f8e0186ed716608b83b92235ea18593 (diff)
downloadbcm5719-llvm-86673f2806cf9693f474f1a7ec6f555b98a2de54.tar.gz
bcm5719-llvm-86673f2806cf9693f474f1a7ec6f555b98a2de54.zip
Clean up dwarf writer, part 1. This eliminated the horrible recursive getGlobalVariablesUsing and replaced it something readable. It eliminated use of slow UniqueVector and replaced it with StringMap, SmallVector, and DenseMap, etc. It also fixed some non-deterministic behavior.
This is a very minor compile time win. llvm-svn: 65438
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp8
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp4
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp26
3 files changed, 19 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index fb3d101f122..a0ed4755f9f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -319,8 +319,8 @@ bool FastISel::SelectCall(User *I) {
DbgStopPointInst *SPI = cast<DbgStopPointInst>(I);
if (DW && DW->ValidDebugInfo(SPI->getContext())) {
DICompileUnit CU(cast<GlobalVariable>(SPI->getContext()));
- unsigned SrcFile = DW->RecordSource(CU.getDirectory(),
- CU.getFilename());
+ unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(),
+ CU.getFilename());
unsigned Line = SPI->getLine();
unsigned Col = SPI->getColumn();
unsigned ID = DW->RecordSourceLine(Line, Col, SrcFile);
@@ -361,8 +361,8 @@ bool FastISel::SelectCall(User *I) {
// (most?) gdb expects.
DISubprogram Subprogram(cast<GlobalVariable>(SP));
DICompileUnit CompileUnit = Subprogram.getCompileUnit();
- unsigned SrcFile = DW->RecordSource(CompileUnit.getDirectory(),
- CompileUnit.getFilename());
+ unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(),
+ CompileUnit.getFilename());
// Record the source line but does not create a label for the normal
// function start. It will be emitted at asm emission time. However,
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 3cfe4f47a0e..d5d62dd2ab6 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -1287,8 +1287,8 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
GlobalVariable *CU_GV = cast<GlobalVariable>(DSP->getCompileUnit());
if (DW && (useDEBUG_LOC || useLABEL) && !CU_GV->isDeclaration()) {
DICompileUnit CU(cast<GlobalVariable>(DSP->getCompileUnit()));
- unsigned SrcFile = DW->RecordSource(CU.getDirectory(),
- CU.getFilename());
+ unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(),
+ CU.getFilename());
unsigned Line = DSP->getLine();
unsigned Col = DSP->getColumn();
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 4791465b096..91fecc32251 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -335,8 +335,8 @@ void FunctionLoweringInfo::set(Function &fn, MachineFunction &mf,
if (DW && DW->ValidDebugInfo(SPI->getContext())) {
DICompileUnit CU(cast<GlobalVariable>(SPI->getContext()));
- unsigned SrcFile = DW->RecordSource(CU.getDirectory(),
- CU.getFilename());
+ unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(),
+ CU.getFilename());
unsigned idx = MF->getOrCreateDebugLocID(SrcFile,
SPI->getLine(),
SPI->getColumn());
@@ -354,8 +354,8 @@ void FunctionLoweringInfo::set(Function &fn, MachineFunction &mf,
if (DW->ValidDebugInfo(SP)) {
DISubprogram Subprogram(cast<GlobalVariable>(SP));
DICompileUnit CU(Subprogram.getCompileUnit());
- unsigned SrcFile = DW->RecordSource(CU.getDirectory(),
- CU.getFilename());
+ unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(),
+ CU.getFilename());
unsigned Line = Subprogram.getLineNumber();
DL = DebugLoc::get(MF->getOrCreateDebugLocID(SrcFile, Line, 0));
}
@@ -3892,16 +3892,16 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
DwarfWriter *DW = DAG.getDwarfWriter();
DbgStopPointInst &SPI = cast<DbgStopPointInst>(I);
if (DW && DW->ValidDebugInfo(SPI.getContext())) {
+ MachineFunction &MF = DAG.getMachineFunction();
DAG.setRoot(DAG.getDbgStopPoint(getRoot(),
SPI.getLine(),
SPI.getColumn(),
SPI.getContext()));
DICompileUnit CU(cast<GlobalVariable>(SPI.getContext()));
- unsigned SrcFile = DW->RecordSource(CU.getDirectory(), CU.getFilename());
- unsigned idx = DAG.getMachineFunction().
- getOrCreateDebugLocID(SrcFile,
- SPI.getLine(),
- SPI.getColumn());
+ unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(),
+ CU.getFilename());
+ unsigned idx = MF.getOrCreateDebugLocID(SrcFile,
+ SPI.getLine(), SPI.getColumn());
setCurDebugLoc(DebugLoc::get(idx));
}
return 0;
@@ -3940,10 +3940,11 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
if (SP && DW->ValidDebugInfo(SP)) {
// llvm.dbg.func.start implicitly defines a dbg_stoppoint which is
// what (most?) gdb expects.
+ MachineFunction &MF = DAG.getMachineFunction();
DISubprogram Subprogram(cast<GlobalVariable>(SP));
DICompileUnit CompileUnit = Subprogram.getCompileUnit();
- unsigned SrcFile = DW->RecordSource(CompileUnit.getDirectory(),
- CompileUnit.getFilename());
+ unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(),
+ CompileUnit.getFilename());
// Record the source line but does not create a label for the normal
// function start. It will be emitted at asm emission time. However,
@@ -3957,8 +3958,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
getRoot(), LabelID));
}
- setCurDebugLoc(DebugLoc::get(DAG.getMachineFunction().
- getOrCreateDebugLocID(SrcFile, Line, 0)));
+ setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(SrcFile, Line, 0)));
}
return 0;
OpenPOWER on IntegriCloud