Update getLazyBitcodeModule to use ErrorOr for error handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199125 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-01-13 18:31:04 +00:00
parent 36713c2c0a
commit 99c7fec2c9
7 changed files with 41 additions and 34 deletions

View File

@ -54,8 +54,9 @@ TEST(BitReaderTest, MaterializeFunctionsForBlockAddr) { // PR11677
SmallString<1024> Mem;
writeModuleToBuffer(Mem);
MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(Mem.str(), "test", false);
std::string errMsg;
OwningPtr<Module> m(getLazyBitcodeModule(Buffer, getGlobalContext(), &errMsg));
ErrorOr<Module *> ModuleOrErr =
getLazyBitcodeModule(Buffer, getGlobalContext());
OwningPtr<Module> m(ModuleOrErr.get());
PassManager passes;
passes.add(createVerifierPass());
passes.run(*m);