aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineModuleInfo.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-06-26 17:06:02 +0000
committerOwen Anderson <resistor@mac.com>2008-06-26 17:06:02 +0000
commit7df0d5853581e4424ecfbede773713ee88fcfad1 (patch)
tree05126a92c0a35c480a12d77454a42852b3c37868 /llvm/lib/CodeGen/MachineModuleInfo.cpp
parent1fb47ad928291d3e37897a9398bc9f88257c5620 (diff)
downloadllvm-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.cpp8
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++);