diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index b42bfbed3b873..256933d3f53f9 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -1117,10 +1117,10 @@ static std::vector, bool>> runLTO() { std::make_unique(FD, true)); }; - auto AddBuffer = [&](size_t Task, const Twine &moduleName, + auto AddBuffer = [&](size_t Task, const Twine &ModuleName, std::unique_ptr MB) { - auto Stream = *AddStream(Task, ModuleName); - Stream->OS << MB->getBuffer(); + auto Stream = AddStream(Task, ModuleName); + *Stream->OS << MB->getBuffer(); check(Stream->commit(), "Failed to commit cache"); };