[llvm-commits] CVS: llvm/lib/VMCore/Function.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Nov 20 12:08:05 PST 2002


Changes in directory llvm/lib/VMCore:

Function.cpp updated: 1.34 -> 1.35

---
Log message:

Eliminate the concept of a deferred symbol table.  The optimization really isn't,
and it causes obscure bugs to show up in passes.



---
Diffs of the changes:

Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.34 llvm/lib/VMCore/Function.cpp:1.35
--- llvm/lib/VMCore/Function.cpp:1.34	Tue Oct 15 16:26:29 2002
+++ llvm/lib/VMCore/Function.cpp	Wed Nov 20 12:07:48 2002
@@ -84,7 +84,7 @@
   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) {
@@ -136,27 +136,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





More information about the llvm-commits mailing list