This is an archive of the discontinued LLVM Phabricator instance.

Add a message to mlir-opt when reading from stdin to avoid being waiting for nothing
ClosedPublic

Authored by mehdi_amini on Mar 6 2023, 9:58 PM.

Details

Summary

It happens from time to time that one may run mlir-opt expecting something to
happen, but the process is waiting on stdin. Print a message when reading from
stdin to warn developers.

Diff Detail

Event Timeline

mehdi_amini created this revision.Mar 6 2023, 9:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2023, 9:58 PM
mehdi_amini requested review of this revision.Mar 6 2023, 9:58 PM

clang-format

Could this be done only if detected interactive session? E.g., when piping commands I'd prefer not to see this message (which is probably the majority of times when I use opt).

Detect terminal connected to stdin

rriddle accepted this revision.Mar 12 2023, 11:48 PM
rriddle added inline comments.
mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
340–343

This deserves a comment of some kind.

This revision is now accepted and ready to land.Mar 12 2023, 11:48 PM