summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commita570f7b6813cc76983ed128b1a645577e5965774 (patch)
tree88eff020772226093d1450bc56ccb5d046151a2e /llvm/lib
parentda8571b464d949a5585de456e65be6300a5204d7 (diff)
downloadbcm5719-llvm-a570f7b6813cc76983ed128b1a645577e5965774.tar.gz
bcm5719-llvm-a570f7b6813cc76983ed128b1a645577e5965774.zip
Fix PR95. I'm checking this patch in for Reid Spencer, who figured it out
and wrote it up. Thanks!! llvm-svn: 9832
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/SymbolTable.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/SymbolTable.cpp b/llvm/lib/VMCore/SymbolTable.cpp
index a6b9a0007b2..9452cdfec43 100644
--- a/llvm/lib/VMCore/SymbolTable.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud