Before we just printed on stderr the program name. Now at least we
print the name of the file that doesn't exist. There's probably room
for improvement of error handling in llvm-mc (and the tools in general),
but still this is a step forward.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247518
91177308-0d34-0410-b5e6-
96231b3b80d8
// construct the Triple object.
Triple TheTriple(TripleName);
+ if (InputFilename != "-" && !sys::fs::exists(InputFilename)) {
+ errs() << ProgName << ": '" << InputFilename << "': "
+ << "No such file\n";
+ return 1;
+ }
ErrorOr<std::unique_ptr<MemoryBuffer>> BufferPtr =
MemoryBuffer::getFileOrSTDIN(InputFilename);
if (std::error_code EC = BufferPtr.getError()) {