[PATCH] D73793: Improve error message of FileCheck when stdin is empty

Dave Bozier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 07:24:55 PST 2020


davidb added a comment.

In D73793#1854135 <https://reviews.llvm.org/D73793#1854135>, @jhenderson wrote:

> I have a vague and probably unreasonable concern that changing from the beahviour for a filename "<stdin>" could cause somebody some confusion somewhere, since it's non-standard. I do agree with changing the error message though (we do similar things already in other tools, IIRC). What are others' thoughts?


The initial change would never treat `<stdin>` as a  file name, it would special case this on open and use the correct `-` value. We only try to open a file once, but use the filename in multiple places, hence this to me was the simplest way to achieve this.

I've updated the diff based on the review comments, which changes the name of the file after opening. I like this less as it changes the state, and in my opinion just as confusing, if not a bit more vulnerable... However I also recognise that the size of this file is small, it appears to be reasonably tested, and I am not likely to be making many more changes to this file in the immediate future, so I can tolerate this.


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