#include "mlir/Analysis/DataFlowFramework.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Pass/Pass.h"
#include <optional>
usingnamespacemlir;
namespace {
class FooState : public AnalysisState { … };
class FooAnalysis : public DataFlowAnalysis { … };
struct TestFooAnalysisPass
: public PassWrapper<TestFooAnalysisPass, OperationPass<func::FuncOp>> { … };
}
LogicalResult FooAnalysis::initialize(Operation *top) { … }
LogicalResult FooAnalysis::visit(ProgramPoint *point) { … }
void FooAnalysis::visitBlock(Block *block) { … }
void FooAnalysis::visitOperation(Operation *op) { … }
void TestFooAnalysisPass::runOnOperation() { … }
namespace mlir {
namespace test {
void registerTestFooAnalysisPass() { … }
}
}