diff options
Diffstat (limited to 'mlir')
| -rw-r--r-- | mlir/examples/toy/Ch2/toyc.cpp | 2 | ||||
| -rw-r--r-- | mlir/examples/toy/Ch3/toyc.cpp | 2 | ||||
| -rw-r--r-- | mlir/examples/toy/Ch4/toyc.cpp | 2 | ||||
| -rw-r--r-- | mlir/examples/toy/Ch5/toyc.cpp | 2 | ||||
| -rw-r--r-- | mlir/examples/toy/Ch6/toyc.cpp | 2 | ||||
| -rw-r--r-- | mlir/examples/toy/Ch7/toyc.cpp | 2 |
6 files changed, 12 insertions, 0 deletions
diff --git a/mlir/examples/toy/Ch2/toyc.cpp b/mlir/examples/toy/Ch2/toyc.cpp index e6a69b92832..19def702589 100644 --- a/mlir/examples/toy/Ch2/toyc.cpp +++ b/mlir/examples/toy/Ch2/toyc.cpp @@ -85,6 +85,8 @@ int dumpMLIR() { if (inputType != InputType::MLIR && !llvm::StringRef(inputFilename).endswith(".mlir")) { auto moduleAST = parseInputFile(inputFilename); + if (!moduleAST) + return 6; mlir::OwningModuleRef module = mlirGen(context, *moduleAST); if (!module) return 1; diff --git a/mlir/examples/toy/Ch3/toyc.cpp b/mlir/examples/toy/Ch3/toyc.cpp index d3bb5d1a160..410a9d677e8 100644 --- a/mlir/examples/toy/Ch3/toyc.cpp +++ b/mlir/examples/toy/Ch3/toyc.cpp @@ -85,6 +85,8 @@ int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context, if (inputType != InputType::MLIR && !llvm::StringRef(inputFilename).endswith(".mlir")) { auto moduleAST = parseInputFile(inputFilename); + if (!moduleAST) + return 6; module = mlirGen(context, *moduleAST); return !module ? 1 : 0; } diff --git a/mlir/examples/toy/Ch4/toyc.cpp b/mlir/examples/toy/Ch4/toyc.cpp index a9f597dc032..5ec514ac5b9 100644 --- a/mlir/examples/toy/Ch4/toyc.cpp +++ b/mlir/examples/toy/Ch4/toyc.cpp @@ -86,6 +86,8 @@ int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context, if (inputType != InputType::MLIR && !llvm::StringRef(inputFilename).endswith(".mlir")) { auto moduleAST = parseInputFile(inputFilename); + if (!moduleAST) + return 6; module = mlirGen(context, *moduleAST); return !module ? 1 : 0; } diff --git a/mlir/examples/toy/Ch5/toyc.cpp b/mlir/examples/toy/Ch5/toyc.cpp index 57fb1a95c94..e1ab8c0ce55 100644 --- a/mlir/examples/toy/Ch5/toyc.cpp +++ b/mlir/examples/toy/Ch5/toyc.cpp @@ -88,6 +88,8 @@ int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context, if (inputType != InputType::MLIR && !llvm::StringRef(inputFilename).endswith(".mlir")) { auto moduleAST = parseInputFile(inputFilename); + if (!moduleAST) + return 6; module = mlirGen(context, *moduleAST); return !module ? 1 : 0; } diff --git a/mlir/examples/toy/Ch6/toyc.cpp b/mlir/examples/toy/Ch6/toyc.cpp index fb7cd5493a2..60e3d0f9791 100644 --- a/mlir/examples/toy/Ch6/toyc.cpp +++ b/mlir/examples/toy/Ch6/toyc.cpp @@ -106,6 +106,8 @@ int loadMLIR(mlir::MLIRContext &context, mlir::OwningModuleRef &module) { if (inputType != InputType::MLIR && !llvm::StringRef(inputFilename).endswith(".mlir")) { auto moduleAST = parseInputFile(inputFilename); + if (!moduleAST) + return 6; module = mlirGen(context, *moduleAST); return !module ? 1 : 0; } diff --git a/mlir/examples/toy/Ch7/toyc.cpp b/mlir/examples/toy/Ch7/toyc.cpp index 26b684cbe2a..ec5a4f8056b 100644 --- a/mlir/examples/toy/Ch7/toyc.cpp +++ b/mlir/examples/toy/Ch7/toyc.cpp @@ -106,6 +106,8 @@ int loadMLIR(mlir::MLIRContext &context, mlir::OwningModuleRef &module) { if (inputType != InputType::MLIR && !llvm::StringRef(inputFilename).endswith(".mlir")) { auto moduleAST = parseInputFile(inputFilename); + if (!moduleAST) + return 6; module = mlirGen(context, *moduleAST); return !module ? 1 : 0; } |

