Index: include/llvm/LTO/LTO.h =================================================================== --- include/llvm/LTO/LTO.h +++ include/llvm/LTO/LTO.h @@ -368,8 +368,6 @@ // Global mapping from mangled symbol names to resolutions. StringMap GlobalResolutions; - void writeToResolutionFile(InputFile *Input, ArrayRef Res); - void addSymbolToGlobalRes(object::IRObjectFile *Obj, SmallPtrSet &Used, const InputFile::Symbol &Sym, SymbolResolution Res, Index: lib/LTO/LTO.cpp =================================================================== --- lib/LTO/LTO.cpp +++ lib/LTO/LTO.cpp @@ -257,23 +257,23 @@ GlobalRes.Partition = Partition; } -void LTO::writeToResolutionFile(InputFile *Input, - ArrayRef Res) { - StringRef Path = Input->Obj->getMemoryBufferRef().getBufferIdentifier(); - *Conf.ResolutionFile << Path << '\n'; +static void writeToResolutionFile(raw_ostream &OS, InputFile *Input, + ArrayRef Res) { + StringRef Path = Input->getMemoryBufferRef().getBufferIdentifier(); + OS << Path << '\n'; auto ResI = Res.begin(); for (const InputFile::Symbol &Sym : Input->symbols()) { assert(ResI != Res.end()); SymbolResolution Res = *ResI++; - *Conf.ResolutionFile << "-r=" << Path << ',' << Sym.getName() << ','; + OS << "-r=" << Path << ',' << Sym.getName() << ','; if (Res.Prevailing) - *Conf.ResolutionFile << 'p'; + OS << 'p'; if (Res.FinalDefinitionInLinkageUnit) - *Conf.ResolutionFile << 'l'; + OS << 'l'; if (Res.VisibleToRegularObj) - *Conf.ResolutionFile << 'x'; - *Conf.ResolutionFile << '\n'; + OS << 'x'; + OS << '\n'; } assert(ResI == Res.end()); } @@ -283,7 +283,7 @@ assert(!CalledGetMaxTasks); if (Conf.ResolutionFile) - writeToResolutionFile(Input.get(), Res); + writeToResolutionFile(*Conf.ResolutionFile, Input.get(), Res); // FIXME: move to backend Module &M = Input->Obj->getModule();