Pass a std::unique_ptr<MemoryBuffer>& to getLazyBitcodeModule.

By taking a reference we can do the ownership transfer in one place instead of
expecting every caller to do it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-08-26 22:00:09 +00:00
parent 2292996e1a
commit fb1af0a48a
8 changed files with 22 additions and 22 deletions

View File

@@ -16,6 +16,7 @@
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/MemoryBuffer.h"
#include <memory>
#include <string>
namespace llvm {
@@ -29,7 +30,7 @@ namespace llvm {
/// 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,
ErrorOr<Module *> getLazyBitcodeModule(std::unique_ptr<MemoryBuffer> &Buffer,
LLVMContext &Context);
/// getStreamedBitcodeModule - Read the header of the specified stream