/// rewrite expressions in canonical form.
///
/// Clients should create an instance of this class when rewriting is needed,
- /// and destroy it when finished to allow the release of the associated
+ /// and destroy it when finished to allow the release of the associated
/// memory.
struct SCEVExpander : public SCEVVisitor<SCEVExpander, Value*> {
ScalarEvolution &SE;
friend struct SCEVVisitor<SCEVExpander, Value*>;
public:
explicit SCEVExpander(ScalarEvolution &se)
- : SE(se), Builder(*se.getContext(),
- TargetFolder(se.TD, *se.getContext())) {}
+ : SE(se), Builder(se.getContext(), TargetFolder(se.TD)) {}
/// clear - Erase the contents of the InsertedExpressions map so that users
/// trying to expand the same expression into multiple BasicBlocks or
}
private:
- LLVMContext *getContext() const { return SE.getContext(); }
-
+ LLVMContext &getContext() const { return SE.getContext(); }
+
/// InsertBinop - Insert the specified binary operator, doing a small amount
/// of work to avoid inserting an obviously redundant operation.
Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, Value *RHS);
Value *visitUMaxExpr(const SCEVUMaxExpr *S);
+ Value *visitFieldOffsetExpr(const SCEVFieldOffsetExpr *S);
+
+ Value *visitAllocSizeExpr(const SCEVAllocSizeExpr *S);
+
Value *visitUnknown(const SCEVUnknown *S) {
return S->getValue();
}
}
#endif
-