mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-28 22:43:29 +00:00
add an optimization for the case where the src has no name
llvm-svn: 34174
This commit is contained in:
parent
b994bafc0f
commit
50ea7bc913
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user