24 bool enableIdiomRecognizer,
bool enableCIRSimplify,
25 bool enableLibOpt, llvm::StringRef libOptOptions) {
27 llvm::TimeTraceScope scope(
"CIR To CIR Passes");
29 mlir::PassManager pm(&mlirContext);
32 if (enableCIRSimplify)
35 if (enableIdiomRecognizer)
40 auto errorHandler = [](
const llvm::Twine &) -> mlir::LogicalResult {
41 return mlir::LogicalResult::failure();
44 if (libOptPass->initializeOptions(libOptOptions, errorHandler).failed())
45 return mlir::failure();
47 pm.addPass(std::move(libOptPass));
54 pm.enableVerifier(enableVerifier);
55 (void)mlir::applyPassManagerCLOptions(pm);
56 return pm.run(theModule);
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
mlir::LogicalResult runCIRToCIRPasses(mlir::ModuleOp theModule, mlir::MLIRContext &mlirCtx, clang::ASTContext &astCtx, bool enableVerifier, bool enableIdiomRecognizer, bool enableCIRSimplify, bool enableLibOpt, llvm::StringRef libOptOptions)