aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/SymbolTable.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-09 19:39:48 +0000
committerChris Lattner <sabre@nondot.org>2003-11-09 19:39:48 +0000
commitd5b1245e8c8a0482ffa91601575743c6ec61ca19 (patch)
treed3c7c4c1523464323e89fe87836bda16d86e255b /lib/VMCore/SymbolTable.cpp
parent54baafd28649a93c7c16ada4529b9212dc03aa05 (diff)
Fix PR95. I'm checking this patch in for Reid Spencer, who figured it out
and wrote it up. Thanks!! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9832 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/SymbolTable.cpp')
-rw-r--r--lib/VMCore/SymbolTable.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/VMCore/SymbolTable.cpp b/lib/VMCore/SymbolTable.cpp
index a6b9a0007b..9452cdfec4 100644
--- a/lib/VMCore/SymbolTable.cpp
+++ b/lib/VMCore/SymbolTable.cpp
@@ -61,11 +61,10 @@ std::string SymbolTable::getUniqueName(const Type *Ty,
if (I == end()) return BaseName;
std::string TryName = BaseName;
- unsigned Counter = 0;
type_iterator End = I->second.end();
- while (I->second.find(TryName) != End) // Loop until we find unoccupied
- TryName = BaseName + utostr(++Counter); // Name in the symbol table
+ while (I->second.find(TryName) != End) // Loop until we find a free
+ TryName = BaseName + utostr(++LastUnique); // name in the symbol table
return TryName;
}