13#ifndef MLIR_DIALECT_SMT_IR_SMTVISITORS_H
14#define MLIR_DIALECT_SMT_IR_SMTVISITORS_H
16#include "llvm/ADT/TypeSwitch.h"
24template <
typename ConcreteType,
typename ResultType = void,
typename... ExtraArgs>
28 auto *thisCast =
static_cast<ConcreteType *
>(
this);
29 return TypeSwitch<Operation *, ResultType>(op)
54 return thisCast->visitSMTOp(expr, args...);
55 }).Default([&](
auto expr) -> ResultType {
return thisCast->visitInvalidSMTOp(op, args...); });
60 op->emitOpError(
"unknown SMT node");
68#define HANDLE(OPTYPE, OPKIND) \
69 ResultType visitSMTOp(OPTYPE op, ExtraArgs... args) { \
70 return static_cast<ConcreteType *>(this)->visit##OPKIND##SMTOp(op, args...); \
150template <
typename ConcreteType,
typename ResultType = void,
typename... ExtraArgs>
154 auto *thisCast =
static_cast<ConcreteType *
>(
this);
155 return TypeSwitch<Type, ResultType>(type)
156 .template Case<BoolType, IntType, BitVectorType, ArrayType, SMTFuncType, SortType>(
157 [&](
auto expr) -> ResultType {
return thisCast->visitSMTType(expr, args...); }
159 .Default([&](
auto expr) -> ResultType {
160 return thisCast->visitInvalidSMTType(type, args...);
171#define HANDLE(TYPE, KIND) \
172 ResultType visitSMTType(TYPE op, ExtraArgs... args) { \
173 return static_cast<ConcreteType *>(this)->visit##KIND##SMTType(op, args...); \
This helps visit SMT nodes.
HANDLE(IntMulOp, Unhandled)
HANDLE(BVURemOp, Unhandled)
HANDLE(ResetOp, Unhandled)
HANDLE(ForallOp, Unhandled)
ResultType visitInvalidSMTOp(Operation *op, ExtraArgs... args)
This callback is invoked on any non-expression operations.
HANDLE(ArrayStoreOp, Unhandled)
HANDLE(BVLShrOp, Unhandled)
HANDLE(BVUDivOp, Unhandled)
HANDLE(BoolConstantOp, Unhandled)
HANDLE(BVShlOp, Unhandled)
HANDLE(BVAShrOp, Unhandled)
HANDLE(PushOp, Unhandled)
HANDLE(ImpliesOp, Unhandled)
HANDLE(ExistsOp, Unhandled)
HANDLE(IntAddOp, Unhandled)
HANDLE(IntSubOp, Unhandled)
HANDLE(BVConstantOp, Unhandled)
HANDLE(RepeatOp, Unhandled)
ResultType visitUnhandledSMTOp(Operation *op, ExtraArgs... args)
This callback is invoked on any SMT operations that are not handled by the concrete visitor.
HANDLE(Int2BVOp, Unhandled)
HANDLE(ConcatOp, Unhandled)
HANDLE(SetLogicOp, Unhandled)
HANDLE(AssertOp, Unhandled)
HANDLE(BVMulOp, Unhandled)
HANDLE(BV2IntOp, Unhandled)
HANDLE(SolverOp, Unhandled)
HANDLE(IntModOp, Unhandled)
HANDLE(BVSRemOp, Unhandled)
HANDLE(BVAddOp, Unhandled)
HANDLE(IntConstantOp, Unhandled)
HANDLE(BVAndOp, Unhandled)
HANDLE(BVXOrOp, Unhandled)
HANDLE(BVNotOp, Unhandled)
HANDLE(CheckOp, Unhandled)
HANDLE(BVSDivOp, Unhandled)
HANDLE(BVNegOp, Unhandled)
HANDLE(ArraySelectOp, Unhandled)
HANDLE(YieldOp, Unhandled)
HANDLE(ExtractOp, Unhandled)
HANDLE(ApplyFuncOp, Unhandled)
HANDLE(DistinctOp, Unhandled)
HANDLE(IntDivOp, Unhandled)
HANDLE(BVCmpOp, Unhandled)
HANDLE(IntCmpOp, Unhandled)
HANDLE(BVOrOp, Unhandled)
HANDLE(BVSModOp, Unhandled)
ResultType dispatchSMTOpVisitor(Operation *op, ExtraArgs... args)
HANDLE(DeclareFunOp, Unhandled)
HANDLE(ArrayBroadcastOp, Unhandled)
This helps visit SMT types.
HANDLE(BoolType, Unhandled)
HANDLE(SortType, Unhandled)
HANDLE(BitVectorType, Unhandled)
ResultType visitUnhandledSMTType(Type type, ExtraArgs... args)
This callback is invoked on any SMT type that are not handled by the concrete visitor.
HANDLE(IntegerType, Unhandled)
ResultType dispatchSMTTypeVisitor(Type type, ExtraArgs... args)
HANDLE(SMTFuncType, Unhandled)
ResultType visitInvalidSMTType(Type type, ExtraArgs... args)
This callback is invoked on any non-expression types.
HANDLE(ArrayType, Unhandled)