diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -350,7 +350,7 @@ "lto-embed-bitcode", cl::init(false), cl::desc("Embed LLVM bitcode in object files produced by LTO")); -static void EmitBitcodeSection(Module &M, const Config &Conf) { +static void EmitBitcodeSection(Module &M) { if (!EmbedBitcode) return; SmallVector Buffer; @@ -359,7 +359,7 @@ std::unique_ptr Buf( new SmallVectorMemoryBuffer(std::move(Buffer))); - llvm::EmbedBitcodeInModule(M, Buf->getMemBufferRef(), /*EmbedBitcode*/ true, + llvm::EmbedBitcodeInModule(M, llvm::MemoryBufferRef(), /*EmbedBitcode*/ true, /*EmbedMarker*/ false, /*CmdArgs*/ nullptr); } @@ -369,7 +369,7 @@ if (Conf.PreCodeGenModuleHook && !Conf.PreCodeGenModuleHook(Task, Mod)) return; - EmitBitcodeSection(Mod, Conf); + EmitBitcodeSection(Mod); std::unique_ptr DwoOut; SmallString<1024> DwoFile(Conf.SplitDwarfOutput);