llvm-project/mlir/examples
Thomas Köppe 58369fce30 Add a helper function to convert LogicalResult to int for return from main
At present, a lot of code contains main function bodies like "return failed(mlir::MlirOptMain(...);". This is unfortunate for two reasons: a) it uses ADL, which is maybe not what the free "failed" function was designed for; and b) it is a bit awkward to read, requring the reader to both understand the boolean nature of the value and the semantics of main's return value. (And it's also not portable, since 1 is not a portable success value.)

The replacement code, `return mlir::AsMainReturnCode(mlir::MlirOptMain(...))` is a bit more self-explanatory.

The change applies the new function to a few internal uses of MlirOptMain, too.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D102641
2021-05-19 00:12:39 +00:00
..
standalone Add a helper function to convert LogicalResult to int for return from main 2021-05-19 00:12:39 +00:00
toy [mlir] Support alignment in LLVM dialect GlobalOp 2021-05-12 09:07:20 +02:00
CMakeLists.txt NFC: Delete the Linalg tutorial. 2019-10-17 14:27:37 -07:00