mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
- Eliminate SymbolTable::ParentSymTab, ST::localLookup, and
Function::ParentSymTab. These aren't needed at all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4186 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -72,7 +72,7 @@ string SymbolTable::getUniqueName(const Type *Ty, const string &BaseName) {
|
||||
|
||||
|
||||
// lookup - Returns null on failure...
|
||||
Value *SymbolTable::localLookup(const Type *Ty, const string &Name) {
|
||||
Value *SymbolTable::lookup(const Type *Ty, const string &Name) {
|
||||
iterator I = find(Ty);
|
||||
if (I != end()) { // We have symbols in that plane...
|
||||
type_iterator J = I->second.find(Name);
|
||||
@@ -83,13 +83,6 @@ Value *SymbolTable::localLookup(const Type *Ty, const string &Name) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// lookup - Returns null on failure...
|
||||
Value *SymbolTable::lookup(const Type *Ty, const string &Name) {
|
||||
Value *LV = localLookup(Ty, Name);
|
||||
if (LV) return LV;
|
||||
return ParentSymTab ? ParentSymTab->lookup(Ty, Name) : 0;
|
||||
}
|
||||
|
||||
void SymbolTable::remove(Value *N) {
|
||||
assert(N->hasName() && "Value doesn't have name!");
|
||||
if (InternallyInconsistent) return;
|
||||
@@ -154,7 +147,7 @@ Value *SymbolTable::removeEntry(iterator Plane, type_iterator Entry) {
|
||||
void SymbolTable::insertEntry(const string &Name, const Type *VTy, Value *V) {
|
||||
|
||||
// Check to see if there is a naming conflict. If so, rename this value!
|
||||
if (localLookup(VTy, Name)) {
|
||||
if (lookup(VTy, Name)) {
|
||||
string UniqueName = getUniqueName(VTy, Name);
|
||||
assert(InternallyInconsistent == false && "Infinite loop inserting entry!");
|
||||
InternallyInconsistent = true;
|
||||
@@ -339,9 +332,4 @@ static void DumpPlane(const pair<const Type *, map<const string, Value *> >&P) {
|
||||
void SymbolTable::dump() const {
|
||||
std::cout << "Symbol table dump:\n";
|
||||
for_each(begin(), end(), DumpPlane);
|
||||
|
||||
if (ParentSymTab) {
|
||||
std::cout << "Parent ";
|
||||
ParentSymTab->dump();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user