mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-21 21:11:36 +00:00
Bump SmallString size a bit to avoid malloc trashing.
llvm-svn: 100010
This commit is contained in:
parent
ba2f97fcb0
commit
e006100c19
@ -55,9 +55,7 @@ void ValueSymbolTable::reinsertValue(Value* V) {
|
|||||||
raw_svector_ostream(UniqueName) << ++LastUnique;
|
raw_svector_ostream(UniqueName) << ++LastUnique;
|
||||||
|
|
||||||
// Try insert the vmap entry with this suffix.
|
// Try insert the vmap entry with this suffix.
|
||||||
ValueName &NewName =
|
ValueName &NewName = vmap.GetOrCreateValue(UniqueName);
|
||||||
vmap.GetOrCreateValue(StringRef(UniqueName.data(),
|
|
||||||
UniqueName.size()));
|
|
||||||
if (NewName.getValue() == 0) {
|
if (NewName.getValue() == 0) {
|
||||||
// Newly inserted name. Success!
|
// Newly inserted name. Success!
|
||||||
NewName.setValue(V);
|
NewName.setValue(V);
|
||||||
@ -88,7 +86,7 @@ ValueName *ValueSymbolTable::createValueName(StringRef Name, Value *V) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, there is a naming conflict. Rename this value.
|
// Otherwise, there is a naming conflict. Rename this value.
|
||||||
SmallString<128> UniqueName(Name.begin(), Name.end());
|
SmallString<256> UniqueName(Name.begin(), Name.end());
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
// Trim any suffix off and append the next number.
|
// Trim any suffix off and append the next number.
|
||||||
@ -96,9 +94,7 @@ ValueName *ValueSymbolTable::createValueName(StringRef Name, Value *V) {
|
|||||||
raw_svector_ostream(UniqueName) << ++LastUnique;
|
raw_svector_ostream(UniqueName) << ++LastUnique;
|
||||||
|
|
||||||
// Try insert the vmap entry with this suffix.
|
// Try insert the vmap entry with this suffix.
|
||||||
ValueName &NewName =
|
ValueName &NewName = vmap.GetOrCreateValue(UniqueName);
|
||||||
vmap.GetOrCreateValue(StringRef(UniqueName.data(),
|
|
||||||
UniqueName.size()));
|
|
||||||
if (NewName.getValue() == 0) {
|
if (NewName.getValue() == 0) {
|
||||||
// Newly inserted name. Success!
|
// Newly inserted name. Success!
|
||||||
NewName.setValue(V);
|
NewName.setValue(V);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user