mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-29 14:40:39 +00:00
emit a specific error when the input file is empty. This fixes
an annoyance of mine when working on tests: if the input .ll file is broken, opt outputs an error and generates an empty file. FileCheck then emits its "ooh I couldn't find the first CHECK line, scanning from ..." which obfuscates the actual problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125193 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
66298c104e
commit
1aac1864cf
@ -659,6 +659,11 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
MemoryBuffer *F = File.take();
|
||||
|
||||
if (F->getBufferSize() == 0) {
|
||||
errs() << "FileCheck error: '" << InputFilename << "' is empty.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Remove duplicate spaces in the input file if requested.
|
||||
if (!NoCanonicalizeWhiteSpace)
|
||||
F = CanonicalizeInputFile(F);
|
||||
|
Loading…
Reference in New Issue
Block a user