diff options
author | Owen Anderson <resistor@mac.com> | 2009-08-13 21:58:54 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-08-13 21:58:54 +0000 |
commit | 1d0be15f89cb5056e20e2d24faa8d6afb1573bca (patch) | |
tree | 2cdabe223bfce83bd12e10dd557147a2f68c9bf8 /include | |
parent | d163e8b14c8aa5bbbb129e3f0dffdbe7213a3c72 (diff) | |
download | external_llvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.tar.gz external_llvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.tar.bz2 external_llvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.zip |
Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/BasicBlock.h | 10 | ||||
-rw-r--r-- | include/llvm/Constants.h | 3 | ||||
-rw-r--r-- | include/llvm/DerivedTypes.h | 8 | ||||
-rw-r--r-- | include/llvm/InstrTypes.h | 5 | ||||
-rw-r--r-- | include/llvm/Instructions.h | 29 | ||||
-rw-r--r-- | include/llvm/LLVMContext.h | 3 | ||||
-rw-r--r-- | include/llvm/LinkAllVMCore.h | 2 | ||||
-rw-r--r-- | include/llvm/Metadata.h | 31 | ||||
-rw-r--r-- | include/llvm/Support/IRBuilder.h | 42 | ||||
-rw-r--r-- | include/llvm/Support/TypeBuilder.h | 28 | ||||
-rw-r--r-- | include/llvm/Target/TargetData.h | 3 | ||||
-rw-r--r-- | include/llvm/Type.h | 20 |
12 files changed, 93 insertions, 91 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h index eabc1a0d2b..9138d28c68 100644 --- a/include/llvm/BasicBlock.h +++ b/include/llvm/BasicBlock.h @@ -83,8 +83,8 @@ private: /// is automatically inserted at either the end of the function (if /// InsertBefore is null), or before the specified basic block. /// - explicit BasicBlock(const Twine &Name = "", Function *Parent = 0, - BasicBlock *InsertBefore = 0); + explicit BasicBlock(LLVMContext &C, const Twine &Name = "", + Function *Parent = 0, BasicBlock *InsertBefore = 0); public: /// getContext - Get the context in which this basic block lives, /// or null if it is not currently attached to a function. @@ -97,9 +97,9 @@ public: /// Create - Creates a new BasicBlock. If the Parent parameter is specified, /// the basic block is automatically inserted at either the end of the /// function (if InsertBefore is 0), or before the specified basic block. - static BasicBlock *Create(const Twine &Name = "", Function *Parent = 0, - BasicBlock *InsertBefore = 0) { - return new BasicBlock(Name, Parent, InsertBefore); + static BasicBlock *Create(LLVMContext &Context, const Twine &Name = "", + Function *Parent = 0,BasicBlock *InsertBefore = 0) { + return new BasicBlock(Context, Name, Parent, InsertBefore); } ~BasicBlock(); diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 30b48beb87..e26bb62c35 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -346,7 +346,8 @@ public: /// of the array by one (you've been warned). However, in some situations /// this is not desired so if AddNull==false then the string is copied without /// null termination. - static Constant* get(const StringRef &Initializer, bool AddNull = true); + static Constant* get(LLVMContext &Context, const StringRef &Initializer, + bool AddNull = true); /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant); diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h index e7b226be7b..a8603acfbe 100644 --- a/include/llvm/DerivedTypes.h +++ b/include/llvm/DerivedTypes.h @@ -102,7 +102,7 @@ public: /// that instance will be returned. Otherwise a new one will be created. Only /// one instance with a given NumBits value is ever created. /// @brief Get or create an IntegerType instance. - static const IntegerType* get(unsigned NumBits); + static const IntegerType* get(LLVMContext &C, unsigned NumBits); /// @brief Get the number of bits in this IntegerType unsigned getBitWidth() const { return getSubclassData(); } @@ -399,7 +399,7 @@ public: /// static VectorType *getInteger(const VectorType *VTy) { unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits(); - const Type *EltTy = IntegerType::get(EltBits); + const Type *EltTy = IntegerType::get(VTy->getContext(), EltBits); return VectorType::get(EltTy, VTy->getNumElements()); } @@ -409,7 +409,7 @@ public: /// static VectorType *getExtendedElementVectorType(const VectorType *VTy) { unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits(); - const Type *EltTy = IntegerType::get(EltBits * 2); + const Type *EltTy = IntegerType::get(VTy->getContext(), EltBits * 2); return VectorType::get(EltTy, VTy->getNumElements()); } @@ -421,7 +421,7 @@ public: unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits(); assert((EltBits & 1) == 0 && "Cannot truncate vector element with odd bit-width"); - const Type *EltTy = IntegerType::get(EltBits / 2); + const Type *EltTy = IntegerType::get(VTy->getContext(), EltBits / 2); return VectorType::get(EltTy, VTy->getNumElements()); } diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index faff7986ec..560c32b73a 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -708,9 +708,10 @@ public: /// @brief Create a result type for fcmp/icmp static const Type* makeCmpResultType(const Type* opnd_type) { if (const VectorType* vt = dyn_cast<const VectorType>(opnd_type)) { - return VectorType::get(Type::Int1Ty, vt->getNumElements()); + return VectorType::get(Type::getInt1Ty(opnd_type->getContext()), + vt->getNumElements()); } - return Type::Int1Ty; + return Type::getInt1Ty(opnd_type->getContext()); } }; diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 1e1cec1d12..33af5bcd7a 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -2025,18 +2025,21 @@ private: // // NOTE: If the Value* passed is of type void then the constructor behaves as // if it was passed NULL. - explicit ReturnInst(Value *retVal = 0, Instruction *InsertBefore = 0); - ReturnInst(Value *retVal, BasicBlock *InsertAtEnd); - explicit ReturnInst(BasicBlock *InsertAtEnd); + explicit ReturnInst(LLVMContext &C, Value *retVal = 0, + Instruction *InsertBefore = 0); + ReturnInst(LLVMContext &C, Value *retVal, BasicBlock *InsertAtEnd); + explicit ReturnInst(LLVMContext &C, BasicBlock *InsertAtEnd); public: - static ReturnInst* Create(Value *retVal = 0, Instruction *InsertBefore = 0) { - return new(!!retVal) ReturnInst(retVal, InsertBefore); + static ReturnInst* Create(LLVMContext &C, Value *retVal = 0, + Instruction *InsertBefore = 0) { + return new(!!retVal) ReturnInst(C, retVal, InsertBefore); } - static ReturnInst* Create(Value *retVal, BasicBlock *InsertAtEnd) { - return new(!!retVal) ReturnInst(retVal, InsertAtEnd); + static ReturnInst* Create(LLVMContext &C, Value *retVal, + BasicBlock *InsertAtEnd) { + return new(!!retVal) ReturnInst(C, retVal, InsertAtEnd); } - static ReturnInst* Create(BasicBlock *InsertAtEnd) { - return new(0) ReturnInst(InsertAtEnd); + static ReturnInst* Create(LLVMContext &C, BasicBlock *InsertAtEnd) { + return new(0) ReturnInst(C, InsertAtEnd); } virtual ~ReturnInst(); @@ -2591,8 +2594,8 @@ public: void *operator new(size_t s) { return User::operator new(s, 0); } - explicit UnwindInst(Instruction *InsertBefore = 0); - explicit UnwindInst(BasicBlock *InsertAtEnd); + explicit UnwindInst(LLVMContext &C, Instruction *InsertBefore = 0); + explicit UnwindInst(LLVMContext &C, BasicBlock *InsertAtEnd); virtual UnwindInst *clone(LLVMContext &Context) const; @@ -2628,8 +2631,8 @@ public: void *operator new(size_t s) { return User::operator new(s, 0); } - explicit UnreachableInst(Instruction *InsertBefore = 0); - explicit UnreachableInst(BasicBlock *InsertAtEnd); + explicit UnreachableInst(LLVMContext &C, Instruction *InsertBefore = 0); + explicit UnreachableInst(LLVMContext &C, BasicBlock *InsertAtEnd); virtual UnreachableInst *clone(LLVMContext &Context) const; diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index 95b4eaa294..56a640ea11 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -25,6 +25,9 @@ class LLVMContextImpl; /// LLVMContext itself provides no locking guarantees, so you should be careful /// to have one context per thread. class LLVMContext { + // DO NOT IMPLEMENT + LLVMContext(LLVMContext&); + void operator=(LLVMContext&); public: LLVMContextImpl* pImpl; bool RemoveDeadMetadata(); diff --git a/include/llvm/LinkAllVMCore.h b/include/llvm/LinkAllVMCore.h index e5a51971f1..0ee18d57a0 100644 --- a/include/llvm/LinkAllVMCore.h +++ b/include/llvm/LinkAllVMCore.h @@ -46,7 +46,7 @@ namespace { if (std::getenv("bar") != (char*) -1) return; llvm::Module* M = new llvm::Module("", llvm::getGlobalContext()); - (void)new llvm::UnreachableInst(); + (void)new llvm::UnreachableInst(llvm::getGlobalContext()); (void) llvm::createVerifierPass(); (void) new llvm::Mangler(*M,""); } diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index 8533efddb0..f36de687d6 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -44,12 +44,6 @@ protected: void resizeOperands(unsigned NumOps); public: - /// getType() specialization - Type is always MetadataTy. - /// - inline const Type *getType() const { - return Type::MetadataTy; - } - /// isNullValue - Return true if this is the value that would be returned by /// getNullValue. This always returns false because getNullValue will never /// produce metadata. @@ -76,8 +70,8 @@ class MDString : public MetadataBase { StringRef Str; protected: - explicit MDString(const char *begin, unsigned l) - : MetadataBase(Type::MetadataTy, Value::MDStringVal), Str(begin, l) {} + explicit MDString(LLVMContext &C, const char *begin, unsigned l) + : MetadataBase(Type::getMetadataTy(C), Value::MDStringVal), Str(begin, l) {} public: // Do not allocate any space for operands. @@ -119,7 +113,7 @@ class MDNode : public MetadataBase { friend struct ConstantCreator<MDNode, Type, std::vector<Value*> >; protected: - explicit MDNode(Value*const* Vals, unsigned NumVals); + explicit MDNode(LLVMContext &C, Value*const* Vals, unsigned NumVals); public: // Do not allocate any space for operands. void *operator new(size_t s) { @@ -156,12 +150,6 @@ public: elem_iterator elem_begin() { return Node.begin(); } elem_iterator elem_end() { return Node.end(); } - /// getType() specialization - Type is always MetadataTy. - /// - inline const Type *getType() const { - return Type::MetadataTy; - } - /// isNullValue - Return true if this is the value that would be returned by /// getNullValue. This always returns false because getNullValue will never /// produce metadata. @@ -217,16 +205,17 @@ class NamedMDNode : public MetadataBase, public ilist_node<NamedMDNode> { typedef SmallVectorImpl<WeakMetadataVH>::iterator elem_iterator; protected: - explicit NamedMDNode(const Twine &N, MetadataBase*const* Vals, + explicit NamedMDNode(LLVMContext &C, const Twine &N, MetadataBase*const* Vals, unsigned NumVals, Module *M = 0); public: // Do not allocate any space for operands. void *operator new(size_t s) { return User::operator new(s, 0); } - static NamedMDNode *Create(const Twine &N, MetadataBase*const*MDs, + static NamedMDNode *Create(LLVMContext &C, const Twine &N, + MetadataBase*const*MDs, unsigned NumMDs, Module *M = 0) { - return new NamedMDNode(N, MDs, NumMDs, M); + return new NamedMDNode(C, N, MDs, NumMDs, M); } static NamedMDNode *Create(const NamedMDNode *NMD, Module *M = 0); @@ -271,12 +260,6 @@ public: elem_iterator elem_begin() { return Node.begin(); } elem_iterator elem_end() { return Node.end(); } - /// getType() specialization - Type is always MetadataTy. - /// - inline const Type *getType() const { - return Type::MetadataTy; - } - /// isNullValue - Return true if this is the value that would be returned by /// getNullValue. This always returns false because getNullValue will never /// produce metadata. diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index 9e0073a378..e216d4c956 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -129,14 +129,14 @@ public: /// CreateRetVoid - Create a 'ret void' instruction. ReturnInst *CreateRetVoid() { - return Insert(ReturnInst::Create()); + return Insert(ReturnInst::Create(getGlobalContext())); } /// @verbatim /// CreateRet - Create a 'ret <val>' instruction. /// @endverbatim ReturnInst *CreateRet(Value *V) { - return Insert(ReturnInst::Create(V)); + return Insert(ReturnInst::Create(getGlobalContext(), V)); } /// CreateAggregateRet - Create a sequence of N insertvalue instructions, @@ -151,7 +151,7 @@ public: Value *V = UndefValue::get(RetType); for (unsigned i = 0; i != N; ++i) V = CreateInsertValue(V, retVals[i], i, "mrv"); - return Insert(ReturnInst::Create(V)); + return Insert(ReturnInst::Create(getGlobalContext(), V)); } /// CreateBr - Create an unconditional 'br label X' instruction. @@ -182,11 +182,11 @@ public: } UnwindInst *CreateUnwind() { - return Insert(new UnwindInst()); + return Insert(new UnwindInst(Context)); } UnreachableInst *CreateUnreachable() { - return Insert(new UnreachableInst()); + return Insert(new UnreachableInst(Context)); } //===--------------------------------------------------------------------===// @@ -406,7 +406,7 @@ public: return Insert(GetElementPtrInst::CreateInBounds(Ptr, Idx), Name); } Value *CreateConstGEP1_32(Value *Ptr, unsigned Idx0, const char *Name = "") { - Value *Idx = ConstantInt::get(Type::Int32Ty, Idx0); + Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), Idx0); if (Constant *PC = dyn_cast<Constant>(Ptr)) return Folder.CreateGetElementPtr(PC, &Idx, 1); @@ -415,7 +415,7 @@ public: } Value *CreateConstInBoundsGEP1_32(Value *Ptr, unsigned Idx0, const char *Name = "") { - Value *Idx = ConstantInt::get(Type::Int32Ty, Idx0); + Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), Idx0); if (Constant *PC = dyn_cast<Constant>(Ptr)) return Folder.CreateInBoundsGetElementPtr(PC, &Idx, 1); @@ -425,8 +425,8 @@ public: Value *CreateConstGEP2_32(Value *Ptr, unsigned Idx0, unsigned Idx1, const char *Name = "") { Value *Idxs[] = { - ConstantInt::get(Type::Int32Ty, Idx0), - ConstantInt::get(Type::Int32Ty, Idx1) + ConstantInt::get(Type::getInt32Ty(Context), Idx0), + ConstantInt::get(Type::getInt32Ty(Context), Idx1) }; if (Constant *PC = dyn_cast<Constant>(Ptr)) @@ -437,8 +437,8 @@ public: Value *CreateConstInBoundsGEP2_32(Value *Ptr, unsigned Idx0, unsigned Idx1, const char *Name = "") { Value *Idxs[] = { - ConstantInt::get(Type::Int32Ty, Idx0), - ConstantInt::get(Type::Int32Ty, Idx1) + ConstantInt::get(Type::getInt32Ty(Context), Idx0), + ConstantInt::get(Type::getInt32Ty(Context), Idx1) }; if (Constant *PC = dyn_cast<Constant>(Ptr)) @@ -447,7 +447,7 @@ public: return Insert(GetElementPtrInst::CreateInBounds(Ptr, Idxs, Idxs+2), Name); } Value *CreateConstGEP1_64(Value *Ptr, uint64_t Idx0, const char *Name = "") { - Value *Idx = ConstantInt::get(Type::Int64Ty, Idx0); + Value *Idx = ConstantInt::get(Type::getInt64Ty(Context), Idx0); if (Constant *PC = dyn_cast<Constant>(Ptr)) return Folder.CreateGetElementPtr(PC, &Idx, 1); @@ -456,7 +456,7 @@ public: } Value *CreateConstInBoundsGEP1_64(Value *Ptr, uint64_t Idx0, const char *Name = "") { - Value *Idx = ConstantInt::get(Type::Int64Ty, Idx0); + Value *Idx = ConstantInt::get(Type::getInt64Ty(Context), Idx0); if (Constant *PC = dyn_cast<Constant>(Ptr)) return Folder.CreateInBoundsGetElementPtr(PC, &Idx, 1); @@ -466,8 +466,8 @@ public: Value *CreateConstGEP2_64(Value *Ptr, uint64_t Idx0, uint64_t Idx1, const char *Name = "") { Value *Idxs[] = { - ConstantInt::get(Type::Int64Ty, Idx0), - ConstantInt::get(Type::Int64Ty, Idx1) + ConstantInt::get(Type::getInt64Ty(Context), Idx0), + ConstantInt::get(Type::getInt64Ty(Context), Idx1) }; if (Constant *PC = dyn_cast<Constant>(Ptr)) @@ -478,8 +478,8 @@ public: Value *CreateConstInBoundsGEP2_64(Value *Ptr, uint64_t Idx0, uint64_t Idx1, const char *Name = "") { Value *Idxs[] = { - ConstantInt::get(Type::Int64Ty, Idx0), - ConstantInt::get(Type::Int64Ty, Idx1) + ConstantInt::get(Type::getInt64Ty(Context), Idx0), + ConstantInt::get(Type::getInt64Ty(Context), Idx1) }; if (Constant *PC = dyn_cast<Constant>(Ptr)) @@ -491,7 +491,7 @@ public: return CreateConstInBoundsGEP2_32(Ptr, 0, Idx, Name); } Value *CreateGlobalString(const char *Str = "", const char *Name = "") { - Constant *StrConstant = ConstantArray::get(Str, true); + Constant *StrConstant = ConstantArray::get(Context, Str, true); Module &M = *BB->getParent()->getParent(); GlobalVariable *gv = new GlobalVariable(M, StrConstant->getType(), @@ -506,7 +506,7 @@ public: } Value *CreateGlobalStringPtr(const char *Str = "", const char *Name = "") { Value *gv = CreateGlobalString(Str, Name); - Value *zero = ConstantInt::get(Type::Int32Ty, 0); + Value *zero = ConstantInt::get(Type::getInt32Ty(Context), 0); Value *Args[] = { zero, zero }; return CreateInBoundsGEP(gv, Args, Args+2, Name); } @@ -802,8 +802,8 @@ public: assert(LHS->getType() == RHS->getType() && "Pointer subtraction operand types must match!"); const PointerType *ArgType = cast<PointerType>(LHS->getType()); - Value *LHS_int = CreatePtrToInt(LHS, Type::Int64Ty); - Value *RHS_int = CreatePtrToInt(RHS, Type::Int64Ty); + Value *LHS_int = CreatePtrToInt(LHS, Type::getInt64Ty(Context)); + Value *RHS_int = CreatePtrToInt(RHS, Type::getInt64Ty(Context)); Value *Difference = CreateSub(LHS_int, RHS_int); return CreateExactSDiv(Difference, ConstantExpr::getSizeOf(ArgType->getElementType()), diff --git a/include/llvm/Support/TypeBuilder.h b/include/llvm/Support/TypeBuilder.h index 1f85f1d125..64af647cdb 100644 --- a/include/llvm/Support/TypeBuilder.h +++ b/include/llvm/Support/TypeBuilder.h @@ -161,7 +161,7 @@ template<> class TypeBuilder<T, false> { \ public: \ static const IntegerType *get(LLVMContext &Context) { \ static const IntegerType *const result = \ - IntegerType::get(sizeof(T) * CHAR_BIT); \ + IntegerType::get(Context, sizeof(T) * CHAR_BIT); \ return result; \ } \ }; \ @@ -190,53 +190,53 @@ DEFINE_INTEGRAL_TYPEBUILDER(unsigned long long); template<uint32_t num_bits, bool cross> class TypeBuilder<types::i<num_bits>, cross> { public: - static const IntegerType *get(LLVMContext &Context) { - static const IntegerType *const result = IntegerType::get(num_bits); + static const IntegerType *get(LLVMContext &C) { + static const IntegerType *const result = IntegerType::get(C, num_bits); return result; } }; template<> class TypeBuilder<float, false> { public: - static const Type *get(LLVMContext&) { - return Type::FloatTy; + static const Type *get(LLVMContext& C) { + return Type::getFloatTy(C); } }; template<> class TypeBuilder<float, true> {}; template<> class TypeBuilder<double, false> { public: - static const Type *get(LLVMContext&) { - return Type::DoubleTy; + static const Type *get(LLVMContext& C) { + return Type::getDoubleTy(C); } }; template<> class TypeBuilder<double, true> {}; template<bool cross> class TypeBuilder<types::ieee_float, cross> { public: - static const Type *get(LLVMContext&) { return Type::FloatTy; } + static const Type *get(LLVMContext& C) { return Type::getFloatTy(C); } }; template<bool cross> class TypeBuilder<types::ieee_double, cross> { public: - static const Type *get(LLVMContext&) { return Type::DoubleTy; } + static const Type *get(LLVMContext& C) { return Type::getDoubleTy(C); } }; template<bool cross> class TypeBuilder<types::x86_fp80, cross> { public: - static const Type *get(LLVMContext&) { return Type::X86_FP80Ty; } + static const Type *get(LLVMContext& C) { return Type::getX86_FP80Ty(C); } }; template<bool cross> class TypeBuilder<types::fp128, cross> { public: - static const Type *get(LLVMContext&) { return Type::FP128Ty; } + static const Type *get(LLVMContext& C) { return Type::getFP128Ty(C); } }; template<bool cross> class TypeBuilder<types::ppc_fp128, cross> { public: - static const Type *get(LLVMContext&) { return Type::PPC_FP128Ty; } + static const Type *get(LLVMContext& C) { return Type::getPPC_FP128Ty(C); } }; template<bool cross> class TypeBuilder<void, cross> { public: - static const Type *get(LLVMContext&) { - return Type::VoidTy; + static const Type *get(LLVMContext &C) { + return Type::getVoidTy(C); } }; diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index 60c2c323d7..23775be70f 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -34,6 +34,7 @@ class IntegerType; class StructType; class StructLayout; class GlobalVariable; +class LLVMContext; /// Enum used to categorize the alignment types stored by TargetAlignElem enum AlignTypeEnum { @@ -229,7 +230,7 @@ public: /// getIntPtrType - Return an unsigned integer type that is the same size or /// greater to the host pointer size. /// - const IntegerType *getIntPtrType() const; + const IntegerType *getIntPtrType(LLVMContext &C) const; /// getIndexedOffset - return the offset from the beginning of the type for /// the specified indices. This is used to implement getelementptr. diff --git a/include/llvm/Type.h b/include/llvm/Type.h index 5e09a61222..05a4e26c8b 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -306,7 +306,7 @@ public: /// getVAArgsPromotedType - Return the type an argument of this type /// will be promoted to if passed through a variable argument /// function. - const Type *getVAArgsPromotedType() const; + const Type *getVAArgsPromotedType(LLVMContext &C) const; /// getScalarType - If this is a vector type, return the element type, /// otherwise return this. @@ -338,14 +338,24 @@ public: // /// getPrimitiveType - Return a type based on an identifier. - static const Type *getPrimitiveType(TypeID IDNumber); + static const Type *getPrimitiveType(LLVMContext &C, TypeID IDNumber); //===--------------------------------------------------------------------===// // These are the builtin types that are always available... // - static const Type *VoidTy, *LabelTy, *FloatTy, *DoubleTy, *MetadataTy; - static const Type *X86_FP80Ty, *FP128Ty, *PPC_FP128Ty; - static const IntegerType *Int1Ty, *Int8Ty, *Int16Ty, *Int32Ty, *Int64Ty; + static const Type *getVoidTy(LLVMContext &C); + static const Type *getLabelTy(LLVMContext &C); + static const Type *getFloatTy(LLVMContext &C); + static const Type *getDoubleTy(LLVMContext &C); + static const Type *getMetadataTy(LLVMContext &C); + static const Type *getX86_FP80Ty(LLVMContext &C); + static const Type *getFP128Ty(LLVMContext &C); + static const Type *getPPC_FP128Ty(LLVMContext &C); + static const IntegerType *getInt1Ty(LLVMContext &C); + static const IntegerType *getInt8Ty(LLVMContext &C); + static const IntegerType *getInt16Ty(LLVMContext &C); + static const IntegerType *getInt32Ty(LLVMContext &C); + static const IntegerType *getInt64Ty(LLVMContext &C); /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const Type *) { return true; } |