mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-13 08:25:27 +00:00
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:
@@ -51,8 +51,11 @@ LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
|
||||
LLVMModuleRef *OutM,
|
||||
char **OutMessage) {
|
||||
std::string Message;
|
||||
std::unique_ptr<MemoryBuffer> Owner(unwrap(MemBuf));
|
||||
|
||||
ErrorOr<Module *> ModuleOrErr =
|
||||
getLazyBitcodeModule(unwrap(MemBuf), *unwrap(ContextRef));
|
||||
getLazyBitcodeModule(Owner, *unwrap(ContextRef));
|
||||
Owner.release();
|
||||
|
||||
if (std::error_code EC = ModuleOrErr.getError()) {
|
||||
*OutM = wrap((Module *)nullptr);
|
||||
|
Reference in New Issue
Block a user