Pass a MemoryBufferRef when we can avoid taking ownership.
[oota-llvm.git] / lib / Bitcode / Reader / BitReader.cpp
index b5886c16fa4463a92d6bfc174cdbd3bcb87239c2..e21d29ac374da4c85ed32232ac20c9c373168a02 100644 (file)
@@ -31,7 +31,7 @@ LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
                                    LLVMModuleRef *OutModule,
                                    char **OutMessage) {
   ErrorOr<Module *> 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());