[PATCH] D74143: [MLIR] Adding attribute setters generation for table gen

Alexandre Eichenberger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 11:40:07 PST 2020


AlexEichenberger marked an inline comment as done.
AlexEichenberger added inline comments.


================
Comment at: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp:393
+  FmtContext fctx;
+  fctx.withBuilder("mlir::Builder(this->getContext())");
+  auto emitAttrWithStorageType = [&](StringRef name, Attribute attr) {
----------------
rriddle wrote:
> What is the context used for?
It is used in the same context as the getters. In our case, we use this functionality in a shape inference pass. Is it at risk to vanish before a subsequent pass?


================
Comment at: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp:404
+    const auto &attr = namedAttr.attr;
+    if (! attr.isDerivedAttr()) {
+      emitAttrWithStorageType(name, attr);
----------------
rriddle wrote:
> nit: Remove the extra space, and drop the trivial braces.
done


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74143





More information about the llvm-commits mailing list