diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/CGObjCGNU.cpp | 10 | ||||
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/CGRTTI.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/CGVTT.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 8 |
6 files changed, 14 insertions, 14 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index fc0da99f4f..b900e1f9c6 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -964,7 +964,7 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E, if (!Offset->isNullValue()) { llvm::Type *Type = llvm::Type::getInt8PtrTy(VMContext); llvm::Constant *Casted = llvm::ConstantExpr::getBitCast(C, Type); - Casted = llvm::ConstantExpr::getGetElementPtr(Casted, &Offset, 1); + Casted = llvm::ConstantExpr::getGetElementPtr(Casted, Offset); C = llvm::ConstantExpr::getBitCast(Casted, C->getType()); } diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 730357ff4f..fa5f7ef205 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -171,7 +171,7 @@ protected: llvm::Constant *MakeConstantString(const std::string &Str, const std::string &Name="") { llvm::Constant *ConstStr = CGM.GetAddrOfConstantCString(Str, Name.c_str()); - return llvm::ConstantExpr::getGetElementPtr(ConstStr, Zeros, 2); + return llvm::ConstantExpr::getGetElementPtr(ConstStr, Zeros); } /// Emits a linkonce_odr string, whose name is the prefix followed by the /// string value. This allows the linker to combine the strings between @@ -186,7 +186,7 @@ protected: ConstStr = new llvm::GlobalVariable(TheModule, value->getType(), true, llvm::GlobalValue::LinkOnceODRLinkage, value, prefix + Str); } - return llvm::ConstantExpr::getGetElementPtr(ConstStr, Zeros, 2); + return llvm::ConstantExpr::getGetElementPtr(ConstStr, Zeros); } /// Generates a global structure, initialized by the elements in the vector. /// The element types must match the types of the structure elements in the @@ -918,7 +918,7 @@ llvm::Constant *CGObjCGNU::GetEHType(QualType T) { llvm::GlobalValue::ExternalLinkage, 0, vtableName); } llvm::Constant *Two = llvm::ConstantInt::get(IntTy, 2); - Vtable = llvm::ConstantExpr::getGetElementPtr(Vtable, &Two, 1); + Vtable = llvm::ConstantExpr::getGetElementPtr(Vtable, Two); Vtable = llvm::ConstantExpr::getBitCast(Vtable, PtrToInt8Ty); llvm::Constant *typeName = @@ -1976,7 +1976,7 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) { offsetPointerIndexes[2] = llvm::ConstantInt::get(IndexTy, i); // Get the correct ivar field llvm::Constant *offsetValue = llvm::ConstantExpr::getGetElementPtr( - IvarList, offsetPointerIndexes, 4); + IvarList, offsetPointerIndexes); // Get the existing variable, if one exists. llvm::GlobalVariable *offset = TheModule.getNamedGlobal(Name); if (offset) { @@ -2129,7 +2129,7 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() { llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext), i), Zeros[0]}; // FIXME: We're generating redundant loads and stores here! llvm::Constant *SelPtr = llvm::ConstantExpr::getGetElementPtr(SelectorList, - Idxs, 2); + makeArrayRef(Idxs, 2)); // If selectors are defined as an opaque type, cast the pointer to this // type. SelPtr = llvm::ConstantExpr::getBitCast(SelPtr, SelectorTy); diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index dbf95d4d73..796d1eefc6 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -1375,7 +1375,7 @@ static llvm::Constant *getConstantGEP(llvm::LLVMContext &VMContext, llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext), idx0), llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext), idx1) }; - return llvm::ConstantExpr::getGetElementPtr(C, Idxs, 2); + return llvm::ConstantExpr::getGetElementPtr(C, Idxs); } /// hasObjCExceptionAttribute - Return true if this class or any super @@ -6096,7 +6096,7 @@ CGObjCNonFragileABIMac::GetInterfaceEHType(const ObjCInterfaceDecl *ID, llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext), 2); std::vector<llvm::Constant*> Values(3); - Values[0] = llvm::ConstantExpr::getGetElementPtr(VTableGV, &VTableIdx, 1); + Values[0] = llvm::ConstantExpr::getGetElementPtr(VTableGV, VTableIdx); Values[1] = GetClassName(ID->getIdentifier()); Values[2] = GetClassGlobal(ClassName); llvm::Constant *Init = diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index 23e6a42e5d..1ef9a17a2c 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -484,7 +484,7 @@ void RTTIBuilder::BuildVTablePointer(const Type *Ty) { // The vtable address point is 2. llvm::Constant *Two = llvm::ConstantInt::get(PtrDiffTy, 2); - VTable = llvm::ConstantExpr::getInBoundsGetElementPtr(VTable, &Two, 1); + VTable = llvm::ConstantExpr::getInBoundsGetElementPtr(VTable, Two); VTable = llvm::ConstantExpr::getBitCast(VTable, Int8PtrTy); Fields.push_back(VTable); diff --git a/lib/CodeGen/CGVTT.cpp b/lib/CodeGen/CGVTT.cpp index f9709da8af..49d0938e53 100644 --- a/lib/CodeGen/CGVTT.cpp +++ b/lib/CodeGen/CGVTT.cpp @@ -208,7 +208,7 @@ void VTTBuilder::AddVTablePointer(BaseSubobject Base, llvm::Constant *VTable, }; llvm::Constant *Init = - llvm::ConstantExpr::getInBoundsGetElementPtr(VTable, Idxs, 2); + llvm::ConstantExpr::getInBoundsGetElementPtr(VTable, Idxs); llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGM.getLLVMContext()); Init = llvm::ConstantExpr::getBitCast(Init, Int8PtrTy); diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index f3c3c247d2..0ac3b663cb 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1715,7 +1715,7 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { "__CFConstantStringClassReference"); // Decay array -> ptr CFConstantStringClassRef = - llvm::ConstantExpr::getGetElementPtr(GV, Zeros, 2); + llvm::ConstantExpr::getGetElementPtr(GV, Zeros); } QualType CFTy = getContext().getCFConstantStringType(); @@ -1763,7 +1763,7 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { CharUnits Align = getContext().getTypeAlignInChars(getContext().CharTy); GV->setAlignment(Align.getQuantity()); } - Fields[2] = llvm::ConstantExpr::getGetElementPtr(GV, Zeros, 2); + Fields[2] = llvm::ConstantExpr::getGetElementPtr(GV, Zeros); // String length. Ty = getTypes().ConvertType(getContext().LongTy); @@ -1816,7 +1816,7 @@ CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal) { GV = CreateRuntimeVariable(PTy, str); // Decay array -> ptr ConstantStringClassRef = - llvm::ConstantExpr::getGetElementPtr(GV, Zeros, 2); + llvm::ConstantExpr::getGetElementPtr(GV, Zeros); } } @@ -1844,7 +1844,7 @@ CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal) { GV->setUnnamedAddr(true); CharUnits Align = getContext().getTypeAlignInChars(getContext().CharTy); GV->setAlignment(Align.getQuantity()); - Fields[1] = llvm::ConstantExpr::getGetElementPtr(GV, Zeros, 2); + Fields[1] = llvm::ConstantExpr::getGetElementPtr(GV, Zeros); // String length. llvm::Type *Ty = getTypes().ConvertType(getContext().UnsignedIntTy); |