mirror of
https://github.com/RPCSX/llvm.git
synced 2025-03-01 09:26:22 +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.
|
||||
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");
|
||||
|
||||
// Insert the vmap entry
|
||||
V->Name = UniqueName;
|
||||
vmap.insert(make_pair(V->Name, V));
|
||||
}
|
||||
|
||||
// Remove a value
|
||||
|
Loading…
x
Reference in New Issue
Block a user