Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use

ArrayRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135761 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jay Foad
2011-07-22 08:16:57 +00:00
parent 48ac8e9be7
commit 0a2a60ace9
9 changed files with 42 additions and 54 deletions

View File

@@ -340,7 +340,7 @@ ShadowStackGC::CreateGEP(LLVMContext &Context, IRBuilder<> &B, Value *BasePtr,
Value *Indices[] = { ConstantInt::get(Type::getInt32Ty(Context), 0),
ConstantInt::get(Type::getInt32Ty(Context), Idx),
ConstantInt::get(Type::getInt32Ty(Context), Idx2) };
Value* Val = B.CreateGEP(BasePtr, Indices, Indices + 3, Name);
Value* Val = B.CreateGEP(BasePtr, Indices, Name);
assert(isa<GetElementPtrInst>(Val) && "Unexpected folded constant");
@@ -352,7 +352,7 @@ ShadowStackGC::CreateGEP(LLVMContext &Context, IRBuilder<> &B, Value *BasePtr,
int Idx, const char *Name) {
Value *Indices[] = { ConstantInt::get(Type::getInt32Ty(Context), 0),
ConstantInt::get(Type::getInt32Ty(Context), Idx) };
Value *Val = B.CreateGEP(BasePtr, Indices, Indices + 2, Name);
Value *Val = B.CreateGEP(BasePtr, Indices, Name);
assert(isa<GetElementPtrInst>(Val) && "Unexpected folded constant");