This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Change the default of `mlir-print-op-on-diagnostic` to true
ClosedPublic

Authored by rriddle on Mar 30 2020, 2:47 PM.

Details

Summary

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.

Diff Detail

Event Timeline

rriddle created this revision.Mar 30 2020, 2:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2020, 2:47 PM
mehdi_amini added inline comments.Mar 30 2020, 2:55 PM
mlir/lib/IR/MLIRContext.cpp
55

Can we avoid cl::opt here and push it to clients? (trying to avoid more global constructor / global state)

rriddle marked 2 inline comments as done.Mar 30 2020, 3:23 PM
rriddle added inline comments.
mlir/lib/IR/MLIRContext.cpp
55

This is the same situation that we are already in. Moving to clients will require more churn on a currently simple revision. I'd rather defer that for a followup.

mehdi_amini accepted this revision.Mar 30 2020, 6:45 PM
This revision is now accepted and ready to land.Mar 30 2020, 6:45 PM
rriddle updated this revision to Diff 254979.Apr 3 2020, 7:01 PM
rriddle marked an inline comment as done.

Rebase

This revision was automatically updated to reflect the committed changes.