From a5c04344fa70d6eec34344760c1fe511e16f2d76 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Thu, 21 Jul 2011 14:31:17 +0000 Subject: Convert ConstantExpr::getGetElementPtr and ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135673 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') 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); -- cgit v1.2.3-18-g5258