mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
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
This commit is contained in:
parent
54baafd286
commit
d5b1245e8c
@ -36,7 +36,7 @@ public:
|
|||||||
typedef VarMap::iterator type_iterator;
|
typedef VarMap::iterator type_iterator;
|
||||||
typedef VarMap::const_iterator type_const_iterator;
|
typedef VarMap::const_iterator type_const_iterator;
|
||||||
|
|
||||||
inline SymbolTable() : InternallyInconsistent(false) {}
|
inline SymbolTable() : InternallyInconsistent(false), LastUnique(0) {}
|
||||||
~SymbolTable();
|
~SymbolTable();
|
||||||
|
|
||||||
// lookup - Returns null on failure...
|
// lookup - Returns null on failure...
|
||||||
@ -109,6 +109,10 @@ private:
|
|||||||
//
|
//
|
||||||
bool InternallyInconsistent;
|
bool InternallyInconsistent;
|
||||||
|
|
||||||
|
// LastUnique - This value is used to retain the last unique value used
|
||||||
|
// by getUniqueName to generate unique names.
|
||||||
|
unsigned long LastUnique;
|
||||||
|
|
||||||
inline super::value_type operator[](const Type *Ty) {
|
inline super::value_type operator[](const Type *Ty) {
|
||||||
assert(0 && "Should not use this operator to access symbol table!");
|
assert(0 && "Should not use this operator to access symbol table!");
|
||||||
return super::value_type();
|
return super::value_type();
|
||||||
|
@ -61,11 +61,10 @@ std::string SymbolTable::getUniqueName(const Type *Ty,
|
|||||||
if (I == end()) return BaseName;
|
if (I == end()) return BaseName;
|
||||||
|
|
||||||
std::string TryName = BaseName;
|
std::string TryName = BaseName;
|
||||||
unsigned Counter = 0;
|
|
||||||
type_iterator End = I->second.end();
|
type_iterator End = I->second.end();
|
||||||
|
|
||||||
while (I->second.find(TryName) != End) // Loop until we find unoccupied
|
while (I->second.find(TryName) != End) // Loop until we find a free
|
||||||
TryName = BaseName + utostr(++Counter); // Name in the symbol table
|
TryName = BaseName + utostr(++LastUnique); // name in the symbol table
|
||||||
return TryName;
|
return TryName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user