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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66396 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2009-03-09 05:04:40 +00:00
parent bce6091d95
commit ccbdc7ab82
8 changed files with 132 additions and 64 deletions
+6 -4
View File
@@ -59,8 +59,9 @@ void PrintDbgInfo::printVariableDeclaration(const Value *V)
{
if(const DbgDeclareInst* DDI = findDbgDeclare(V)) {
DIVariable Var(cast<GlobalVariable>(DDI->getVariable()));
Out << "; variable " << Var.getName()
<< " of type " << Var.getType().getName()
std::string Res1, Res2;
Out << "; variable " << Var.getName(Res1)
<< " of type " << Var.getType().getName(Res2)
<< " at line " << Var.getLineNumber() << "\n";
}
}
@@ -83,8 +84,9 @@ void PrintDbgInfo::printStopPoint(const DbgStopPointInst *DSI)
void PrintDbgInfo::printFuncStart(const DbgFuncStartInst *FS)
{
DISubprogram Subprogram(cast<GlobalVariable>(FS->getSubprogram()));
Out << ";fully qualified function name: " << Subprogram.getDisplayName()
<< " return type: " << Subprogram.getType().getName()
std::string Res1, Res2;
Out << ";fully qualified function name: " << Subprogram.getDisplayName(Res1)
<< " return type: " << Subprogram.getType().getName(Res2)
<< " at line " << Subprogram.getLineNumber()
<< "\n\n";
}