[llvm-commits] [llvm] r79449 - /llvm/trunk/lib/VMCore/ValueSymbolTable.cpp
Daniel Dunbar
daniel at zuster.org
Wed Aug 19 12:22:52 PDT 2009
Author: ddunbar
Date: Wed Aug 19 14:22:52 2009
New Revision: 79449
URL: http://llvm.org/viewvc/llvm-project?rev=79449&view=rev
Log:
Change ValueSymbolTable to use raw_svector_ostream for string concatenation.
Modified:
llvm/trunk/lib/VMCore/ValueSymbolTable.cpp
Modified: llvm/trunk/lib/VMCore/ValueSymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ValueSymbolTable.cpp?rev=79449&r1=79448&r2=79449&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/ValueSymbolTable.cpp (original)
+++ llvm/trunk/lib/VMCore/ValueSymbolTable.cpp Wed Aug 19 14:22:52 2009
@@ -43,16 +43,17 @@
}
// Otherwise, there is a naming conflict. Rename this value.
- SmallString<128> UniqueName(V->getName().begin(), V->getName().end());
+ SmallString<256> UniqueName(V->getName().begin(), V->getName().end());
// The name is too already used, just free it so we can allocate a new name.
V->Name->Destroy();
unsigned BaseSize = UniqueName.size();
while (1) {
- // Trim any suffix off.
+ // Trim any suffix off and append the next number.
UniqueName.resize(BaseSize);
- UniqueName.append_uint_32(++LastUnique);
+ raw_svector_ostream(UniqueName) << ++LastUnique;
+
// Try insert the vmap entry with this suffix.
ValueName &NewName =
vmap.GetOrCreateValue(StringRef(UniqueName.data(),
@@ -90,9 +91,9 @@
SmallString<128> UniqueName(Name.begin(), Name.end());
while (1) {
- // Trim any suffix off.
+ // Trim any suffix off and append the next number.
UniqueName.resize(Name.size());
- UniqueName.append_uint_32(++LastUnique);
+ raw_svector_ostream(UniqueName) << ++LastUnique;
// Try insert the vmap entry with this suffix.
ValueName &NewName =
More information about the llvm-commits
mailing list