[SCEV] Still trying to fix windows buildbots
authorSam Parker <sam.parker@arm.com>
Mon, 24 Aug 2020 09:26:48 +0000 (10:26 +0100)
committerSam Parker <sam.parker@arm.com>
Mon, 24 Aug 2020 09:26:48 +0000 (10:26 +0100)
llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
llvm/lib/Analysis/ScalarEvolution.cpp

index 41df158..0327dc1 100644 (file)
@@ -74,25 +74,23 @@ class Type;
   /// This is the base class for unary cast operator classes.
   class SCEVCastExpr : public SCEV {
   protected:
-    const SCEV *const Op;
+    std::array<const SCEV *, 1> Operands;
     Type *Ty;
 
     SCEVCastExpr(const FoldingSetNodeIDRef ID,
                  unsigned SCEVTy, const SCEV *op, Type *ty);
 
   public:
-    const SCEV *getOperand() const { return Op; }
+    const SCEV *getOperand() const { return Operands[0]; }
     const SCEV *getOperand(unsigned i) const {
       assert(i == 0 && "Operand index out of range!");
-      return Op;
+      return Operands[0];
     }
     using op_iterator = const SCEV *const *;
     using op_range = iterator_range<op_iterator>;
 
-    op_iterator op_begin() const { return &Op; }
-    op_iterator op_end() const { return &Op + 1; }
     op_range operands() const {
-      return make_range(op_begin(), op_end());
+      return make_range(Operands.begin(), Operands.end());
     }
     size_t getNumOperands() const { return 1; }
     Type *getType() const { return Ty; }
index 75d2d39..9c9b9c5 100644 (file)
@@ -447,26 +447,28 @@ ScalarEvolution::getConstant(Type *Ty, uint64_t V, bool isSigned) {
 
 SCEVCastExpr::SCEVCastExpr(const FoldingSetNodeIDRef ID,
                            unsigned SCEVTy, const SCEV *op, Type *ty)
-  : SCEV(ID, SCEVTy, computeExpressionSize(op)), Op(op), Ty(ty) {}
+  : SCEV(ID, SCEVTy, computeExpressionSize(op)), Ty(ty) {
+    Operands[0] = op;
+}
 
 SCEVTruncateExpr::SCEVTruncateExpr(const FoldingSetNodeIDRef ID,
                                    const SCEV *op, Type *ty)
   : SCEVCastExpr(ID, scTruncate, op, ty) {
-  assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
+  assert(getOperand()->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
          "Cannot truncate non-integer value!");
 }
 
 SCEVZeroExtendExpr::SCEVZeroExtendExpr(const FoldingSetNodeIDRef ID,
                                        const SCEV *op, Type *ty)
   : SCEVCastExpr(ID, scZeroExtend, op, ty) {
-  assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
+  assert(getOperand()->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
          "Cannot zero extend non-integer value!");
 }
 
 SCEVSignExtendExpr::SCEVSignExtendExpr(const FoldingSetNodeIDRef ID,
                                        const SCEV *op, Type *ty)
   : SCEVCastExpr(ID, scSignExtend, op, ty) {
-  assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
+  assert(getOperand()->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
          "Cannot sign extend non-integer value!");
 }