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

Chris Lattner lattner at cs.uiuc.edu
Thu May 22 16:48:01 PDT 2003


Changes in directory llvm/lib/VMCore:

Dominators.cpp updated: 1.43 -> 1.44
SymbolTable.cpp updated: 1.28 -> 1.29

---
Log message:

Remove using declarations and extraneous #includes


---
Diffs of the changes:

Index: llvm/lib/VMCore/Dominators.cpp
diff -u llvm/lib/VMCore/Dominators.cpp:1.43 llvm/lib/VMCore/Dominators.cpp:1.44
--- llvm/lib/VMCore/Dominators.cpp:1.43	Mon May 12 17:35:13 2003
+++ llvm/lib/VMCore/Dominators.cpp	Thu May 22 16:47:17 2003
@@ -12,7 +12,6 @@
 #include "llvm/Assembly/Writer.h"
 #include "Support/DepthFirstIterator.h"
 #include "Support/SetOperations.h"
-using std::set;
 
 //===----------------------------------------------------------------------===//
 //  DominatorSet Implementation
@@ -127,8 +126,9 @@
 }
 
 
-static std::ostream &operator<<(std::ostream &o, const set<BasicBlock*> &BBs) {
-  for (set<BasicBlock*>::const_iterator I = BBs.begin(), E = BBs.end();
+static std::ostream &operator<<(std::ostream &o,
+                                const std::set<BasicBlock*> &BBs) {
+  for (std::set<BasicBlock*>::const_iterator I = BBs.begin(), E = BBs.end();
        I != E; ++I) {
     o << "  ";
     WriteAsOperand(o, *I, false);


Index: llvm/lib/VMCore/SymbolTable.cpp
diff -u llvm/lib/VMCore/SymbolTable.cpp:1.28 llvm/lib/VMCore/SymbolTable.cpp:1.29
--- llvm/lib/VMCore/SymbolTable.cpp:1.28	Sun Dec 15 10:41:52 2002
+++ llvm/lib/VMCore/SymbolTable.cpp	Thu May 22 16:47:17 2003
@@ -7,17 +7,9 @@
 #include "llvm/SymbolTable.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
-#include "llvm/InstrTypes.h"
 #include "Support/StringExtras.h"
-#include <iostream>
 #include <algorithm>
 
-using std::string;
-using std::pair;
-using std::make_pair;
-using std::map;
-using std::cerr;
-
 #define DEBUG_SYMBOL_TABLE 0
 #define DEBUG_ABSTYPE 0
 
@@ -41,9 +33,9 @@
   for (iterator i = begin(); i != end(); ++i) {
     for (type_iterator I = i->second.begin(); I != i->second.end(); ++I)
       if (!isa<Constant>(I->second) && !isa<Type>(I->second)) {
-	cerr << "Value still in symbol table! Type = '"
-             << i->first->getDescription() << "' Name = '"
-             << I->first << "'\n";
+	std::cerr << "Value still in symbol table! Type = '"
+                  << i->first->getDescription() << "' Name = '"
+                  << I->first << "'\n";
 	LeftoverValues = false;
       }
   }
@@ -56,11 +48,12 @@
 // it (or derived from it) that does not already occur in the symbol table for
 // the specified type.
 //
-string SymbolTable::getUniqueName(const Type *Ty, const string &BaseName) {
+std::string SymbolTable::getUniqueName(const Type *Ty,
+                                       const std::string &BaseName) {
   iterator I = find(Ty);
   if (I == end()) return BaseName;
 
-  string TryName = BaseName;
+  std::string TryName = BaseName;
   unsigned Counter = 0;
   type_iterator End = I->second.end();
 
@@ -72,7 +65,7 @@
 
 
 // lookup - Returns null on failure...
-Value *SymbolTable::lookup(const Type *Ty, const string &Name) {
+Value *SymbolTable::lookup(const Type *Ty, const std::string &Name) {
   iterator I = find(Ty);
   if (I != end()) {                      // We have symbols in that plane...
     type_iterator J = I->second.find(Name);
@@ -117,8 +110,8 @@
     //
     if (Plane->first->isAbstract()) {
 #if DEBUG_ABSTYPE
-      cerr << "Plane Empty: Removing type: " << Plane->first->getDescription()
-           << "\n";
+      std::cerr << "Plane Empty: Removing type: "
+                << Plane->first->getDescription() << "\n";
 #endif
       cast<DerivedType>(Plane->first)->removeAbstractTypeUser(this);
     }
@@ -132,7 +125,7 @@
     const Type *T = cast<const Type>(Result);
     if (T->isAbstract()) {
 #if DEBUG_ABSTYPE
-      cerr << "Removing abs type from symtab" << T->getDescription() << "\n";
+      std::cerr << "Removing abs type from symtab" << T->getDescription()<<"\n";
 #endif
       cast<DerivedType>(T)->removeAbstractTypeUser(this);
     }
@@ -144,11 +137,12 @@
 // insertEntry - Insert a value into the symbol table with the specified
 // name...
 //
-void SymbolTable::insertEntry(const string &Name, const Type *VTy, Value *V) {
+void SymbolTable::insertEntry(const std::string &Name, const Type *VTy,
+                              Value *V) {
 
   // Check to see if there is a naming conflict.  If so, rename this value!
   if (lookup(VTy, Name)) {
-    string UniqueName = getUniqueName(VTy, Name);
+    std::string UniqueName = getUniqueName(VTy, Name);
     assert(InternallyInconsistent == false && "Infinite loop inserting entry!");
     InternallyInconsistent = true;
     V->setName(UniqueName, this);
@@ -158,8 +152,8 @@
 
 #if DEBUG_SYMBOL_TABLE
   dump();
-  cerr << " Inserting definition: " << Name << ": " 
-       << VTy->getDescription() << "\n";
+  std::cerr << " Inserting definition: " << Name << ": " 
+            << VTy->getDescription() << "\n";
 #endif
 
   iterator I = find(VTy);
@@ -175,7 +169,8 @@
     if (VTy->isAbstract()) {
       cast<DerivedType>(VTy)->addAbstractTypeUser(this);
 #if DEBUG_ABSTYPE
-      cerr << "Added abstract type value: " << VTy->getDescription() << "\n";
+      std::cerr << "Added abstract type value: " << VTy->getDescription()
+                << "\n";
 #endif
     }
   }
@@ -188,7 +183,7 @@
     if (T->isAbstract()) {
       cast<DerivedType>(T)->addAbstractTypeUser(this);
 #if DEBUG_ABSTYPE
-      cerr << "Added abstract type to ST: " << T->getDescription() << "\n";
+      std::cerr << "Added abstract type to ST: " << T->getDescription() << "\n";
 #endif
     }
   }
@@ -212,7 +207,8 @@
       if (NewType->isAbstract()) {
         cast<DerivedType>(NewType)->addAbstractTypeUser(this);
 #if DEBUG_ABSTYPE
-        cerr << "[Added] refined to abstype: "<<NewType->getDescription()<<"\n";
+        std::cerr << "[Added] refined to abstype: " << NewType->getDescription()
+                  << "\n";
 #endif
       }
     }
@@ -220,7 +216,7 @@
     VarMap &NewPlane = NewTypeIt->second;
     VarMap &OldPlane = TPI->second;
     while (!OldPlane.empty()) {
-      pair<const string, Value*> V = *OldPlane.begin();
+      std::pair<const std::string, Value*> V = *OldPlane.begin();
 
       // Check to see if there is already a value in the symbol table that this
       // would collide with.
@@ -281,7 +277,7 @@
     // Ok, now we are not referencing the type anymore... take me off your user
     // list please!
 #if DEBUG_ABSTYPE
-    cerr << "Removing type " << OldType->getDescription() << "\n";
+    std::cerr << "Removing type " << OldType->getDescription() << "\n";
 #endif
     OldType->removeAbstractTypeUser(this);
 
@@ -290,7 +286,7 @@
   } else if (TPI != end()) {
     assert(OldType == NewType);
 #if DEBUG_ABSTYPE
-    cerr << "Removing SELF type " << OldType->getDescription() << "\n";
+    std::cerr << "Removing SELF type " << OldType->getDescription() << "\n";
 #endif
     OldType->removeAbstractTypeUser(this);
   }
@@ -306,14 +302,14 @@
     for (VarMap::iterator I = TyPlane.begin(), E = TyPlane.end(); I != E; ++I)
       if (I->second == (Value*)OldType) {  // FIXME when Types aren't const.
 #if DEBUG_ABSTYPE
-        cerr << "Removing type " << OldType->getDescription() << "\n";
+        std::cerr << "Removing type " << OldType->getDescription() << "\n";
 #endif
         OldType->removeAbstractTypeUser(this);
         
         I->second = (Value*)NewType;  // TODO FIXME when types aren't const
         if (NewType->isAbstract()) {
 #if DEBUG_ABSTYPE
-          cerr << "Added type " << NewType->getDescription() << "\n";
+          std::cerr << "Added type " << NewType->getDescription() << "\n";
 #endif
           cast<const DerivedType>(NewType)->addAbstractTypeUser(this);
         }
@@ -321,13 +317,14 @@
   }
 }
 
-static void DumpVal(const pair<const string, Value *> &V) {
+static void DumpVal(const std::pair<const std::string, Value *> &V) {
   std::cout << "  '" << V.first << "' = ";
   V.second->dump();
   std::cout << "\n";
 }
 
-static void DumpPlane(const pair<const Type *, map<const string, Value *> >&P) {
+static void DumpPlane(const std::pair<const Type *,
+                                      std::map<const std::string, Value *> >&P){
   std::cout << "  Plane: ";
   P.first->dump();
   std::cout << "\n";





More information about the llvm-commits mailing list