diff options
| author | Rui Ueyama <ruiu@google.com> | 2017-06-08 23:43:44 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2017-06-08 23:43:44 +0000 |
| commit | 67aea737f3ee37fd0c39c3a59cef857dcabad231 (patch) | |
| tree | 1f59ec2a13a9df412e7dadeba61fb144c1963c03 | |
| parent | 3eedd161147c19aba2244e6fdcc2ad42f74baead (diff) | |
| download | bcm5719-llvm-67aea737f3ee37fd0c39c3a59cef857dcabad231.tar.gz bcm5719-llvm-67aea737f3ee37fd0c39c3a59cef857dcabad231.zip | |
Use check() to report an error.
llvm-svn: 305033
| -rw-r--r-- | lld/COFF/Driver.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp index fdeed289d04..27b1c48ce3e 100644 --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -456,17 +456,11 @@ static void createImportLibrary() { static void parseModuleDefs(StringRef Path) { std::unique_ptr<MemoryBuffer> MB = check( MemoryBuffer::getFile(Path, -1, false, true), "could not open " + Path); - MemoryBufferRef MBRef = MB->getMemBufferRef(); - - Expected<COFFModuleDefinition> Def = - parseCOFFModuleDefinition(MBRef, Config->Machine); - if (!Def) - fatal(errorToErrorCode(Def.takeError()).message()); + COFFModuleDefinition M = + check(parseCOFFModuleDefinition(MB->getMemBufferRef(), Config->Machine)); - COFFModuleDefinition &M = *Def; if (Config->OutputFile.empty()) Config->OutputFile = Saver.save(M.OutputFile); - if (M.ImageBase) Config->ImageBase = M.ImageBase; if (M.StackReserve) |

