From: Dan Gohman Date: Sun, 24 May 2009 19:02:45 +0000 (+0000) Subject: Fix this code for hosts where std::vector doesn't have .data(). X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fb5a3419f351056e0f599699d276bcab412d2cce;p=oota-llvm.git Fix this code for hosts where std::vector doesn't have .data(). Use &Ops[0] instead, which is safe since Ops will never be empty here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72368 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp index 7ebc00a19ae..03406271ded 100644 --- a/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/lib/Analysis/ScalarEvolutionExpander.cpp @@ -351,7 +351,7 @@ Value *SCEVExpander::visitAddExpr(const SCEVAddExpr *S) { if (SE.TD) if (const PointerType *PTy = dyn_cast(V->getType())) { const std::vector &Ops = S->getOperands(); - return expandAddToGEP(Ops.data(), Ops.data() + Ops.size() - 1, + return expandAddToGEP(&Ops[0], &Ops[Ops.size() - 1], PTy, Ty, V); }