Don't create a whole new string just to copy the elements into it.

llvm-svn: 52785
This commit is contained in:
Owen Anderson 2008-06-26 17:06:02 +00:00
parent 1fb47ad928
commit 7df0d58535
1 changed files with 3 additions and 5 deletions

View File

@ -231,11 +231,9 @@ public:
} }
virtual void Apply(std::string &Field) { virtual void Apply(std::string &Field) {
Constant *C = CI->getOperand(I++); Constant *C = CI->getOperand(I++);
std::string S; // Fills in the string if it succeeds
if (GetConstantStringInfo(C, S)) if (!GetConstantStringInfo(C, Field))
Field = S; Field.clear();
else
Field = "";
} }
virtual void Apply(DebugInfoDesc *&Field) { virtual void Apply(DebugInfoDesc *&Field) {
Constant *C = CI->getOperand(I++); Constant *C = CI->getOperand(I++);