aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp')
-rw-r--r--llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
index d622c16..c409012 100644
--- a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
@@ -141,14 +141,14 @@ static void doList(opt::InputArgList& Args) {
static COFF::MachineTypes getCOFFFileMachine(MemoryBufferRef MB) {
std::error_code EC;
- object::COFFObjectFile Obj(MB, EC);
- if (EC) {
+ auto Obj = object::COFFObjectFile::create(MB);
+ if (!Obj) {
llvm::errs() << MB.getBufferIdentifier()
- << ": failed to open: " << EC.message() << '\n';
+ << ": failed to open: " << Obj.takeError() << '\n';
exit(1);
}
- uint16_t Machine = Obj.getMachine();
+ uint16_t Machine = (*Obj)->getMachine();
if (Machine != COFF::IMAGE_FILE_MACHINE_I386 &&
Machine != COFF::IMAGE_FILE_MACHINE_AMD64 &&
Machine != COFF::IMAGE_FILE_MACHINE_ARMNT &&