[PATCH] D74865: [MLIR] add show-dialects option for mlir-opt

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 10:41:41 PST 2020


rriddle accepted this revision.
rriddle added inline comments.


================
Comment at: mlir/tools/mlir-opt/mlir-opt.cpp:141
 
+  MLIRContext context;
+  if(showDialects) {
----------------
Can you please sink the context into the if you avoid unnecessarily initializing it?


================
Comment at: mlir/tools/mlir-opt/mlir-opt.cpp:144
+    llvm::outs() << "Registered Dialects:\n";
+    for(Dialect *dialect : context.getRegisteredDialects()) {
+      llvm::outs() << dialect->getNamespace() << "\n";
----------------
nit: Remove the trivial brace here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74865





More information about the llvm-commits mailing list