mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 23:51:56 +00:00
Use check() to report an error.
llvm-svn: 305033
This commit is contained in:
parent
3eedd16114
commit
67aea737f3
@ -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();
|
||||
COFFModuleDefinition M =
|
||||
check(parseCOFFModuleDefinition(MB->getMemBufferRef(), Config->Machine));
|
||||
|
||||
Expected<COFFModuleDefinition> Def =
|
||||
parseCOFFModuleDefinition(MBRef, Config->Machine);
|
||||
if (!Def)
|
||||
fatal(errorToErrorCode(Def.takeError()).message());
|
||||
|
||||
COFFModuleDefinition &M = *Def;
|
||||
if (Config->OutputFile.empty())
|
||||
Config->OutputFile = Saver.save(M.OutputFile);
|
||||
|
||||
if (M.ImageBase)
|
||||
Config->ImageBase = M.ImageBase;
|
||||
if (M.StackReserve)
|
||||
|
Loading…
Reference in New Issue
Block a user