diff options
author | David Bozier <daveb@graphcore.ai> | 2020-02-03 15:13:31 +0000 |
---|---|---|
committer | David Bozier <daveb@graphcore.ai> | 2020-02-04 11:14:55 +0000 |
commit | 6e01cd6795f83c09639604871cf52f5b124c1858 (patch) | |
tree | 84894aafce40cdfc7b06b9368d33ff35a9e87602 /llvm/utils/FileCheck/FileCheck.cpp | |
parent | abada5036ef2299f527ab7d28af318e0eb9f6dd3 (diff) | |
download | llvm-6e01cd6795f83c09639604871cf52f5b124c1858.zip llvm-6e01cd6795f83c09639604871cf52f5b124c1858.tar.gz llvm-6e01cd6795f83c09639604871cf52f5b124c1858.tar.bz2 |
Improve error message of FileCheck when stdin is empty
Summary: Replace '-' in the error message with <stdin>. This is also consistent with another error message in the code.
Reviewers: jhenderson, probinson, jdenny, grimar, arichardson
Reviewed By: jhenderson
Subscribers: thopre, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73793
Diffstat (limited to 'llvm/utils/FileCheck/FileCheck.cpp')
-rw-r--r-- | llvm/utils/FileCheck/FileCheck.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index 6f579135..539bc13 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -616,6 +616,8 @@ int main(int argc, char **argv) { // Open the file to check and add it to SourceMgr. ErrorOr<std::unique_ptr<MemoryBuffer>> InputFileOrErr = MemoryBuffer::getFileOrSTDIN(InputFilename); + if (InputFilename == "-") + InputFilename = "<stdin>"; // Overwrite for improved diagnostic messages if (std::error_code EC = InputFileOrErr.getError()) { errs() << "Could not open input file '" << InputFilename << "': " << EC.message() << '\n'; @@ -648,7 +650,7 @@ int main(int argc, char **argv) { (ExitCode == 1 && DumpInput == DumpInputFail)) { errs() << "\n" << "Input file: " - << (InputFilename == "-" ? "<stdin>" : InputFilename.getValue()) + << InputFilename << "\n" << "Check file: " << CheckFilename << "\n" << "\n" |