diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/VMCore/Value.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp index af753236c1d..30ca5c35b5f 100644 --- a/llvm/lib/VMCore/Value.cpp +++ b/llvm/lib/VMCore/Value.cpp @@ -141,6 +141,12 @@ void Value::setName(const std::string &name) { /// 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); |

