Fix this code for hosts where std::vector doesn't have .data().
authorDan Gohman <gohman@apple.com>
Sun, 24 May 2009 19:02:45 +0000 (19:02 +0000)
committerDan Gohman <gohman@apple.com>
Sun, 24 May 2009 19:02:45 +0000 (19:02 +0000)
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

lib/Analysis/ScalarEvolutionExpander.cpp

index 7ebc00a19ae05dec57a3018e1a93f273d07b4f72..03406271dedee4d67f3b8f52f7c3da1002a2f0c2 100644 (file)
@@ -351,7 +351,7 @@ Value *SCEVExpander::visitAddExpr(const SCEVAddExpr *S) {
   if (SE.TD)
     if (const PointerType *PTy = dyn_cast<PointerType>(V->getType())) {
       const std::vector<SCEVHandle> &Ops = S->getOperands();
-      return expandAddToGEP(Ops.data(), Ops.data() + Ops.size() - 1,
+      return expandAddToGEP(&Ops[0], &Ops[Ops.size() - 1],
                             PTy, Ty, V);
     }