diff options
author | Chris Lattner <sabre@nondot.org> | 2006-09-28 23:45:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-09-28 23:45:00 +0000 |
commit | ab4fa4f37748b82be7241516436109d8c02a4335 (patch) | |
tree | 12a6e1acefd18dc57d7e76db5edd785a60483e73 /lib | |
parent | de65fb3a8b629831860b5880696bdba3ba7b3200 (diff) | |
download | external_llvm-ab4fa4f37748b82be7241516436109d8c02a4335.zip external_llvm-ab4fa4f37748b82be7241516436109d8c02a4335.tar.gz external_llvm-ab4fa4f37748b82be7241516436109d8c02a4335.tar.bz2 |
Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Type.cpp | 60 |
1 files changed, 24 insertions, 36 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 59f0890..b7cf54d 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -382,44 +382,32 @@ const Type *StructType::getTypeAtIndex(const Value *V) const { //===----------------------------------------------------------------------===// -// Static 'Type' data +// Primitive 'Type' data //===----------------------------------------------------------------------===// -#define DeclarePrimType(TY, Str) \ - struct VISIBILITY_HIDDEN TY##Type : public Type { \ - TY##Type() : Type(Str, Type::TY##TyID) {} \ - }; \ - static ManagedStatic<TY##Type> The##TY##Ty - -namespace { - DeclarePrimType(Void, "void"); - DeclarePrimType(Bool, "bool"); - DeclarePrimType(SByte, "sbyte"); - DeclarePrimType(UByte, "ubyte"); - DeclarePrimType(Short, "short"); - DeclarePrimType(UShort, "ushort"); - DeclarePrimType(Int, "int"); - DeclarePrimType(UInt, "uint"); - DeclarePrimType(Long, "long"); - DeclarePrimType(ULong, "ulong"); - DeclarePrimType(Float, "float"); - DeclarePrimType(Double, "double"); - DeclarePrimType(Label, "label"); -} - -Type *Type::VoidTy = &*TheVoidTy; -Type *Type::BoolTy = &*TheBoolTy; -Type *Type::SByteTy = &*TheSByteTy; -Type *Type::UByteTy = &*TheUByteTy; -Type *Type::ShortTy = &*TheShortTy; -Type *Type::UShortTy = &*TheUShortTy; -Type *Type::IntTy = &*TheIntTy; -Type *Type::UIntTy = &*TheUIntTy; -Type *Type::LongTy = &*TheLongTy; -Type *Type::ULongTy = &*TheULongTy; -Type *Type::FloatTy = &*TheFloatTy; -Type *Type::DoubleTy = &*TheDoubleTy; -Type *Type::LabelTy = &*TheLabelTy; +#define DeclarePrimType(TY, Str) \ + namespace { \ + struct VISIBILITY_HIDDEN TY##Type : public Type { \ + TY##Type() : Type(Str, Type::TY##TyID) {} \ + }; \ + } \ + static ManagedStatic<TY##Type> The##TY##Ty; \ + Type *Type::TY##Ty = &*The##TY##Ty + +DeclarePrimType(Void, "void"); +DeclarePrimType(Bool, "bool"); +DeclarePrimType(SByte, "sbyte"); +DeclarePrimType(UByte, "ubyte"); +DeclarePrimType(Short, "short"); +DeclarePrimType(UShort, "ushort"); +DeclarePrimType(Int, "int"); +DeclarePrimType(UInt, "uint"); +DeclarePrimType(Long, "long"); +DeclarePrimType(ULong, "ulong"); +DeclarePrimType(Float, "float"); +DeclarePrimType(Double, "double"); +DeclarePrimType(Label, "label"); +#undef DeclarePrimType //===----------------------------------------------------------------------===// |