Bitcode: Introduce a BitcodeFileContents data type. NFCI.
This data type includes the contents of a bitcode file. Right now a bitcode file can only contain modules, but a later change will add a symbol table. Differential Revision: https://reviews.llvm.org/D33969 llvm-svn: 305019
This commit is contained in:
@@ -147,16 +147,15 @@ Expected<IRSymtabFile> object::readIRSymtab(MemoryBufferRef MBRef) {
|
||||
if (!BCOrErr)
|
||||
return errorCodeToError(BCOrErr.getError());
|
||||
|
||||
Expected<std::vector<BitcodeModule>> BMsOrErr =
|
||||
getBitcodeModuleList(*BCOrErr);
|
||||
if (!BMsOrErr)
|
||||
return BMsOrErr.takeError();
|
||||
Expected<BitcodeFileContents> BFCOrErr = getBitcodeFileContents(*BCOrErr);
|
||||
if (!BFCOrErr)
|
||||
return BFCOrErr.takeError();
|
||||
|
||||
Expected<irsymtab::FileContents> FCOrErr = irsymtab::readBitcode(*BMsOrErr);
|
||||
Expected<irsymtab::FileContents> FCOrErr = irsymtab::readBitcode(*BFCOrErr);
|
||||
if (!FCOrErr)
|
||||
return FCOrErr.takeError();
|
||||
|
||||
F.Mods = std::move(*BMsOrErr);
|
||||
F.Mods = std::move(BFCOrErr->Mods);
|
||||
F.Symtab = std::move(FCOrErr->Symtab);
|
||||
F.Strtab = std::move(FCOrErr->Strtab);
|
||||
F.TheReader = std::move(FCOrErr->TheReader);
|
||||
|
||||
Reference in New Issue
Block a user