diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-03-09 05:04:40 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-03-09 05:04:40 +0000 |
commit | c6869f4695ee7dcaab1f67fa87a92546dd877cc6 (patch) | |
tree | a5f400f93e79c30c2838916922ce09afd92c5e18 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | |
parent | 4a48815bd95d71ef6e367c3e650d033733481645 (diff) | |
download | bcm5719-llvm-c6869f4695ee7dcaab1f67fa87a92546dd877cc6.tar.gz bcm5719-llvm-c6869f4695ee7dcaab1f67fa87a92546dd877cc6.zip |
Pass in a std::string when getting the names of debugging things. This cuts down
on the number of times a std::string is created and copied.
llvm-svn: 66396
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index b3a06ea9d75..0dbc35b2248 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -335,8 +335,9 @@ void FunctionLoweringInfo::set(Function &fn, MachineFunction &mf, if (DW && DW->ValidDebugInfo(SPI->getContext())) { DICompileUnit CU(cast<GlobalVariable>(SPI->getContext())); - unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(), - CU.getFilename()); + std::string Dir, FN; + unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir), + CU.getFilename(FN)); unsigned idx = MF->getOrCreateDebugLocID(SrcFile, SPI->getLine(), SPI->getColumn()); @@ -354,8 +355,9 @@ void FunctionLoweringInfo::set(Function &fn, MachineFunction &mf, if (DW->ValidDebugInfo(SP)) { DISubprogram Subprogram(cast<GlobalVariable>(SP)); DICompileUnit CU(Subprogram.getCompileUnit()); - unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(), - CU.getFilename()); + std::string Dir, FN; + unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir), + CU.getFilename(FN)); unsigned Line = Subprogram.getLineNumber(); DL = DebugLoc::get(MF->getOrCreateDebugLocID(SrcFile, Line, 0)); } @@ -3902,8 +3904,9 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { SPI.getColumn(), SPI.getContext())); DICompileUnit CU(cast<GlobalVariable>(SPI.getContext())); - unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(), - CU.getFilename()); + std::string Dir, FN; + unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir), + CU.getFilename(FN)); unsigned idx = MF.getOrCreateDebugLocID(SrcFile, SPI.getLine(), SPI.getColumn()); setCurDebugLoc(DebugLoc::get(idx)); @@ -3947,8 +3950,9 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { MachineFunction &MF = DAG.getMachineFunction(); DISubprogram Subprogram(cast<GlobalVariable>(SP)); DICompileUnit CompileUnit = Subprogram.getCompileUnit(); - unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(), - CompileUnit.getFilename()); + std::string Dir, FN; + unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(Dir), + CompileUnit.getFilename(FN)); // Record the source line but does not create a label for the normal // function start. It will be emitted at asm emission time. However, |