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

Chris Lattner lattner at cs.uiuc.edu
Wed Nov 19 00:15:02 PST 2003


Changes in directory llvm/lib/VMCore:

Type.cpp updated: 1.80 -> 1.81

---
Log message:

Finegrainify namespacification


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

Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.80 llvm/lib/VMCore/Type.cpp:1.81
--- llvm/lib/VMCore/Type.cpp:1.80	Tue Nov 11 16:41:34 2003
+++ llvm/lib/VMCore/Type.cpp	Wed Nov 19 00:14:38 2003
@@ -18,7 +18,7 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 
-namespace llvm {
+using namespace llvm;
 
 // DEBUG_MERGE_TYPES - Enable this #define to see how and when derived types are
 // created and later destroyed, all in an effort to make sure that there is only
@@ -560,6 +560,7 @@
 // created on any given run of the compiler... note that this involves updating
 // our map if an abstract type gets refined somehow...
 //
+namespace llvm {
 template<class ValType, class TypeClass>
 class TypeMap {
   typedef std::map<ValType, TypeClass *> MapTy;
@@ -647,7 +648,7 @@
 
   void dump() const { print("dump output"); }
 };
-
+}
 
 
 //===----------------------------------------------------------------------===//
@@ -656,6 +657,7 @@
 
 // FunctionValType - Define a class to hold the key that goes into the TypeMap
 //
+namespace llvm {
 class FunctionValType {
   const Type *RetTy;
   std::vector<const Type*> ArgTypes;
@@ -684,6 +686,7 @@
     return ArgTypes == MTV.ArgTypes && isVarArg < MTV.isVarArg;
   }
 };
+}
 
 // Define the actual map itself now...
 static TypeMap<FunctionValType, FunctionType> FunctionTypes;
@@ -717,6 +720,7 @@
 //===----------------------------------------------------------------------===//
 // Array Type Factory...
 //
+namespace llvm {
 class ArrayValType {
   const Type *ValTy;
   unsigned Size;
@@ -738,7 +742,7 @@
     return Size == MTV.Size && ValTy < MTV.ValTy;
   }
 };
-
+}
 static TypeMap<ArrayValType, ArrayType> ArrayTypes;
 
 
@@ -762,6 +766,7 @@
 // Struct Type Factory...
 //
 
+namespace llvm {
 // StructValType - Define a class to hold the key that goes into the TypeMap
 //
 class StructValType {
@@ -788,6 +793,7 @@
     return ElTypes < STV.ElTypes;
   }
 };
+}
 
 static TypeMap<StructValType, StructType> StructTypes;
 
@@ -813,6 +819,7 @@
 
 // PointerValType - Define a class to hold the key that goes into the TypeMap
 //
+namespace llvm {
 class PointerValType {
   const Type *ValTy;
 public:
@@ -832,6 +839,7 @@
     return ValTy < MTV.ValTy;
   }
 };
+}
 
 static TypeMap<PointerValType, PointerType> PointerTypes;
 
@@ -851,13 +859,14 @@
   return PT;
 }
 
+namespace llvm {
 void debug_type_tables() {
   FunctionTypes.dump();
   ArrayTypes.dump();
   StructTypes.dump();
   PointerTypes.dump();
 }
-
+}
 
 //===----------------------------------------------------------------------===//
 //                     Derived Type Refinement Functions
@@ -1115,5 +1124,3 @@
 void PointerType::typeBecameConcrete(const DerivedType *AbsTy) {
   refineAbstractType(AbsTy, AbsTy);
 }
-
-} // End llvm namespace





More information about the llvm-commits mailing list