[PATCH] D76903: Add a flag on the context to protect against creation of operations in unregistered dialects

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 29 15:00:39 PDT 2020


bondhugula added inline comments.


================
Comment at: mlir/tools/mlir-opt/mlir-opt.cpp:89
+    "allow-unregistered-dialect",
+    cl::desc("Allow operation for unregistered dialects"), cl::init(false));
+
----------------
mehdi_amini wrote:
> bondhugula wrote:
> > Nit: "operation for unregistered dialects" isn't really meaningful. Rephrase here and other places.
> I can’t think of anything more descriptive, please suggest an alternative if you have one
`Allow operations with no/unregistered dialects`  ?


================
Comment at: mlir/tools/mlir-opt/mlir-opt.cpp:169
+                            splitInputFile, verifyDiagnostics, verifyPasses,
+                            allowUnregisteredDialects));
 }
----------------
mehdi_amini wrote:
> bondhugula wrote:
> > `clAllowUnregisteredDialects` ?
> Is this a documented or widespread convention?
I thought it was a convention - unless folks started deviating from it. Readability-wise IMO it's a win because it's easily distinguishable as a cmd line flag, and you would in many cases want the same name with cl dropped somewhere in that pass.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76903





More information about the llvm-commits mailing list