diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-02-25 07:04:34 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-02-25 07:04:34 +0000 |
commit | e3d423244ae288b2c9021dbb3cd7fb973d1cfc31 (patch) | |
tree | cf717e0368c572a77ad775c521cef9be83a8a7b4 /lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | |
parent | 20babb112c8d8aab89a5e86347e2bfdb90603ce8 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 4791465b09..91fecc3225 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/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; |