diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-15 21:26:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-15 21:26:29 +0000 |
commit | 0dad6e9c95984804953db0fdcbe0c907d9ee351e (patch) | |
tree | fba6caf31e19c26de8cbd61b9e7eeccce09c0026 /lib/VMCore | |
parent | 1b7de965dd3291f4bf96f0a9ce7cf5fdcb4cd7fd (diff) | |
download | external_llvm-0dad6e9c95984804953db0fdcbe0c907d9ee351e.zip external_llvm-0dad6e9c95984804953db0fdcbe0c907d9ee351e.tar.gz external_llvm-0dad6e9c95984804953db0fdcbe0c907d9ee351e.tar.bz2 |
- 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
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Function.cpp | 8 | ||||
-rw-r--r-- | lib/VMCore/Module.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/SymbolTable.cpp | 16 |
3 files changed, 5 insertions, 21 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index d03a72a..5edd9ae 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -84,7 +84,7 @@ Function::Function(const FunctionType *Ty, bool isInternal, BasicBlocks.setParent(this); ArgumentList.setItemParent(this); ArgumentList.setParent(this); - ParentSymTab = SymTab = 0; + SymTab = 0; // Create the arguments vector, all arguments start out unnamed. for (unsigned i = 0, e = Ty->getNumParams(); i != e; ++i) { @@ -127,10 +127,6 @@ void Function::setParent(Module *parent) { Parent = parent; if (getParent()) LeakDetector::removeGarbageObject(this); - - // Relink symbol tables together... - ParentSymTab = Parent ? Parent->getSymbolTableSure() : 0; - if (SymTab) SymTab->setParentSymTab(ParentSymTab); } const FunctionType *Function::getFunctionType() const { @@ -142,7 +138,7 @@ const Type *Function::getReturnType() const { } SymbolTable *Function::getSymbolTableSure() { - if (!SymTab) SymTab = new SymbolTable(ParentSymTab); + if (!SymTab) SymTab = new SymbolTable(); return SymTab; } diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 4bd3a88..397b5e2 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -75,7 +75,7 @@ void Module::dump() const { } SymbolTable *Module::getSymbolTableSure() { - if (!SymTab) SymTab = new SymbolTable(0); + if (!SymTab) SymTab = new SymbolTable(); return SymTab; } diff --git a/lib/VMCore/SymbolTable.cpp b/lib/VMCore/SymbolTable.cpp index 6d09c7d..069f711 100644 --- a/lib/VMCore/SymbolTable.cpp +++ b/lib/VMCore/SymbolTable.cpp @@ -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(); - } } |