[llvm-commits] CVS: llvm/lib/VMCore/Value.cpp
Chris Lattner
sabre at nondot.org
Sat Feb 10 17:04:25 PST 2007
Changes in directory llvm/lib/VMCore:
Value.cpp updated: 1.63 -> 1.64
---
Log message:
add an optimization for the case where the src has no name
---
Diffs of the changes: (+6 -0)
Value.cpp | 6 ++++++
1 files changed, 6 insertions(+)
Index: llvm/lib/VMCore/Value.cpp
diff -u llvm/lib/VMCore/Value.cpp:1.63 llvm/lib/VMCore/Value.cpp:1.64
--- llvm/lib/VMCore/Value.cpp:1.63 Sat Feb 10 18:37:27 2007
+++ llvm/lib/VMCore/Value.cpp Sat Feb 10 19:04:09 2007
@@ -141,6 +141,12 @@
/// takeName - transfer the name from V to this value, setting V's name to
/// empty. It is an error to call V->takeName(V).
void Value::takeName(Value *V) {
+ if (!V->hasName()) {
+ if (hasName())
+ setName("");
+ return;
+ }
+
std::string Name = V->getName();
V->setName("");
setName(Name);
More information about the llvm-commits
mailing list