From ed8db7d9df395497d54ea9cecf1cecdad674cd7e 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. llvm-svn: 135673 --- llvm/lib/Analysis/ConstantFolding.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Analysis/ConstantFolding.cpp') diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index b60432be832..c9f738b6c3c 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/lib/Analysis/ConstantFolding.cpp @@ -562,7 +562,7 @@ static Constant *CastGEPIndices(ArrayRef Ops, if (!Any) return 0; Constant *C = - ConstantExpr::getGetElementPtr(Ops[0], &NewIdxs[0], NewIdxs.size()); + ConstantExpr::getGetElementPtr(Ops[0], NewIdxs); if (ConstantExpr *CE = dyn_cast(C)) if (Constant *Folded = ConstantFoldConstantExpression(CE, TD)) C = Folded; @@ -702,7 +702,7 @@ static Constant *SymbolicallyEvaluateGEP(ArrayRef Ops, // Create a GEP. Constant *C = - ConstantExpr::getGetElementPtr(Ptr, &NewIdxs[0], NewIdxs.size()); + ConstantExpr::getGetElementPtr(Ptr, NewIdxs); assert(cast(C->getType())->getElementType() == Ty && "Computed GetElementPtr has unexpected type!"); @@ -889,8 +889,7 @@ Constant *llvm::ConstantFoldInstOperands(unsigned Opcode, Type *DestTy, if (Constant *C = SymbolicallyEvaluateGEP(Ops, DestTy, TD)) return C; - return ConstantExpr::getGetElementPtr(Ops[0], Ops.data() + 1, - Ops.size() - 1); + return ConstantExpr::getGetElementPtr(Ops[0], Ops.slice(1)); } } -- cgit v1.2.3