[PATCH] D77095: [mlir] Change the default of `mlir-print-op-on-diagnostic` to true

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 15:17:08 PDT 2020


rriddle created this revision.
rriddle added a reviewer: mehdi_amini.
Herald added subscribers: llvm-commits, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar.
Herald added a project: LLVM.
mehdi_amini added inline comments.


================
Comment at: mlir/lib/IR/MLIRContext.cpp:55
+                   "as an attached note"));
+
 /// A utility function to safely get or create a uniqued instance within the
----------------
Can we avoid cl::opt here and push it to clients? (trying to avoid more global constructor / global state)


It is a very common user trap to think that the location printed along with the diagnostic is the same as the current operation that caused the error. This revision changes the behavior to always print the current operation, except for when diagnostics are being verified. This is achieved by moving the command line flags in IR/ to be options on the MLIRContext.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77095

Files:
  mlir/include/mlir/IR/MLIRContext.h
  mlir/lib/IR/Diagnostics.cpp
  mlir/lib/IR/MLIRContext.cpp
  mlir/lib/IR/Operation.cpp
  mlir/lib/Support/MlirOptMain.cpp
  mlir/tools/mlir-translate/mlir-translate.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77095.253708.patch
Type: text/x-patch
Size: 9028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200330/2c10d087/attachment-0001.bin>


More information about the llvm-commits mailing list