diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-29 22:17:13 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-29 22:17:13 +0000 |
commit | debcb01b0f0a15f568ca69e8f288fade4bfc7297 (patch) | |
tree | 22a274838cf6c55205a8a3f0a80262b09b63b069 /lib/VMCore | |
parent | 37c4a2d6f15ff32c9ae91e333d655a349e195993 (diff) |
Move types back to the 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AutoUpgrade.cpp | 6 | ||||
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 6 | ||||
-rw-r--r-- | lib/VMCore/Constants.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/Core.cpp | 21 | ||||
-rw-r--r-- | lib/VMCore/Function.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/Globals.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/Instructions.cpp | 11 | ||||
-rw-r--r-- | lib/VMCore/LLVMContext.cpp | 83 | ||||
-rw-r--r-- | lib/VMCore/Module.cpp | 12 | ||||
-rw-r--r-- | lib/VMCore/ValueTypes.cpp | 50 | ||||
-rw-r--r-- | lib/VMCore/Verifier.cpp | 3 |
11 files changed, 53 insertions, 147 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp index fc86e54682..81d143a58a 100644 --- a/lib/VMCore/AutoUpgrade.cpp +++ b/lib/VMCore/AutoUpgrade.cpp @@ -27,8 +27,6 @@ using namespace llvm; static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { assert(F && "Illegal to upgrade a non-existent Function."); - LLVMContext &Context = F->getContext(); - // Get the Function's name. const std::string& Name = F->getName(); @@ -167,7 +165,7 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { Name.compare(13,4,"psrl", 4) == 0) && Name[17] != 'i') { const llvm::Type *VT = - Context.getVectorType(Context.getIntegerType(64), 1); + VectorType::get(IntegerType::get(64), 1); // We don't have to do anything if the parameter already has // the correct type. @@ -268,7 +266,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { if (isLoadH || isLoadL) { Value *Op1 = Context.getUndef(Op0->getType()); Value *Addr = new BitCastInst(CI->getOperand(2), - Context.getPointerTypeUnqual(Type::DoubleTy), + PointerType::getUnqual(Type::DoubleTy), "upgraded.", CI); Value *Load = new LoadInst(Addr, "upgraded.", false, 8, CI); Value *Idx = ConstantInt::get(Type::Int32Ty, 0); diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 440fb88856..ab0016059e 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -1373,7 +1373,7 @@ Constant *llvm::ConstantFoldCompareInstruction(LLVMContext &Context, const Constant *C2) { const Type *ResultTy; if (const VectorType *VT = dyn_cast<VectorType>(C1->getType())) - ResultTy = Context.getVectorType(Type::Int1Ty, VT->getNumElements()); + ResultTy = VectorType::get(Type::Int1Ty, VT->getNumElements()); else ResultTy = Type::Int1Ty; @@ -1677,7 +1677,7 @@ Constant *llvm::ConstantFoldGetElementPtr(LLVMContext &Context, (Value **)Idxs, (Value **)Idxs+NumIdx); assert(Ty != 0 && "Invalid indices for GEP!"); - return Context.getUndef(Context.getPointerType(Ty, Ptr->getAddressSpace())); + return Context.getUndef(PointerType::get(Ty, Ptr->getAddressSpace())); } Constant *Idx0 = Idxs[0]; @@ -1695,7 +1695,7 @@ Constant *llvm::ConstantFoldGetElementPtr(LLVMContext &Context, (Value**)Idxs+NumIdx); assert(Ty != 0 && "Invalid indices for GEP!"); return Context.getConstantPointerNull( - Context.getPointerType(Ty,Ptr->getAddressSpace())); + PointerType::get(Ty,Ptr->getAddressSpace())); } } diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 6746882ed8..1ff596fb71 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -178,7 +178,7 @@ ConstantInt::ConstantInt(const IntegerType *Ty, const APInt& V) // invariant which generates an assertion. ConstantInt *ConstantInt::get(LLVMContext &Context, const APInt& V) { // Get the corresponding integer type for the bit width of the value. - const IntegerType *ITy = Context.getIntegerType(V.getBitWidth()); + const IntegerType *ITy = IntegerType::get(V.getBitWidth()); // get an existing value or the insertion position DenseMapAPIntKeyInfo::KeyTy Key(V, ITy); diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index bf5a6a1b75..59aeb87800 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -162,7 +162,7 @@ LLVMTypeRef LLVMInt32Type(void) { return (LLVMTypeRef) Type::Int32Ty; } LLVMTypeRef LLVMInt64Type(void) { return (LLVMTypeRef) Type::Int64Ty; } LLVMTypeRef LLVMIntType(unsigned NumBits) { - return wrap(getGlobalContext().getIntegerType(NumBits)); + return wrap(IntegerType::get(NumBits)); } unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy) { @@ -186,8 +186,7 @@ LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, for (LLVMTypeRef *I = ParamTypes, *E = ParamTypes + ParamCount; I != E; ++I) Tys.push_back(unwrap(*I)); - return wrap(getGlobalContext().getFunctionType(unwrap(ReturnType), Tys, - IsVarArg != 0)); + return wrap(FunctionType::get(unwrap(ReturnType), Tys, IsVarArg != 0)); } int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy) { @@ -218,7 +217,7 @@ LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, *E = ElementTypes + ElementCount; I != E; ++I) Tys.push_back(unwrap(*I)); - return wrap(getGlobalContext().getStructType(Tys, Packed != 0)); + return wrap(StructType::get(Tys, Packed != 0)); } unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy) { @@ -239,18 +238,15 @@ int LLVMIsPackedStruct(LLVMTypeRef StructTy) { /*--.. Operations on array, pointer, and vector types (sequence types) .....--*/ LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount) { - return wrap(getGlobalContext().getArrayType(unwrap(ElementType), - ElementCount)); + return wrap(ArrayType::get(unwrap(ElementType), ElementCount)); } LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace) { - return wrap(getGlobalContext().getPointerType(unwrap(ElementType), - AddressSpace)); + return wrap(PointerType::get(unwrap(ElementType), AddressSpace)); } LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount) { - return wrap(getGlobalContext().getVectorType(unwrap(ElementType), - ElementCount)); + return wrap(VectorType::get(unwrap(ElementType), ElementCount)); } LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty) { @@ -275,7 +271,7 @@ LLVMTypeRef LLVMVoidType(void) { return (LLVMTypeRef) Type::VoidTy; } LLVMTypeRef LLVMLabelType(void) { return (LLVMTypeRef) Type::LabelTy; } LLVMTypeRef LLVMOpaqueType(void) { - return wrap(getGlobalContext().getOpaqueType()); + return wrap(OpaqueType::get()); } /*--.. Operations on type handles ..........................................--*/ @@ -408,8 +404,7 @@ LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length) { - return wrap(ConstantArray::get( - getGlobalContext().getArrayType(unwrap(ElementTy), Length), + return wrap(ConstantArray::get(ArrayType::get(unwrap(ElementTy), Length), unwrap<Constant>(ConstantVals, Length), Length)); } diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index cdf2dd07fa..9fc300043d 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -346,7 +346,7 @@ const FunctionType *Intrinsic::getType(LLVMContext &Context, #include "llvm/Intrinsics.gen" #undef GET_INTRINSIC_GENERATOR - return Context.getFunctionType(ResultTy, ArgTys, IsVarArg); + return FunctionType::get(ResultTy, ArgTys, IsVarArg); } bool Intrinsic::isOverloaded(ID id) { diff --git a/lib/VMCore/Globals.cpp b/lib/VMCore/Globals.cpp index e01dedd597..d18a20162d 100644 --- a/lib/VMCore/Globals.cpp +++ b/lib/VMCore/Globals.cpp @@ -98,7 +98,7 @@ GlobalVariable::GlobalVariable(LLVMContext &Context, const Type *Ty, bool constant, LinkageTypes Link, Constant *InitVal, const Twine &Name, bool ThreadLocal, unsigned AddressSpace) - : GlobalValue(Context.getPointerType(Ty, AddressSpace), + : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal, OperandTraits<GlobalVariable>::op_begin(this), InitVal != 0, Link, Name), @@ -117,7 +117,7 @@ GlobalVariable::GlobalVariable(Module &M, const Type *Ty, bool constant, const Twine &Name, GlobalVariable *Before, bool ThreadLocal, unsigned AddressSpace) - : GlobalValue(M.getContext().getPointerType(Ty, AddressSpace), + : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal, OperandTraits<GlobalVariable>::op_begin(this), InitVal != 0, Link, Name), diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 0b24241505..08b4396307 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -716,7 +716,7 @@ static Value *getAISize(LLVMContext &Context, Value *Amt) { AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, unsigned Align, const Twine &Name, Instruction *InsertBefore) - : UnaryInstruction(Ty->getContext().getPointerTypeUnqual(Ty), iTy, + : UnaryInstruction(PointerType::getUnqual(Ty), iTy, getAISize(Ty->getContext(), ArraySize), InsertBefore) { setAlignment(Align); assert(Ty != Type::VoidTy && "Cannot allocate void!"); @@ -726,7 +726,7 @@ AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, unsigned Align, const Twine &Name, BasicBlock *InsertAtEnd) - : UnaryInstruction(Ty->getContext().getPointerTypeUnqual(Ty), iTy, + : UnaryInstruction(PointerType::getUnqual(Ty), iTy, getAISize(Ty->getContext(), ArraySize), InsertAtEnd) { setAlignment(Align); assert(Ty != Type::VoidTy && "Cannot allocate void!"); @@ -1046,7 +1046,7 @@ GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI) GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx, const Twine &Name, Instruction *InBe) - : Instruction(Ptr->getType()->getContext().getPointerType( + : Instruction(PointerType::get( checkType(getIndexedType(Ptr->getType(),Idx)), retrieveAddrSpace(Ptr)), GetElementPtr, OperandTraits<GetElementPtrInst>::op_end(this) - 2, @@ -1056,7 +1056,7 @@ GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx, GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx, const Twine &Name, BasicBlock *IAE) - : Instruction(Ptr->getType()->getContext().getPointerType( + : Instruction(PointerType::get( checkType(getIndexedType(Ptr->getType(),Idx)), retrieveAddrSpace(Ptr)), GetElementPtr, @@ -1270,8 +1270,7 @@ ShuffleVectorInst::ShuffleVectorInst(const ShuffleVectorInst &SV) ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask, const Twine &Name, Instruction *InsertBefore) -: Instruction(V1->getType()->getContext().getVectorType( - cast<VectorType>(V1->getType())->getElementType(), +: Instruction(VectorType::get(cast<VectorType>(V1->getType())->getElementType(), cast<VectorType>(Mask->getType())->getNumElements()), ShuffleVector, OperandTraits<ShuffleVectorInst>::op_begin(this), diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp index e38986eb3d..8bd45b2954 100644 --- a/lib/VMCore/LLVMContext.cpp +++ b/lib/VMCore/LLVMContext.cpp @@ -113,89 +113,6 @@ MDString* LLVMContext::getMDString(const StringRef &Str) { return pImpl->getMDString(Str.data(), Str.size()); } -// FunctionType accessors -FunctionType* LLVMContext::getFunctionType(const Type* Result, bool isVarArg) { - return FunctionType::get(Result, isVarArg); -} - -FunctionType* LLVMContext::getFunctionType(const Type* Result, - const std::vector<const Type*>& Params, - bool isVarArg) { - return FunctionType::get(Result, Params, isVarArg); -} - -// IntegerType accessors -const IntegerType* LLVMContext::getIntegerType(unsigned NumBits) { - return IntegerType::get(NumBits); -} - -// OpaqueType accessors -OpaqueType* LLVMContext::getOpaqueType() { - return OpaqueType::get(); -} - -// StructType accessors -StructType* LLVMContext::getStructType(bool isPacked) { - return StructType::get(isPacked); -} - -StructType* LLVMContext::getStructType(const std::vector<const Type*>& Params, - bool isPacked) { - return StructType::get(Params, isPacked); -} - -StructType *LLVMContext::getStructType(const Type *type, ...) { - va_list ap; - std::vector<const llvm::Type*> StructFields; - va_start(ap, type); - while (type) { - StructFields.push_back(type); - type = va_arg(ap, llvm::Type*); - } - return StructType::get(StructFields); -} - -// ArrayType accessors -ArrayType* LLVMContext::getArrayType(const Type* ElementType, - uint64_t NumElements) { - return ArrayType::get(ElementType, NumElements); -} - -// PointerType accessors -PointerType* LLVMContext::getPointerType(const Type* ElementType, - unsigned AddressSpace) { - return PointerType::get(ElementType, AddressSpace); -} - -PointerType* LLVMContext::getPointerTypeUnqual(const Type* ElementType) { - return PointerType::getUnqual(ElementType); -} - -// VectorType accessors -VectorType* LLVMContext::getVectorType(const Type* ElementType, - unsigned NumElements) { - return VectorType::get(ElementType, NumElements); -} - -VectorType* LLVMContext::getVectorTypeInteger(const VectorType* VTy) { - return VectorType::getInteger(VTy); -} - -VectorType* LLVMContext::getVectorTypeExtendedElement(const VectorType* VTy) { - return VectorType::getExtendedElementVectorType(VTy); -} - -VectorType* LLVMContext::getVectorTypeTruncatedElement(const VectorType* VTy) { - return VectorType::getTruncatedElementVectorType(VTy); -} - -const Type* LLVMContext::makeCmpResultType(const Type* opnd_type) { - if (const VectorType* vt = dyn_cast<const VectorType>(opnd_type)) { - return getVectorType(Type::Int1Ty, vt->getNumElements()); - } - return Type::Int1Ty; -} - void LLVMContext::erase(MDString *M) { pImpl->erase(M); } diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 2ef16d01f6..87d4b05cf1 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -153,8 +153,8 @@ Constant *Module::getOrInsertFunction(const StringRef &Name, // If the function exists but has the wrong type, return a bitcast to the // right type. - if (F->getType() != Context.getPointerTypeUnqual(Ty)) - return ConstantExpr::getBitCast(F, Context.getPointerTypeUnqual(Ty)); + if (F->getType() != PointerType::getUnqual(Ty)) + return ConstantExpr::getBitCast(F, PointerType::getUnqual(Ty)); // Otherwise, we just found the existing function or a prototype. return F; @@ -203,7 +203,7 @@ Constant *Module::getOrInsertFunction(const StringRef &Name, // Build the function type and chain to the other getOrInsertFunction... return getOrInsertFunction(Name, - Context.getFunctionType(RetTy, ArgTys, false), + FunctionType::get(RetTy, ArgTys, false), AttributeList); } @@ -221,7 +221,7 @@ Constant *Module::getOrInsertFunction(const StringRef &Name, // Build the function type and chain to the other getOrInsertFunction... return getOrInsertFunction(Name, - Context.getFunctionType(RetTy, ArgTys, false), + FunctionType::get(RetTy, ArgTys, false), AttrListPtr::get((AttributeWithIndex *)0, 0)); } @@ -271,8 +271,8 @@ Constant *Module::getOrInsertGlobal(const StringRef &Name, const Type *Ty) { // If the variable exists but has the wrong type, return a bitcast to the // right type. - if (GV->getType() != Context.getPointerTypeUnqual(Ty)) - return ConstantExpr::getBitCast(GV, Context.getPointerTypeUnqual(Ty)); + if (GV->getType() != PointerType::getUnqual(Ty)) + return ConstantExpr::getBitCast(GV, PointerType::getUnqual(Ty)); // Otherwise, we just found the existing function or a prototype. return GV; diff --git a/lib/VMCore/ValueTypes.cpp b/lib/VMCore/ValueTypes.cpp index 5badffc82c..244659607f 100644 --- a/lib/VMCore/ValueTypes.cpp +++ b/lib/VMCore/ValueTypes.cpp @@ -21,16 +21,14 @@ using namespace llvm; MVT MVT::getExtendedIntegerVT(unsigned BitWidth) { MVT VT; - VT.LLVMTy = getGlobalContext().getIntegerType(BitWidth); + VT.LLVMTy = IntegerType::get(BitWidth); assert(VT.isExtended() && "Type is not extended!"); return VT; } MVT MVT::getExtendedVectorVT(MVT VT, unsigned NumElements) { MVT ResultVT; - ResultVT.LLVMTy = getGlobalContext().getVectorType( - VT.getTypeForMVT(getGlobalContext()), - NumElements); + ResultVT.LLVMTy = VectorType::get(VT.getTypeForMVT(), NumElements); assert(ResultVT.isExtended() && "Type is not extended!"); return ResultVT; } @@ -133,7 +131,7 @@ std::string MVT::getMVTString() const { /// getTypeForMVT - This method returns an LLVM type corresponding to the /// specified MVT. For integer types, this returns an unsigned type. Note /// that this will abort for types that cannot be represented. -const Type *MVT::getTypeForMVT(LLVMContext &Context) const { +const Type *MVT::getTypeForMVT() const { switch (V) { default: assert(isExtended() && "Type is not extended!"); @@ -144,32 +142,32 @@ const Type *MVT::getTypeForMVT(LLVMContext &Context) const { case MVT::i16: return Type::Int16Ty; case MVT::i32: return Type::Int32Ty; case MVT::i64: return Type::Int64Ty; - case MVT::i128: return Context.getIntegerType(128); + case MVT::i128: return IntegerType::get(128); case MVT::f32: return Type::FloatTy; case MVT::f64: return Type::DoubleTy; case MVT::f80: return Type::X86_FP80Ty; case MVT::f128: return Type::FP128Ty; case MVT::ppcf128: return Type::PPC_FP128Ty; - case MVT::v2i8: return Context.getVectorType(Type::Int8Ty, 2); - case MVT::v4i8: return Context.getVectorType(Type::Int8Ty, 4); - case MVT::v8i8: return Context.getVectorType(Type::Int8Ty, 8); - case MVT::v16i8: return Context.getVectorType(Type::Int8Ty, 16); - case MVT::v32i8: return Context.getVectorType(Type::Int8Ty, 32); - case MVT::v2i16: return Context.getVectorType(Type::Int16Ty, 2); - case MVT::v4i16: return Context.getVectorType(Type::Int16Ty, 4); - case MVT::v8i16: return Context.getVectorType(Type::Int16Ty, 8); - case MVT::v16i16: return Context.getVectorType(Type::Int16Ty, 16); - case MVT::v2i32: return Context.getVectorType(Type::Int32Ty, 2); - case MVT::v4i32: return Context.getVectorType(Type::Int32Ty, 4); - case MVT::v8i32: return Context.getVectorType(Type::Int32Ty, 8); - case MVT::v1i64: return Context.getVectorType(Type::Int64Ty, 1); - case MVT::v2i64: return Context.getVectorType(Type::Int64Ty, 2); - case MVT::v4i64: return Context.getVectorType(Type::Int64Ty, 4); - case MVT::v2f32: return Context.getVectorType(Type::FloatTy, 2); - case MVT::v4f32: return Context.getVectorType(Type::FloatTy, 4); - case MVT::v8f32: return Context.getVectorType(Type::FloatTy, 8); - case MVT::v2f64: return Context.getVectorType(Type::DoubleTy, 2); - case MVT::v4f64: return Context.getVectorType(Type::DoubleTy, 4); + case MVT::v2i8: return VectorType::get(Type::Int8Ty, 2); + case MVT::v4i8: return VectorType::get(Type::Int8Ty, 4); + case MVT::v8i8: return VectorType::get(Type::Int8Ty, 8); + case MVT::v16i8: return VectorType::get(Type::Int8Ty, 16); + case MVT::v32i8: return VectorType::get(Type::Int8Ty, 32); + case MVT::v2i16: return VectorType::get(Type::Int16Ty, 2); + case MVT::v4i16: return VectorType::get(Type::Int16Ty, 4); + case MVT::v8i16: return VectorType::get(Type::Int16Ty, 8); + case MVT::v16i16: return VectorType::get(Type::Int16Ty, 16); + case MVT::v2i32: return VectorType::get(Type::Int32Ty, 2); + case MVT::v4i32: return VectorType::get(Type::Int32Ty, 4); + case MVT::v8i32: return VectorType::get(Type::Int32Ty, 8); + case MVT::v1i64: return VectorType::get(Type::Int64Ty, 1); + case MVT::v2i64: return VectorType::get(Type::Int64Ty, 2); + case MVT::v4i64: return VectorType::get(Type::Int64Ty, 4); + case MVT::v2f32: return VectorType::get(Type::FloatTy, 2); + case MVT::v4f32: return VectorType::get(Type::FloatTy, 4); + case MVT::v8f32: return VectorType::get(Type::FloatTy, 8); + case MVT::v2f64: return VectorType::get(Type::DoubleTy, 2); + case MVT::v4f64: return VectorType::get(Type::DoubleTy, 4); } } diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 6d179d01a6..407a80b237 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1490,7 +1490,6 @@ static std::string IntrinsicParam(unsigned ArgNo, unsigned NumRets) { bool Verifier::PerformTypeCheck(Intrinsic::ID ID, Function *F, const Type *Ty, int VT, unsigned ArgNo, std::string &Suffix) { const FunctionType *FTy = F->getFunctionType(); - LLVMContext &Context = FTy->getContext(); unsigned NumElts = 0; const Type *EltTy = Ty; @@ -1620,7 +1619,7 @@ bool Verifier::PerformTypeCheck(Intrinsic::ID ID, Function *F, const Type *Ty, "vector elements!", F); return false; } - } else if (MVT((MVT::SimpleValueType)VT).getTypeForMVT(Context) != EltTy) { + } else if (MVT((MVT::SimpleValueType)VT).getTypeForMVT() != EltTy) { CheckFailed(IntrinsicParam(ArgNo, NumRets) + " is wrong!", F); return false; } else if (EltTy != Ty) { |