[COFF] Use Expected in COFFObjectFile creation
authorReid Kleckner <rnk@google.com>
Fri, 8 May 2020 20:58:56 +0000 (13:58 -0700)
committerReid Kleckner <rnk@google.com>
Fri, 8 May 2020 21:22:28 +0000 (14:22 -0700)
commit39772063f513ef24729ed9f20830e887d89459b6
treec919f33d5455bc661dbeda2a1bc5c7704a63557b
parent77ecf90c52641aadedf6bad7c8bea5b217b49729
[COFF] Use Expected in COFFObjectFile creation

The constructor error out parameter was a bit awkward. Wrap it in a
factory method which can return an error. Make the constructor private.
llvm/include/llvm/Object/COFF.h
llvm/lib/Object/COFFObjectFile.cpp
llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp