Skip to content

Commit 2e194fe

Browse files
committed
[SCEV] Still trying to fix windows buildbots
1 parent 0f0be3f commit 2e194fe

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,23 @@ class Type;
7474
/// This is the base class for unary cast operator classes.
7575
class SCEVCastExpr : public SCEV {
7676
protected:
77-
const SCEV *const Op;
77+
std::array<const SCEV *, 1> Operands;
7878
Type *Ty;
7979

8080
SCEVCastExpr(const FoldingSetNodeIDRef ID,
8181
unsigned SCEVTy, const SCEV *op, Type *ty);
8282

8383
public:
84-
const SCEV *getOperand() const { return Op; }
84+
const SCEV *getOperand() const { return Operands[0]; }
8585
const SCEV *getOperand(unsigned i) const {
8686
assert(i == 0 && "Operand index out of range!");
87-
return Op;
87+
return Operands[0];
8888
}
8989
using op_iterator = const SCEV *const *;
9090
using op_range = iterator_range<op_iterator>;
9191

92-
op_iterator op_begin() const { return &Op; }
93-
op_iterator op_end() const { return &Op + 1; }
9492
op_range operands() const {
95-
return make_range(op_begin(), op_end());
93+
return make_range(Operands.begin(), Operands.end());
9694
}
9795
size_t getNumOperands() const { return 1; }
9896
Type *getType() const { return Ty; }

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,26 +447,28 @@ ScalarEvolution::getConstant(Type *Ty, uint64_t V, bool isSigned) {
447447

448448
SCEVCastExpr::SCEVCastExpr(const FoldingSetNodeIDRef ID,
449449
unsigned SCEVTy, const SCEV *op, Type *ty)
450-
: SCEV(ID, SCEVTy, computeExpressionSize(op)), Op(op), Ty(ty) {}
450+
: SCEV(ID, SCEVTy, computeExpressionSize(op)), Ty(ty) {
451+
Operands[0] = op;
452+
}
451453

452454
SCEVTruncateExpr::SCEVTruncateExpr(const FoldingSetNodeIDRef ID,
453455
const SCEV *op, Type *ty)
454456
: SCEVCastExpr(ID, scTruncate, op, ty) {
455-
assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
457+
assert(getOperand()->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
456458
"Cannot truncate non-integer value!");
457459
}
458460

459461
SCEVZeroExtendExpr::SCEVZeroExtendExpr(const FoldingSetNodeIDRef ID,
460462
const SCEV *op, Type *ty)
461463
: SCEVCastExpr(ID, scZeroExtend, op, ty) {
462-
assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
464+
assert(getOperand()->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
463465
"Cannot zero extend non-integer value!");
464466
}
465467

466468
SCEVSignExtendExpr::SCEVSignExtendExpr(const FoldingSetNodeIDRef ID,
467469
const SCEV *op, Type *ty)
468470
: SCEVCastExpr(ID, scSignExtend, op, ty) {
469-
assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
471+
assert(getOperand()->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
470472
"Cannot sign extend non-integer value!");
471473
}
472474

0 commit comments

Comments
 (0)