diff options
Diffstat (limited to 'lib')
53 files changed, 235 insertions, 356 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 1f034e9862..126f850331 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -184,8 +184,8 @@ static Constant *FoldBitCast(Constant *C, const Type *DestTy, if (DstEltTy->isFloatingPoint()) { // Fold to an vector of integers with same size as our FP type. unsigned FPWidth = DstEltTy->getPrimitiveSizeInBits(); - const Type *DestIVTy = Context.getVectorType( - Context.getIntegerType(FPWidth), NumDstElt); + const Type *DestIVTy = VectorType::get( + IntegerType::get(FPWidth), NumDstElt); // Recursively handle this integer conversion, if possible. C = FoldBitCast(C, DestIVTy, TD, Context); if (!C) return 0; @@ -198,8 +198,8 @@ static Constant *FoldBitCast(Constant *C, const Type *DestTy, // it to integer first. if (SrcEltTy->isFloatingPoint()) { unsigned FPWidth = SrcEltTy->getPrimitiveSizeInBits(); - const Type *SrcIVTy = Context.getVectorType( - Context.getIntegerType(FPWidth), NumSrcElt); + const Type *SrcIVTy = VectorType::get( + IntegerType::get(FPWidth), NumSrcElt); // Ask VMCore to do the conversion now that #elts line up. C = ConstantExpr::getBitCast(C, SrcIVTy); CV = dyn_cast<ConstantVector>(C); diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 3db7ff964c..7ff1de6351 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -470,7 +470,7 @@ DIFactory::DIFactory(Module &m) : M(m), VMContext(M.getContext()), StopPointFn(0), FuncStartFn(0), RegionStartFn(0), RegionEndFn(0), DeclareFn(0) { - EmptyStructPtr = VMContext.getPointerTypeUnqual(VMContext.getStructType()); + EmptyStructPtr = PointerType::getUnqual(StructType::get()); } /// getCastToEmpty - Return this descriptor as a Constant* with type '{}*'. @@ -493,7 +493,7 @@ Constant *DIFactory::GetStringConstant(const std::string &String) { // Return Constant if previously defined. if (Slot) return Slot; - const PointerType *DestTy = VMContext.getPointerTypeUnqual(Type::Int8Ty); + const PointerType *DestTy = PointerType::getUnqual(Type::Int8Ty); // If empty string then use a i8* null instead. if (String.empty()) @@ -522,7 +522,7 @@ DIArray DIFactory::GetOrCreateArray(DIDescriptor *Tys, unsigned NumTys) { for (unsigned i = 0; i != NumTys; ++i) Elts.push_back(getCastToEmpty(Tys[i])); - Constant *Init = ConstantArray::get(VMContext.getArrayType(EmptyStructPtr, + Constant *Init = ConstantArray::get(ArrayType::get(EmptyStructPtr, Elts.size()), Elts.data(), Elts.size()); // If we already have this array, just return the uniqued version. @@ -1075,7 +1075,7 @@ namespace llvm { const Type *Ty = M->getTypeByName("llvm.dbg.global_variable.type"); if (!Ty) return 0; - Ty = Context.getPointerType(Ty, 0); + Ty = PointerType::get(Ty, 0); Value *Val = V->stripPointerCasts(); for (Value::use_iterator I = Val->use_begin(), E = Val->use_end(); diff --git a/lib/Analysis/LoopVR.cpp b/lib/Analysis/LoopVR.cpp index ccd5400df8..8ffac633d0 100644 --- a/lib/Analysis/LoopVR.cpp +++ b/lib/Analysis/LoopVR.cpp @@ -75,8 +75,8 @@ ConstantRange LoopVR::getRange(const SCEV *S, const SCEV *T, ScalarEvolution &SE ConstantRange X = getRange(Mul->getOperand(0), T, SE); if (X.isFullSet()) return FullSet; - const IntegerType *Ty = Context.getIntegerType(X.getBitWidth()); - const IntegerType *ExTy = Context.getIntegerType(X.getBitWidth() * + const IntegerType *Ty = IntegerType::get(X.getBitWidth()); + const IntegerType *ExTy = IntegerType::get(X.getBitWidth() * Mul->getNumOperands()); ConstantRange XExt = X.zeroExtend(ExTy->getBitWidth()); diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 3bf5e70cc1..8c4d191efb 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -4670,7 +4670,7 @@ const SCEV *ScalarEvolution::getBECount(const SCEV *Start, // Check Add for unsigned overflow. // TODO: More sophisticated things could be done here. - const Type *WideTy = getContext().getIntegerType(getTypeSizeInBits(Ty) + 1); + const Type *WideTy = IntegerType::get(getTypeSizeInBits(Ty) + 1); const SCEV *EDiff = getZeroExtendExpr(Diff, WideTy); const SCEV *ERoundUp = getZeroExtendExpr(RoundUp, WideTy); const SCEV *OperandExtendedAdd = getAddExpr(EDiff, ERoundUp); diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp index 4a7e123093..a6e63448b2 100644 --- a/lib/AsmParser/LLLexer.cpp +++ b/lib/AsmParser/LLLexer.cpp @@ -471,7 +471,7 @@ lltok::Kind LLLexer::LexIdentifier() { Error("bitwidth for integer type out of range!"); return lltok::Error; } - TyVal = Context.getIntegerType(NumBits); + TyVal = IntegerType::get(NumBits); return lltok::Type; } diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 8b3b832cb6..359a733cd9 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -1104,7 +1104,7 @@ bool LLParser::ParseTypeRec(PATypeHolder &Result) { break; case lltok::kw_opaque: // TypeRec ::= 'opaque' - Result = Context.getOpaqueType(); + Result = OpaqueType::get(); Lex.Lex(); break; case lltok::lbrace: @@ -1134,7 +1134,7 @@ bool LLParser::ParseTypeRec(PATypeHolder &Result) { if (const Type *T = M->getTypeByName(Lex.getStrVal())) { Result = T; } else { - Result = Context.getOpaqueType(); + Result = OpaqueType::get(); ForwardRefTypes.insert(std::make_pair(Lex.getStrVal(), std::make_pair(Result, Lex.getLoc()))); @@ -1153,7 +1153,7 @@ bool LLParser::ParseTypeRec(PATypeHolder &Result) { if (I != ForwardRefTypeIDs.end()) Result = I->second.first; else { - Result = Context.getOpaqueType(); + Result = OpaqueType::get(); ForwardRefTypeIDs.insert(std::make_pair(Lex.getUIntVal(), std::make_pair(Result, Lex.getLoc()))); @@ -1166,7 +1166,7 @@ bool LLParser::ParseTypeRec(PATypeHolder &Result) { Lex.Lex(); unsigned Val; if (ParseUInt32(Val)) return true; - OpaqueType *OT = Context.getOpaqueType(); //Use temporary placeholder. + OpaqueType *OT = OpaqueType::get(); //Use temporary placeholder. UpRefs.push_back(UpRefRecord(Lex.getLoc(), Val, OT)); Result = OT; break; @@ -1187,7 +1187,7 @@ bool LLParser::ParseTypeRec(PATypeHolder &Result) { return TokError("pointers to void are invalid; use i8* instead"); if (!PointerType::isValidElementType(Result.get())) return TokError("pointer to this type is invalid"); - Result = HandleUpRefs(Context.getPointerTypeUnqual(Result.get())); + Result = HandleUpRefs(PointerType::getUnqual(Result.get())); Lex.Lex(); break; @@ -1204,7 +1204,7 @@ bool LLParser::ParseTypeRec(PATypeHolder &Result) { ParseToken(lltok::star, "expected '*' in address space")) return true; - Result = HandleUpRefs(Context.getPointerType(Result.get(), AddrSpace)); + Result = HandleUpRefs(PointerType::get(Result.get(), AddrSpace)); break; } @@ -1365,7 +1365,7 @@ bool LLParser::ParseFunctionType(PATypeHolder &Result) { for (unsigned i = 0, e = ArgList.size(); i != e; ++i) ArgListTy.push_back(ArgList[i].Type); - Result = HandleUpRefs(Context.getFunctionType(Result.get(), + Result = HandleUpRefs(FunctionType::get(Result.get(), ArgListTy, isVarArg)); return false; } @@ -1381,7 +1381,7 @@ bool LLParser::ParseStructType(PATypeHolder &Result, bool Packed) { Lex.Lex(); // Consume the '{' if (EatIfPresent(lltok::rbrace)) { - Result = Context.getStructType(Packed); + Result = StructType::get(Packed); return false; } @@ -1413,7 +1413,7 @@ bool LLParser::ParseStructType(PATypeHolder &Result, bool Packed) { std::vector<const Type*> ParamsListTy; for (unsigned i = 0, e = ParamsList.size(); i != e; ++i) ParamsListTy.push_back(ParamsList[i].get()); - Result = HandleUpRefs(Context.getStructType(ParamsListTy, Packed)); + Result = HandleUpRefs(StructType::get(ParamsListTy, Packed)); return false; } @@ -1452,11 +1452,11 @@ bool LLParser::ParseArrayVectorType(PATypeHolder &Result, bool isVector) { return Error(SizeLoc, "size too large for vector"); if (!VectorType::isValidElementType(EltTy)) return Error(TypeLoc, "vector element type must be fp or integer"); - Result = Context.getVectorType(EltTy, unsigned(Size)); + Result = VectorType::get(EltTy, unsigned(Size)); } else { if (!ArrayType::isValidElementType(EltTy)) return Error(TypeLoc, "invalid array element type"); - Result = HandleUpRefs(Context.getArrayType(EltTy, Size)); + Result = HandleUpRefs(ArrayType::get(EltTy, Size)); } return false; } @@ -1836,7 +1836,7 @@ bool LLParser::ParseValID(ValID &ID) { return Error(FirstEltLoc, "invalid array element type: " + Elts[0]->getType()->getDescription()); - ArrayType *ATy = Context.getArrayType(Elts[0]->getType(), Elts.size()); + ArrayType *ATy = ArrayType::get(Elts[0]->getType(), Elts.size()); // Verify all elements are correct type! for (unsigned i = 0, e = Elts.size(); i != e; ++i) { @@ -2417,8 +2417,8 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) { return Error(RetTypeLoc, "functions with 'sret' argument must return void"); const FunctionType *FT = - Context.getFunctionType(RetType, ParamTypeList, isVarArg); - const PointerType *PFT = Context.getPointerTypeUnqual(FT); + FunctionType::get(RetType, ParamTypeList, isVarArg); + const PointerType *PFT = PointerType::getUnqual(FT); Fn = 0; if (!FunctionName.empty()) { @@ -2902,8 +2902,8 @@ bool LLParser::ParseInvoke(Instruction *&Inst, PerFunctionState &PFS) { if (!FunctionType::isValidReturnType(RetType)) return Error(RetTypeLoc, "Invalid result type for LLVM function"); - Ty = Context.getFunctionType(RetType, ParamTypes, false); - PFTy = Context.getPointerTypeUnqual(Ty); + Ty = FunctionType::get(RetType, ParamTypes, false); + PFTy = PointerType::getUnqual(Ty); } // Look up the callee. @@ -3242,8 +3242,8 @@ bool LLParser::ParseCall(Instruction *&Inst, PerFunctionState &PFS, if (!FunctionType::isValidReturnType(RetType)) return Error(RetTypeLoc, "Invalid result type for LLVM function"); - Ty = Context.getFunctionType(RetType, ParamTypes, false); - PFTy = Context.getPointerTypeUnqual(Ty); + Ty = FunctionType::get(RetType, ParamTypes, false); + PFTy = PointerType::getUnqual(Ty); } // Look up the callee. diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 2b22404086..1e6f5b6dd4 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -322,7 +322,7 @@ const Type *BitcodeReader::getTypeByID(unsigned ID, bool isTypeTable) { // The type table allows forward references. Push as many Opaque types as // needed to get up to ID. while (TypeList.size() <= ID) - TypeList.push_back(Context.getOpaqueType()); + TypeList.push_back(OpaqueType::get()); return TypeList.back().get(); } @@ -512,7 +512,7 @@ bool BitcodeReader::ParseTypeTable() { if (Record.size() < 1) return Error("Invalid Integer type record"); - ResultTy = Context.getIntegerType(Record[0]); + ResultTy = IntegerType::get(Record[0]); break; case bitc::TYPE_CODE_POINTER: { // POINTER: [pointee type] or // [pointee type, address space] @@ -521,7 +521,7 @@ bool BitcodeReader::ParseTypeTable() { unsigned AddressSpace = 0; if (Record.size() == 2) AddressSpace = Record[1]; - ResultTy = Context.getPointerType(getTypeByID(Record[0], true), + ResultTy = PointerType::get(getTypeByID(Record[0], true), AddressSpace); break; } @@ -534,7 +534,7 @@ bool BitcodeReader::ParseTypeTable() { for (unsigned i = 3, e = Record.size(); i != e; ++i) ArgTys.push_back(getTypeByID(Record[i], true)); - ResultTy = Context.getFunctionType(getTypeByID(Record[2], true), ArgTys, + ResultTy = FunctionType::get(getTypeByID(Record[2], true), ArgTys, Record[0]); break; } @@ -544,24 +544,24 @@ bool BitcodeReader::ParseTypeTable() { std::vector<const Type*> EltTys; for (unsigned i = 1, e = Record.size(); i != e; ++i) EltTys.push_back(getTypeByID(Record[i], true)); - ResultTy = Context.getStructType(EltTys, Record[0]); + ResultTy = StructType::get(EltTys, Record[0]); break; } case bitc::TYPE_CODE_ARRAY: // ARRAY: [numelts, eltty] if (Record.size() < 2) return Error("Invalid ARRAY type record"); - ResultTy = Context.getArrayType(getTypeByID(Record[1], true), Record[0]); + ResultTy = ArrayType::get(getTypeByID(Record[1], true), Record[0]); break; case bitc::TYPE_CODE_VECTOR: // VECTOR: [numelts, eltty] if (Record.size() < 2) return Error("Invalid VECTOR type record"); - ResultTy = Context.getVectorType(getTypeByID(Record[1], true), Record[0]); + ResultTy = VectorType::get(getTypeByID(Record[1], true), Record[0]); break; } if (NumRecords == TypeList.size()) { // If this is a new type slot, just append it. - TypeList.push_back(ResultTy ? ResultTy : Context.getOpaqueType()); + TypeList.push_back(ResultTy ? ResultTy : OpaqueType::get()); ++NumRecords; } else if (ResultTy == 0) { // Otherwise, this was forward referenced, so an opaque type was created, @@ -1046,7 +1046,7 @@ bool BitcodeReader::ParseConstants() { return Error("Invalid CE_SHUFFLEVEC record"); Constant *Op0 = ValueList.getConstantFwdRef(Record[0], OpTy); Constant *Op1 = ValueList.getConstantFwdRef(Record[1], OpTy); - const Type *ShufTy = Context.getVectorType(Type::Int32Ty, + const Type *ShufTy = VectorType::get(Type::Int32Ty, OpTy->getNumElements()); Constant *Op2 = ValueList.getConstantFwdRef(Record[2], ShufTy); V = ConstantExpr::getShuffleVector(Op0, Op1, Op2); @@ -1059,7 +1059,7 @@ bool BitcodeReader::ParseConstants() { return Error("Invalid CE_SHUFVEC_EX record"); Constant *Op0 = ValueList.getConstantFwdRef(Record[1], OpTy); Constant *Op1 = ValueList.getConstantFwdRef(Record[2], OpTy); - const Type *ShufTy = Context.getVectorType(Type::Int32Ty, + const Type *ShufTy = VectorType::get(Type::Int32Ty, RTy->getNumElements()); Constant *Op2 = ValueList.getConstantFwdRef(Record[3], ShufTy); V = ConstantExpr::getShuffleVector(Op0, Op1, Op2); @@ -1940,7 +1940,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { Value *Val, *Ptr; if (getValueTypePair(Record, OpNum, NextValueNo, Val) || getValue(Record, OpNum, - Context.getPointerTypeUnqual(Val->getType()), Ptr)|| + PointerType::getUnqual(Val->getType()), Ptr)|| OpNum+2 != Record.size()) return Error("Invalid STORE record"); diff --git a/lib/CodeGen/DwarfEHPrepare.cpp b/lib/CodeGen/DwarfEHPrepare.cpp index 43760afad8..5bfb32870c 100644 --- a/lib/CodeGen/DwarfEHPrepare.cpp +++ b/lib/CodeGen/DwarfEHPrepare.cpp @@ -354,8 +354,7 @@ Instruction *DwarfEHPrepare::CreateValueLoad(BasicBlock *BB) { // Create the temporary if we didn't already. if (!ExceptionValueVar) { - ExceptionValueVar = new AllocaInst( - BB->getContext().getPointerTypeUnqual(Type::Int8Ty), + ExceptionValueVar = new AllocaInst(PointerType::getUnqual(Type::Int8Ty), "eh.value", F->begin()->begin()); ++NumStackTempsIntroduced; } diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index aacd9e847a..0796f2251d 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -3664,7 +3664,7 @@ SDValue DAGCombiner::CombineConsecutiveLoads(SDNode *N, MVT VT) { TLI.isConsecutiveLoad(LD2, LD1, LD1VT.getSizeInBits()/8, 1, MFI)) { unsigned Align = LD1->getAlignment(); unsigned NewAlign = TLI.getTargetData()-> - getABITypeAlignment(VT.getTypeForMVT(*DAG.getContext())); + getABITypeAlignment(VT.getTypeForMVT()); if (NewAlign <= Align && (!LegalOperations || TLI.isOperationLegal(ISD::LOAD, VT))) @@ -3722,7 +3722,7 @@ SDValue DAGCombiner::visitBIT_CONVERT(SDNode *N) { (!LegalOperations || TLI.isOperationLegal(ISD::LOAD, VT))) { LoadSDNode *LN0 = cast<LoadSDNode>(N0); unsigned Align = TLI.getTargetData()-> - getABITypeAlignment(VT.getTypeForMVT(*DAG.getContext())); + getABITypeAlignment(VT.getTypeForMVT()); unsigned OrigAlign = LN0->getAlignment(); if (Align <= OrigAlign) { @@ -4993,8 +4993,7 @@ SDValue DAGCombiner::ReduceLoadOpStoreWidth(SDNode *N) { unsigned NewAlign = MinAlign(LD->getAlignment(), PtrOff); if (NewAlign < - TLI.getTargetData()->getABITypeAlignment(NewVT.getTypeForMVT( - *DAG.getContext()))) + TLI.getTargetData()->getABITypeAlignment(NewVT.getTypeForMVT())) return SDValue(); SDValue NewPtr = DAG.getNode(ISD::ADD, LD->getDebugLoc(), @@ -5049,7 +5048,7 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) { unsigned OrigAlign = ST->getAlignment(); MVT SVT = Value.getOperand(0).getValueType(); unsigned Align = TLI.getTargetData()-> - getABITypeAlignment(SVT.getTypeForMVT(*DAG.getContext())); + getABITypeAlignment(SVT.getTypeForMVT()); if (Align <= OrigAlign && ((!LegalOperations && !ST->isVolatile()) || TLI.isOperationLegalOrCustom(ISD::STORE, SVT))) @@ -5329,8 +5328,7 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) { // Check the resultant load doesn't need a higher alignment than the // original load. unsigned NewAlign = - TLI.getTargetData()->getABITypeAlignment(LVT.getTypeForMVT( - *DAG.getContext())); + TLI.getTargetData()->getABITypeAlignment(LVT.getTypeForMVT()); if (NewAlign > Align || !TLI.isOperationLegalOrCustom(ISD::LOAD, LVT)) return SDValue(); @@ -5812,8 +5810,7 @@ SDValue DAGCombiner::SimplifySelectCC(DebugLoc DL, SDValue N0, SDValue N1, const TargetData &TD = *TLI.getTargetData(); // Create a ConstantArray of the two constants. - Constant *CA = ConstantArray::get( - DAG.getContext()->getArrayType(FPTy, 2), Elts, 2); + Constant *CA = ConstantArray::get(ArrayType::get(FPTy, 2), Elts, 2); SDValue CPIdx = DAG.getConstantPool(CA, TLI.getPointerTy(), TD.getPrefTypeAlignment(FPTy)); unsigned Alignment = cast<ConstantPoolSDNode>(CPIdx)->getAlignment(); diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index e4b71b1a40..7293144b4e 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -361,7 +361,7 @@ static SDValue ExpandConstantFP(ConstantFPSDNode *CFP, bool UseCP, // smaller type. TLI.isLoadExtLegal(ISD::EXTLOAD, SVT) && TLI.ShouldShrinkFPConstant(OrigVT)) { - const Type *SType = SVT.getTypeForMVT(*DAG.getContext()); + const Type *SType = SVT.getTypeForMVT(); LLVMC = cast<ConstantFP>(ConstantExpr::getFPTrunc(LLVMC, SType)); VT = SVT; Extend = true; @@ -1107,11 +1107,10 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { // expand it. if (!TLI.allowsUnalignedMemoryAccesses()) { unsigned ABIAlignment = TLI.getTargetData()-> - getABITypeAlignment(LD->getMemoryVT().getTypeForMVT( - *DAG.getContext())); + getABITypeAlignment(LD->getMemoryVT().getTypeForMVT()); if (LD->getAlignment() < ABIAlignment){ - Result = ExpandUnalignedLoad(cast<LoadSDNode>(Result.getNode()), DAG, - TLI); + Result = ExpandUnalignedLoad(cast<LoadSDNode>(Result.getNode()), + DAG, TLI); Tmp3 = Result.getOperand(0); Tmp4 = Result.getOperand(1); Tmp3 = LegalizeOp(Tmp3); @@ -1291,11 +1290,10 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { // expand it. if (!TLI.allowsUnalignedMemoryAccesses()) { unsigned ABIAlignment = TLI.getTargetData()-> - getABITypeAlignment(LD->getMemoryVT().getTypeForMVT( - *DAG.getContext())); + getABITypeAlignment(LD->getMemoryVT().getTypeForMVT()); if (LD->getAlignment() < ABIAlignment){ - Result = ExpandUnalignedLoad(cast<LoadSDNode>(Result.getNode()), DAG, - TLI); + Result = ExpandUnalignedLoad(cast<LoadSDNode>(Result.getNode()), + DAG, TLI); Tmp1 = Result.getOperand(0); Tmp2 = Result.getOperand(1); Tmp1 = LegalizeOp(Tmp1); @@ -1370,8 +1368,7 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { // expand it. if (!TLI.allowsUnalignedMemoryAccesses()) { unsigned ABIAlignment = TLI.getTargetData()-> - getABITypeAlignment(ST->getMemoryVT().getTypeForMVT( - *DAG.getContext())); + getABITypeAlignment(ST->getMemoryVT().getTypeForMVT()); if (ST->getAlignment() < ABIAlignment) Result = ExpandUnalignedStore(cast<StoreSDNode>(Result.getNode()), DAG, TLI); @@ -1470,8 +1467,7 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { // expand it. if (!TLI.allowsUnalignedMemoryAccesses()) { unsigned ABIAlignment = TLI.getTargetData()-> - getABITypeAlignment(ST->getMemoryVT().getTypeForMVT( - *DAG.getContext())); + getABITypeAlignment(ST->getMemoryVT().getTypeForMVT()); if (ST->getAlignment() < ABIAlignment) Result = ExpandUnalignedStore(cast<StoreSDNode>(Result.getNode()), DAG, TLI); @@ -1737,7 +1733,7 @@ SDValue SelectionDAGLegalize::EmitStackConvert(SDValue SrcOp, // Create the stack frame object. unsigned SrcAlign = TLI.getTargetData()->getPrefTypeAlignment(SrcOp.getValueType(). - getTypeForMVT(*DAG.getContext())); + getTypeForMVT()); SDValue FIPtr = DAG.CreateStackTemporary(SlotVT, SrcAlign); FrameIndexSDNode *StackPtrFI = cast<FrameIndexSDNode>(FIPtr); @@ -1748,8 +1744,7 @@ SDValue SelectionDAGLegalize::EmitStackConvert(SDValue SrcOp, unsigned SlotSize = SlotVT.getSizeInBits(); unsigned DestSize = DestVT. |