Bump SmallString size a bit to avoid malloc trashing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100010 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2010-03-31 16:04:26 +00:00
parent 61633368cf
commit 4ef68221a5

View File

@ -55,9 +55,7 @@ void ValueSymbolTable::reinsertValue(Value* V) {
raw_svector_ostream(UniqueName) << ++LastUnique;
// Try insert the vmap entry with this suffix.
ValueName &NewName =
vmap.GetOrCreateValue(StringRef(UniqueName.data(),
UniqueName.size()));
ValueName &NewName = vmap.GetOrCreateValue(UniqueName);
if (NewName.getValue() == 0) {
// Newly inserted name. Success!
NewName.setValue(V);
@ -88,7 +86,7 @@ ValueName *ValueSymbolTable::createValueName(StringRef Name, Value *V) {
}
// 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) {
// 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;
// Try insert the vmap entry with this suffix.
ValueName &NewName =
vmap.GetOrCreateValue(StringRef(UniqueName.data(),
UniqueName.size()));
ValueName &NewName = vmap.GetOrCreateValue(UniqueName);
if (NewName.getValue() == 0) {
// Newly inserted name. Success!
NewName.setValue(V);