summaryrefslogtreecommitdiff
path: root/include/llvm/Bitcode/ReaderWriter.h
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-13 18:31:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-13 18:31:04 +0000
commit99c7fec2c94bd44fd16ba50340896287438e6a0e (patch)
tree22f3840ee88db8e6fcb0dd28c768c11464cd88a5 /include/llvm/Bitcode/ReaderWriter.h
parent36713c2c0a9e4aeebe4cae4ef5efbc13d4103850 (diff)
downloadllvm-99c7fec2c94bd44fd16ba50340896287438e6a0e.tar.gz
llvm-99c7fec2c94bd44fd16ba50340896287438e6a0e.tar.bz2
llvm-99c7fec2c94bd44fd16ba50340896287438e6a0e.tar.xz
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
Diffstat (limited to 'include/llvm/Bitcode/ReaderWriter.h')
-rw-r--r--include/llvm/Bitcode/ReaderWriter.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/include/llvm/Bitcode/ReaderWriter.h b/include/llvm/Bitcode/ReaderWriter.h
index 134d49a122..3a6b205055 100644
--- a/include/llvm/Bitcode/ReaderWriter.h
+++ b/include/llvm/Bitcode/ReaderWriter.h
@@ -14,6 +14,7 @@
#ifndef LLVM_BITCODE_READERWRITER_H
#define LLVM_BITCODE_READERWRITER_H
+#include "llvm/Support/ErrorOr.h"
#include <string>
namespace llvm {
@@ -25,14 +26,11 @@ namespace llvm {
class ModulePass;
class raw_ostream;
- /// getLazyBitcodeModule - Read the header of the specified bitcode buffer
- /// and prepare for lazy deserialization of function bodies. If successful,
- /// this takes ownership of 'buffer' and returns a non-null pointer. On
- /// error, this returns null, *does not* take ownership of Buffer, and fills
- /// in *ErrMsg with an error description if ErrMsg is non-null.
- Module *getLazyBitcodeModule(MemoryBuffer *Buffer,
- LLVMContext &Context,
- std::string *ErrMsg = 0);
+ /// Read the header of the specified bitcode buffer and prepare for lazy
+ /// deserialization of function bodies. If successful, this takes ownership
+ /// of 'buffer. On error, this *does not* take ownership of Buffer.
+ ErrorOr<Module *> getLazyBitcodeModule(MemoryBuffer *Buffer,
+ LLVMContext &Context);
/// getStreamedBitcodeModule - Read the header of the specified stream
/// and prepare for lazy deserialization and streaming of function bodies.