From: Chris Lattner Date: Wed, 19 Nov 2003 06:14:38 +0000 (+0000) Subject: Finegrainify namespacification X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f2586d13d5d3f49c618eb00894e5e3b8c699385d;p=oota-llvm.git Finegrainify namespacification git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10080 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 9e33303b7f2..2a24a783f13 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -18,7 +18,7 @@ #include "Support/STLExtras.h" #include -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 @@ static bool TypesEqual(const Type *Ty, const Type *Ty2) { // 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 TypeMap { typedef std::map MapTy; @@ -647,7 +648,7 @@ public: void dump() const { print("dump output"); } }; - +} //===----------------------------------------------------------------------===// @@ -656,6 +657,7 @@ public: // FunctionValType - Define a class to hold the key that goes into the TypeMap // +namespace llvm { class FunctionValType { const Type *RetTy; std::vector ArgTypes; @@ -684,6 +686,7 @@ public: return ArgTypes == MTV.ArgTypes && isVarArg < MTV.isVarArg; } }; +} // Define the actual map itself now... static TypeMap FunctionTypes; @@ -717,6 +720,7 @@ FunctionType *FunctionType::get(const Type *ReturnType, //===----------------------------------------------------------------------===// // Array Type Factory... // +namespace llvm { class ArrayValType { const Type *ValTy; unsigned Size; @@ -738,7 +742,7 @@ public: return Size == MTV.Size && ValTy < MTV.ValTy; } }; - +} static TypeMap ArrayTypes; @@ -762,6 +766,7 @@ ArrayType *ArrayType::get(const Type *ElementType, unsigned NumElements) { // Struct Type Factory... // +namespace llvm { // StructValType - Define a class to hold the key that goes into the TypeMap // class StructValType { @@ -788,6 +793,7 @@ public: return ElTypes < STV.ElTypes; } }; +} static TypeMap StructTypes; @@ -813,6 +819,7 @@ StructType *StructType::get(const std::vector &ETypes) { // 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 @@ public: return ValTy < MTV.ValTy; } }; +} static TypeMap PointerTypes; @@ -851,13 +859,14 @@ PointerType *PointerType::get(const Type *ValueType) { 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::refineAbstractType(const DerivedType *OldType, void PointerType::typeBecameConcrete(const DerivedType *AbsTy) { refineAbstractType(AbsTy, AbsTy); } - -} // End llvm namespace