Index: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp =================================================================== --- clang/lib/ExtractAPI/ExtractAPIConsumer.cpp +++ clang/lib/ExtractAPI/ExtractAPIConsumer.cpp @@ -793,7 +793,7 @@ // FIXME: Make the kind of APISerializer configurable. SymbolGraphSerializer SGSerializer(*API, ProductName); SGSerializer.serialize(*OS); - OS->flush(); + OS = nullptr; } std::unique_ptr Index: clang/lib/Frontend/PrecompiledPreamble.cpp =================================================================== --- clang/lib/Frontend/PrecompiledPreamble.cpp +++ clang/lib/Frontend/PrecompiledPreamble.cpp @@ -248,7 +248,7 @@ if (FileOS) { *FileOS << Buffer->Data; // Make sure it hits disk now. - FileOS->flush(); + FileOS = nullptr; } this->HasEmittedPreamblePCH = true; Index: clang/tools/driver/cc1_main.cpp =================================================================== --- clang/tools/driver/cc1_main.cpp +++ clang/tools/driver/cc1_main.cpp @@ -260,8 +260,7 @@ Path.str(), /*Binary=*/false, /*RemoveFileOnSignal=*/false, /*useTemporary=*/false)) { llvm::timeTraceProfilerWrite(*profilerOutput); - // FIXME(ibiryukov): make profilerOutput flush in destructor instead. - profilerOutput->flush(); + profilerOutput = nullptr; llvm::timeTraceProfilerCleanup(); Clang->clearOutputFiles(false); }