summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/ConstantFold.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
-rw-r--r--llvm/lib/IR/ConstantFold.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index 16ecf1c4437..a915d285b14 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -2079,8 +2079,7 @@ static Constant *ConstantFoldGetElementPtrImpl(Constant *C,
if (PerformFold) {
SmallVector<Value*, 16> NewIndices;
NewIndices.reserve(Idxs.size() + CE->getNumOperands());
- for (unsigned i = 1, e = CE->getNumOperands()-1; i != e; ++i)
- NewIndices.push_back(CE->getOperand(i));
+ NewIndices.append(CE->op_begin() + 1, CE->op_end() - 1);
// Add the last index of the source with the first index of the new GEP.
// Make sure to handle the case when they are actually different types.
OpenPOWER on IntegriCloud