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

LLVM llvm at cs.uiuc.edu
Sat Jul 17 16:57:46 PDT 2004



Changes in directory llvm/lib/VMCore:

SymbolTable.cpp updated: 1.46 -> 1.47

---
Log message:

bug 122: http://llvm.cs.uiuc.edu/PR122 :
- Correct isa<Constant> for GlobalValue subclass
- Fix some tabs and indentation.


---
Diffs of the changes:  (+11 -13)

Index: llvm/lib/VMCore/SymbolTable.cpp
diff -u llvm/lib/VMCore/SymbolTable.cpp:1.46 llvm/lib/VMCore/SymbolTable.cpp:1.47
--- llvm/lib/VMCore/SymbolTable.cpp:1.46	Sun Jul  4 06:55:08 2004
+++ llvm/lib/VMCore/SymbolTable.cpp	Sat Jul 17 18:57:36 2004
@@ -39,10 +39,10 @@
   for (plane_iterator PI = pmap.begin(); PI != pmap.end(); ++PI) {
     for (value_iterator VI = PI->second.begin(); VI != PI->second.end(); ++VI)
       if (!isa<Constant>(VI->second) ) {
-	std::cerr << "Value still in symbol table! Type = '"
+        std::cerr << "Value still in symbol table! Type = '"
                   << PI->first->getDescription() << "' Name = '"
                   << VI->first << "'\n";
-	LeftoverValues = false;
+        LeftoverValues = false;
       }
   }
   
@@ -300,15 +300,13 @@
     value_iterator B = Plane.begin(), Bend = Plane.end();
     while (B != Bend) {   // Found nonempty type plane!
       Value *V = B->second;
-      if (isa<Constant>(V)) {
-	remove(V);
+      if (!isa<GlobalValue>(V) || cast<GlobalValue>(V)->hasInternalLinkage()){
+        // Set name to "", removing from symbol table!
+        V->setName("", this);
+        RemovedSymbol = true;
+      } else if (isa<Constant>(V) ) {
+        remove(V);
         RemovedSymbol = true;
-      } else {
-        if (!isa<GlobalValue>(V) || cast<GlobalValue>(V)->hasInternalLinkage()){
-          // Set name to "", removing from symbol table!
-          V->setName("", this);
-          RemovedSymbol = true;
-        }
       }
       ++B;
     }
@@ -326,7 +324,7 @@
 
 // This function is called when one of the types in the type plane are refined
 void SymbolTable::refineAbstractType(const DerivedType *OldType,
-				     const Type *NewType) {
+                                     const Type *NewType) {
 
   // Search to see if we have any values of the type Oldtype.  If so, we need to
   // move them into the newtype plane...
@@ -441,9 +439,9 @@
       I->second = (Type*)NewType;  // TODO FIXME when types aren't const
       if (NewType->isAbstract()) {
 #if DEBUG_ABSTYPE
-	std::cerr << "Added type " << NewType->getDescription() << "\n";
+        std::cerr << "Added type " << NewType->getDescription() << "\n";
 #endif
-	cast<DerivedType>(NewType)->addAbstractTypeUser(this);
+        cast<DerivedType>(NewType)->addAbstractTypeUser(this);
       }
     }
   }





More information about the llvm-commits mailing list