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 | 7df0d5853581e4424ecfbede773713ee88fcfad1 (patch) | |
tree | 05126a92c0a35c480a12d77454a42852b3c37868 /llvm/lib/CodeGen/MachineModuleInfo.cpp | |
parent | 1fb47ad928291d3e37897a9398bc9f88257c5620 (diff) | |
download | llvm-7df0d5853581e4424ecfbede773713ee88fcfad1.zip llvm-7df0d5853581e4424ecfbede773713ee88fcfad1.tar.gz llvm-7df0d5853581e4424ecfbede773713ee88fcfad1.tar.bz2 |
Don't create a whole new string just to copy the elements into it.
llvm-svn: 52785
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index 1720745..6052664 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/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++); |