[PATCH] D12846: [llvm-mc] Better error handling in ENOENT case + test
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 10:11:35 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL247582: [llvm-mc] Better error handling in ENOENT case + test. (authored by davide).
Changed prior to commit:
http://reviews.llvm.org/D12846?vs=34691&id=34695#toc
Repository:
rL LLVM
http://reviews.llvm.org/D12846
Files:
llvm/trunk/test/tools/llvm-mc/basic.test
llvm/trunk/tools/llvm-mc/llvm-mc.cpp
Index: llvm/trunk/test/tools/llvm-mc/basic.test
===================================================================
--- llvm/trunk/test/tools/llvm-mc/basic.test
+++ llvm/trunk/test/tools/llvm-mc/basic.test
@@ -0,0 +1,2 @@
+# RUN: not llvm-mc %t.blah -o %t2 2>&1 | FileCheck --check-prefix=ENOENT %s
+# ENOENT: {{.*}}.blah: {{[Nn]}}o such file or directory
Index: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
===================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp
@@ -395,15 +395,10 @@
// 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()) {
- errs() << ProgName << ": " << EC.message() << '\n';
+ errs() << InputFilename << ": " << EC.message() << '\n';
return 1;
}
MemoryBuffer *Buffer = BufferPtr->get();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12846.34695.patch
Type: text/x-patch
Size: 1161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150914/eabd82ac/attachment.bin>
More information about the llvm-commits
mailing list