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
diff --git a/lib/Analysis/DbgInfoPrinter.cpp b/lib/Analysis/DbgInfoPrinter.cpp
index 522e98f..127f931 100644
--- a/lib/Analysis/DbgInfoPrinter.cpp
+++ b/lib/Analysis/DbgInfoPrinter.cpp
@@ -59,8 +59,9 @@
{
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::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";
}