summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-07-21 14:31:17 +0000
committerJay Foad <jay.foad@gmail.com>2011-07-21 14:31:17 +0000
commited8db7d9df395497d54ea9cecf1cecdad674cd7e (patch)
tree4da14cc7a50cc83e03bd6353a059c10b5a719eee /llvm/lib/Transforms/IPO/GlobalOpt.cpp
parent95f1ebd41b103eba1cb64305e9cc924527a8744f (diff)
downloadbcm5719-llvm-ed8db7d9df395497d54ea9cecf1cecdad674cd7e.tar.gz
bcm5719-llvm-ed8db7d9df395497d54ea9cecf1cecdad674cd7e.zip
Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
Diffstat (limited to 'llvm/lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 5c2b7e1a10b..2d971a1e192 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -596,8 +596,7 @@ static GlobalVariable *SRAGlobal(GlobalVariable *GV, const TargetData &TD) {
Idxs.push_back(NullInt);
for (unsigned i = 3, e = CE->getNumOperands(); i != e; ++i)
Idxs.push_back(CE->getOperand(i));
- NewPtr = ConstantExpr::getGetElementPtr(cast<Constant>(NewPtr),
- &Idxs[0], Idxs.size());
+ NewPtr = ConstantExpr::getGetElementPtr(cast<Constant>(NewPtr), Idxs);
} else {
GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP);
SmallVector<Value*, 8> Idxs;
@@ -753,8 +752,7 @@ static bool OptimizeAwayTrappingUsesOfValue(Value *V, Constant *NewV) {
break;
if (Idxs.size() == GEPI->getNumOperands()-1)
Changed |= OptimizeAwayTrappingUsesOfValue(GEPI,
- ConstantExpr::getGetElementPtr(NewV, &Idxs[0],
- Idxs.size()));
+ ConstantExpr::getGetElementPtr(NewV, Idxs));
if (GEPI->use_empty()) {
Changed = true;
GEPI->eraseFromParent();
@@ -2410,8 +2408,8 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
i != e; ++i)
GEPOps.push_back(getVal(Values, *i));
InstResult = cast<GEPOperator>(GEP)->isInBounds() ?
- ConstantExpr::getInBoundsGetElementPtr(P, &GEPOps[0], GEPOps.size()) :
- ConstantExpr::getGetElementPtr(P, &GEPOps[0], GEPOps.size());
+ ConstantExpr::getInBoundsGetElementPtr(P, GEPOps) :
+ ConstantExpr::getGetElementPtr(P, GEPOps);
} else if (LoadInst *LI = dyn_cast<LoadInst>(CurInst)) {
if (LI->isVolatile()) return false; // no volatile accesses.
InstResult = ComputeLoadResult(getVal(Values, LI->getOperand(0)),
OpenPOWER on IntegriCloud