[PATCH] D73793: Improve error message of FileCheck when stdin is empty
Alexander Richardson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 3 02:54:50 PST 2020
arichardson added inline comments.
================
Comment at: llvm/utils/FileCheck/FileCheck.cpp:619
+ MemoryBuffer::getFileOrSTDIN(
+ (InputFilename == "<stdin>" ? "-" : InputFilename.getValue()));
if (std::error_code EC = InputFileOrErr.getError()) {
----------------
davidb wrote:
> I found it the least intrusive and confusing to change the InputFilename of stdin here, than in the other 3 places that the InputFilename is printed.
Instead of changing the option default to `"<stdin>`, may could you add:
```
if (InputFilename == "-")
InputFilename = "<stdin>"; // Overwrite for improved diagnostic messages
```
Just after the the getFileOrSTDIN() call?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73793/new/
https://reviews.llvm.org/D73793
More information about the llvm-commits
mailing list