mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-17 20:29:31 +00:00
speed up conflict handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33985 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c2b2d6a7c9
commit
421d3daa05
@ -88,13 +88,18 @@ void ValueSymbolTable::insert(Value* V) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, there is a naming conflict. Rename this value.
|
// Otherwise, there is a naming conflict. Rename this value.
|
||||||
std::string UniqueName = getUniqueName(V->getName());
|
std::string UniqueName = V->getName();
|
||||||
|
unsigned BaseSize = UniqueName.size();
|
||||||
|
do {
|
||||||
|
// Trim any suffix off.
|
||||||
|
UniqueName.resize(BaseSize);
|
||||||
|
UniqueName += utostr(++LastUnique);
|
||||||
|
} while (!vmap.insert(make_pair(UniqueName, V)).second);
|
||||||
|
|
||||||
DEBUG(DOUT << " Inserting value: " << UniqueName << ": " << *V << "\n");
|
DEBUG(DOUT << " Inserting value: " << UniqueName << ": " << *V << "\n");
|
||||||
|
|
||||||
// Insert the vmap entry
|
// Insert the vmap entry
|
||||||
V->Name = UniqueName;
|
V->Name = UniqueName;
|
||||||
vmap.insert(make_pair(V->Name, V));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove a value
|
// Remove a value
|
||||||
|
Loading…
Reference in New Issue
Block a user