#include "mlir-c/Pass.h"
#include "mlir/CAPI/IR.h"
#include "mlir/CAPI/Pass.h"
#include "mlir/CAPI/Support.h"
#include "mlir/CAPI/Utils.h"
#include "mlir/Pass/PassManager.h"
#include <optional>
usingnamespacemlir;
MlirPassManager mlirPassManagerCreate(MlirContext ctx) { … }
MlirPassManager mlirPassManagerCreateOnOperation(MlirContext ctx,
MlirStringRef anchorOp) { … }
void mlirPassManagerDestroy(MlirPassManager passManager) { … }
MlirOpPassManager
mlirPassManagerGetAsOpPassManager(MlirPassManager passManager) { … }
MlirLogicalResult mlirPassManagerRunOnOp(MlirPassManager passManager,
MlirOperation op) { … }
void mlirPassManagerEnableIRPrinting(MlirPassManager passManager) { … }
void mlirPassManagerEnableVerifier(MlirPassManager passManager, bool enable) { … }
MlirOpPassManager mlirPassManagerGetNestedUnder(MlirPassManager passManager,
MlirStringRef operationName) { … }
MlirOpPassManager mlirOpPassManagerGetNestedUnder(MlirOpPassManager passManager,
MlirStringRef operationName) { … }
void mlirPassManagerAddOwnedPass(MlirPassManager passManager, MlirPass pass) { … }
void mlirOpPassManagerAddOwnedPass(MlirOpPassManager passManager,
MlirPass pass) { … }
MlirLogicalResult mlirOpPassManagerAddPipeline(MlirOpPassManager passManager,
MlirStringRef pipelineElements,
MlirStringCallback callback,
void *userData) { … }
void mlirPrintPassPipeline(MlirOpPassManager passManager,
MlirStringCallback callback, void *userData) { … }
MlirLogicalResult mlirParsePassPipeline(MlirOpPassManager passManager,
MlirStringRef pipeline,
MlirStringCallback callback,
void *userData) { … }
namespace mlir {
class ExternalPass;
}
DEFINE_C_API_PTR_METHODS(…)
namespace mlir {
class ExternalPass : public Pass { … };
}
MlirPass mlirCreateExternalPass(MlirTypeID passID, MlirStringRef name,
MlirStringRef argument,
MlirStringRef description, MlirStringRef opName,
intptr_t nDependentDialects,
MlirDialectHandle *dependentDialects,
MlirExternalPassCallbacks callbacks,
void *userData) { … }
void mlirExternalPassSignalFailure(MlirExternalPass pass) { … }