[PATCH] D75411: [mlir][ods] Add query for derived attribute

Jacques Pienaar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 13:44:06 PST 2020


jpienaar marked 2 inline comments as done.
jpienaar added inline comments.


================
Comment at: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp:401
+  auto &body = method.body();
+  body << "  return llvm::StringSwitch<bool>(name)";
+  for (auto namedAttr : op.getAttributes())
----------------
rriddle wrote:
> nit: Can we just use llvm::is_contained instead? That would avoid bringing in StringSwitch to OperationSupport, which is included in a lot of places.
It is probably less efficient compared to the StringSwitch. But I do agree it is a smaller dependency though, and we could optimize this if it is problematic.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75411





More information about the llvm-commits mailing list