From 37ed9c199ca639565f6ce88105f9e39e898d82d0 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 1 Dec 2014 14:51:49 -0800 Subject: Update aosp/master LLVM for rebase to r222494. Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d --- lib/Bitcode/Reader/BitReader.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/Bitcode/Reader/BitReader.cpp') diff --git a/lib/Bitcode/Reader/BitReader.cpp b/lib/Bitcode/Reader/BitReader.cpp index b5886c1..9b3acb5 100644 --- a/lib/Bitcode/Reader/BitReader.cpp +++ b/lib/Bitcode/Reader/BitReader.cpp @@ -31,7 +31,7 @@ LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, LLVMModuleRef *OutModule, char **OutMessage) { ErrorOr ModuleOrErr = - parseBitcodeFile(unwrap(MemBuf), *unwrap(ContextRef)); + parseBitcodeFile(unwrap(MemBuf)->getMemBufferRef(), *unwrap(ContextRef)); if (std::error_code EC = ModuleOrErr.getError()) { if (OutMessage) *OutMessage = strdup(EC.message().c_str()); @@ -51,8 +51,11 @@ LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, LLVMModuleRef *OutM, char **OutMessage) { std::string Message; + std::unique_ptr Owner(unwrap(MemBuf)); + ErrorOr ModuleOrErr = - getLazyBitcodeModule(unwrap(MemBuf), *unwrap(ContextRef)); + getLazyBitcodeModule(std::move(Owner), *unwrap(ContextRef)); + Owner.release(); if (std::error_code EC = ModuleOrErr.getError()) { *OutM = wrap((Module *)nullptr); -- cgit v1.1