[llvm] r330364 - [llvm-objdump] Issue error message when object file cannot be created
Gerolf Hoflehner via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 19 13:48:35 PDT 2018
Author: ghoflehner
Date: Thu Apr 19 13:48:35 2018
New Revision: 330364
URL: http://llvm.org/viewvc/llvm-project?rev=330364&view=rev
Log:
[llvm-objdump] Issue error message when object file cannot be created
Modified:
llvm/trunk/tools/llvm-objdump/MachODump.cpp
Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=330364&r1=330363&r2=330364&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Thu Apr 19 13:48:35 2018
@@ -6945,10 +6945,12 @@ static void DisassembleMachO(StringRef F
errs() << "llvm-objdump: " << Filename << ": " << EC.message() << '\n';
return;
}
- DbgObj =
- ObjectFile::createMachOObjectFile(BufOrErr.get()->getMemBufferRef())
- .get()
- .release();
+ Expected<std::unique_ptr<MachOObjectFile>> DbgObjCheck =
+ ObjectFile::createMachOObjectFile(BufOrErr.get()->getMemBufferRef());
+
+ if (DbgObjCheck.takeError())
+ report_error(MachOOF->getFileName(), DbgObjCheck.takeError());
+ DbgObj = DbgObjCheck.get().release();
}
// Setup the DIContext
More information about the llvm-commits
mailing list