[PATCH] D113715: [mlir][ods] AttrOrTypeGen uses Class

Jeff Niu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 18 13:41:16 PST 2021


Mogball marked 6 inline comments as done.
Mogball added inline comments.


================
Comment at: mlir/include/mlir/TableGen/Class.h:436-439
+inline constexpr mlir::tblgen::Method::Properties
+operator&(mlir::tblgen::Method::Properties lhs, bool rhs) {
+  return rhs ? lhs : mlir::tblgen::Method::None;
+}
----------------
rriddle wrote:
> rriddle wrote:
> > Please remove this, the code that this creates is not readable.
> In general, please avoid overloading operators like this. It creates code that is difficult to read/maintain just for the sake of saving a line or two. Prefer writing clean/readable code over "tricky" code.
Very well.

FYI I originally contemplated:

```
props |= Method::Static & ~(isStatic - 1u)
```

And so I thought that this would be "more readable" than that...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113715/new/

https://reviews.llvm.org/D113715



More information about the llvm-commits mailing list