diff --git a/mlir/examples/toy/Ch3/toyc.cpp b/mlir/examples/toy/Ch3/toyc.cpp --- a/mlir/examples/toy/Ch3/toyc.cpp +++ b/mlir/examples/toy/Ch3/toyc.cpp @@ -115,7 +115,8 @@ if (enableOpt) { mlir::PassManager pm(module.get()->getName()); // Apply any generic pass manager command line options and run the pipeline. - applyPassManagerCLOptions(pm); + if (mlir::failed(mlir::applyPassManagerCLOptions(pm))) + return 4; // Add a run of the canonicalizer to optimize the mlir module. pm.addNestedPass(mlir::createCanonicalizerPass()); diff --git a/mlir/examples/toy/Ch4/toyc.cpp b/mlir/examples/toy/Ch4/toyc.cpp --- a/mlir/examples/toy/Ch4/toyc.cpp +++ b/mlir/examples/toy/Ch4/toyc.cpp @@ -116,7 +116,8 @@ if (enableOpt) { mlir::PassManager pm(module.get()->getName()); // Apply any generic pass manager command line options and run the pipeline. - applyPassManagerCLOptions(pm); + if (mlir::failed(mlir::applyPassManagerCLOptions(pm))) + return 4; // Inline all functions into main and then delete them. pm.addPass(mlir::createInlinerPass()); diff --git a/mlir/examples/toy/Ch5/toyc.cpp b/mlir/examples/toy/Ch5/toyc.cpp --- a/mlir/examples/toy/Ch5/toyc.cpp +++ b/mlir/examples/toy/Ch5/toyc.cpp @@ -119,7 +119,8 @@ mlir::PassManager pm(module.get()->getName()); // Apply any generic pass manager command line options and run the pipeline. - applyPassManagerCLOptions(pm); + if (mlir::failed(mlir::applyPassManagerCLOptions(pm))) + return 4; // Check to see what granularity of MLIR we are compiling to. bool isLoweringToAffine = emitAction >= Action::DumpMLIRAffine; diff --git a/mlir/examples/toy/Ch6/toyc.cpp b/mlir/examples/toy/Ch6/toyc.cpp --- a/mlir/examples/toy/Ch6/toyc.cpp +++ b/mlir/examples/toy/Ch6/toyc.cpp @@ -136,7 +136,8 @@ mlir::PassManager pm(module.get()->getName()); // Apply any generic pass manager command line options and run the pipeline. - applyPassManagerCLOptions(pm); + if (mlir::failed(mlir::applyPassManagerCLOptions(pm))) + return 4; // Check to see what granularity of MLIR we are compiling to. bool isLoweringToAffine = emitAction >= Action::DumpMLIRAffine; diff --git a/mlir/examples/toy/Ch7/toyc.cpp b/mlir/examples/toy/Ch7/toyc.cpp --- a/mlir/examples/toy/Ch7/toyc.cpp +++ b/mlir/examples/toy/Ch7/toyc.cpp @@ -136,7 +136,8 @@ mlir::PassManager pm(module.get()->getName()); // Apply any generic pass manager command line options and run the pipeline. - applyPassManagerCLOptions(pm); + if (mlir::failed(mlir::applyPassManagerCLOptions(pm))) + return 4; // Check to see what granularity of MLIR we are compiling to. bool isLoweringToAffine = emitAction >= Action::DumpMLIRAffine;