summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Bitcode/BitReaderTest.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-11-13 07:00:17 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-11-13 07:00:17 +0000
commitd9445c49ad47c227f5981ad1f8f211dff9aaa9f1 (patch)
tree81677338f0d0d86208f35bc7cf3acbc898999a71 /llvm/unittests/Bitcode/BitReaderTest.cpp
parent8dff03911c5efa7a3abd6fb43f09233758075b20 (diff)
downloadbcm5719-llvm-d9445c49ad47c227f5981ad1f8f211dff9aaa9f1.tar.gz
bcm5719-llvm-d9445c49ad47c227f5981ad1f8f211dff9aaa9f1.zip
Bitcode: Change module reader functions to return an llvm::Expected.
Differential Revision: https://reviews.llvm.org/D26562 llvm-svn: 286752
Diffstat (limited to 'llvm/unittests/Bitcode/BitReaderTest.cpp')
-rw-r--r--llvm/unittests/Bitcode/BitReaderTest.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/unittests/Bitcode/BitReaderTest.cpp b/llvm/unittests/Bitcode/BitReaderTest.cpp
index 56bcc725f11..0003a2b6fb8 100644
--- a/llvm/unittests/Bitcode/BitReaderTest.cpp
+++ b/llvm/unittests/Bitcode/BitReaderTest.cpp
@@ -55,8 +55,10 @@ static std::unique_ptr<Module> getLazyModuleFromAssembly(LLVMContext &Context,
SmallString<1024> &Mem,
const char *Assembly) {
writeModuleToBuffer(parseAssembly(Context, Assembly), Mem);
- ErrorOr<std::unique_ptr<Module>> ModuleOrErr =
+ Expected<std::unique_ptr<Module>> ModuleOrErr =
getLazyBitcodeModule(MemoryBufferRef(Mem.str(), "test"), Context);
+ if (!ModuleOrErr)
+ report_fatal_error("Could not parse bitcode module");
return std::move(ModuleOrErr.get());
}
OpenPOWER on IntegriCloud