mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
add an optimization for the case where the src has no name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34174 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3e051647c0
commit
f41916e75d
@ -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