diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-20 18:07:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-20 18:07:48 +0000 |
commit | b251c3d727f00183c8091030949bee7a05a3b87c (patch) | |
tree | bd28268ce13e8e9f0d19916af57a24a52a51f115 /llvm/lib/VMCore/Function.cpp | |
parent | eaaceb12101717ae82ab38f598a4681a33491e3a (diff) | |
download | bcm5719-llvm-b251c3d727f00183c8091030949bee7a05a3b87c.tar.gz bcm5719-llvm-b251c3d727f00183c8091030949bee7a05a3b87c.zip |
Eliminate the concept of a deferred symbol table. The optimization really isn't,
and it causes obscure bugs to show up in passes.
llvm-svn: 4777
Diffstat (limited to 'llvm/lib/VMCore/Function.cpp')
-rw-r--r-- | llvm/lib/VMCore/Function.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp index 5edd9ae2a69..9b837dcaa13 100644 --- a/llvm/lib/VMCore/Function.cpp +++ b/llvm/lib/VMCore/Function.cpp @@ -84,7 +84,7 @@ Function::Function(const FunctionType *Ty, bool isInternal, BasicBlocks.setParent(this); ArgumentList.setItemParent(this); ArgumentList.setParent(this); - SymTab = 0; + SymTab = new SymbolTable(); // Create the arguments vector, all arguments start out unnamed. for (unsigned i = 0, e = Ty->getNumParams(); i != e; ++i) { @@ -137,27 +137,6 @@ const Type *Function::getReturnType() const { return getFunctionType()->getReturnType(); } -SymbolTable *Function::getSymbolTableSure() { - if (!SymTab) SymTab = new SymbolTable(); - return SymTab; -} - -// hasSymbolTable() - Returns true if there is a symbol table allocated to -// this object AND if there is at least one name in it! -// -bool Function::hasSymbolTable() const { - if (!SymTab) return false; - - for (SymbolTable::const_iterator I = SymTab->begin(); - I != SymTab->end(); ++I) { - if (I->second.begin() != I->second.end()) - return true; // Found nonempty type plane! - } - - return false; -} - - // dropAllReferences() - This function causes all the subinstructions to "let // go" of all references that they are maintaining. This allows one to // 'delete' a whole class at a time, even though there may be circular |