diff options
author | Owen Anderson <resistor@mac.com> | 2008-06-26 17:06:02 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-06-26 17:06:02 +0000 |
commit | 8342cfff9a221dd69c1d9c615414ec3b8c8db776 (patch) | |
tree | f1172dbbc4d03de343c982b2243086476c6c0ecf /lib/CodeGen/MachineModuleInfo.cpp | |
parent | 3987f8e1ac727f77dfe605ced638ca19a4602928 (diff) |
Don't create a whole new string just to copy the elements into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r-- | lib/CodeGen/MachineModuleInfo.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index 1720745e44..60526643fd 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/lib/CodeGen/MachineModuleInfo.cpp @@ -231,11 +231,9 @@ public: } virtual void Apply(std::string &Field) { Constant *C = CI->getOperand(I++); - std::string S; - if (GetConstantStringInfo(C, S)) - Field = S; - else - Field = ""; + // Fills in the string if it succeeds + if (!GetConstantStringInfo(C, Field)) + Field.clear(); } virtual void Apply(DebugInfoDesc *&Field) { Constant *C = CI->getOperand(I++); |