From: Fangrui Song Date: Mon, 5 Aug 2019 05:43:48 +0000 (+0000) Subject: Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=231854d01b9fb357b7334c6f799b4c9b639231b5;p=clang Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC F_{None,Text,Append} are kept for compatibility since r334221. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367800 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ARCMigrate/FileRemapper.cpp b/lib/ARCMigrate/FileRemapper.cpp index 70b32dc011..a031fe22ac 100644 --- a/lib/ARCMigrate/FileRemapper.cpp +++ b/lib/ARCMigrate/FileRemapper.cpp @@ -121,7 +121,7 @@ bool FileRemapper::flushToFile(StringRef outputPath, DiagnosticsEngine &Diag) { std::error_code EC; std::string infoFile = outputPath; - llvm::raw_fd_ostream infoOut(infoFile, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream infoOut(infoFile, EC, llvm::sys::fs::OF_None); if (EC) return report(EC.message(), Diag); @@ -177,7 +177,7 @@ bool FileRemapper::overwriteOriginal(DiagnosticsEngine &Diag, Diag); std::error_code EC; - llvm::raw_fd_ostream Out(origFE->getName(), EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream Out(origFE->getName(), EC, llvm::sys::fs::OF_None); if (EC) return report(EC.message(), Diag); diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index fbf2a1560a..b0ffdda8b2 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -1951,7 +1951,7 @@ void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) { if (IsOutputFile) { std::error_code EC; - llvm::raw_fd_ostream OS(MigrateDir, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream OS(MigrateDir, EC, llvm::sys::fs::OF_None); if (EC) { DiagnosticsEngine &Diags = Ctx.getDiagnostics(); Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0")) diff --git a/lib/ARCMigrate/PlistReporter.cpp b/lib/ARCMigrate/PlistReporter.cpp index 6d7fcb053b..d01563b297 100644 --- a/lib/ARCMigrate/PlistReporter.cpp +++ b/lib/ARCMigrate/PlistReporter.cpp @@ -56,7 +56,7 @@ void arcmt::writeARCDiagsToPlist(const std::string &outPath, } std::error_code EC; - llvm::raw_fd_ostream o(outPath, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream o(outPath, EC, llvm::sys::fs::OF_Text); if (EC) { llvm::errs() << "error: could not create file: " << outPath << '\n'; return; diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 84552e27a4..60ce5174a1 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -119,7 +119,7 @@ class EmitAssemblyHelper { std::unique_ptr openOutputFile(StringRef Path) { std::error_code EC; auto F = llvm::make_unique(Path, EC, - llvm::sys::fs::F_None); + llvm::sys::fs::OF_None); if (EC) { Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message(); F.reset(); diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp index 5f3026e6ce..ba188f5c40 100644 --- a/lib/Driver/Compilation.cpp +++ b/lib/Driver/Compilation.cpp @@ -161,7 +161,7 @@ int Compilation::ExecuteCommand(const Command &C, std::error_code EC; OwnedStream.reset(new llvm::raw_fd_ostream( getDriver().CCPrintOptionsFilename, EC, - llvm::sys::fs::F_Append | llvm::sys::fs::F_Text)); + llvm::sys::fs::OF_Append | llvm::sys::fs::OF_Text)); if (EC) { getDriver().Diag(diag::err_drv_cc_print_options_failure) << EC.message(); diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index 60062d5c32..4681e01389 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/lib/Driver/ToolChains/Clang.cpp @@ -1995,7 +1995,8 @@ void Clang::DumpCompilationDatabase(Compilation &C, StringRef Filename, if (!CompilationDatabase) { std::error_code EC; - auto File = llvm::make_unique(Filename, EC, llvm::sys::fs::F_Text); + auto File = llvm::make_unique(Filename, EC, + llvm::sys::fs::OF_Text); if (EC) { D.Diag(clang::diag::err_drv_compilationdatabase) << Filename << EC.message(); diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp index f13e7b9781..93b823b72e 100644 --- a/lib/Driver/ToolChains/CommonArgs.cpp +++ b/lib/Driver/ToolChains/CommonArgs.cpp @@ -1350,7 +1350,7 @@ void tools::AddOpenMPLinkerScript(const ToolChain &TC, Compilation &C, // Open script file and write the contents. std::error_code EC; - llvm::raw_fd_ostream Lksf(LKS, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream Lksf(LKS, EC, llvm::sys::fs::OF_None); if (EC) { C.getDriver().Diag(clang::diag::err_unable_to_make_temp) << EC.message(); @@ -1458,7 +1458,7 @@ void tools::AddHIPLinkerScript(const ToolChain &TC, Compilation &C, // Open script file and write the contents. std::error_code EC; - llvm::raw_fd_ostream Lksf(LKS, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream Lksf(LKS, EC, llvm::sys::fs::OF_None); if (EC) { C.getDriver().Diag(clang::diag::err_unable_to_make_temp) << EC.message(); diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 93715d831e..a556f4e0df 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -216,7 +216,7 @@ static void SetUpDiagnosticLog(DiagnosticOptions *DiagOpts, // Create the output stream. auto FileOS = llvm::make_unique( DiagOpts->DiagnosticLogFile, EC, - llvm::sys::fs::F_Append | llvm::sys::fs::F_Text); + llvm::sys::fs::OF_Append | llvm::sys::fs::OF_Text); if (EC) { Diags.Report(diag::warn_fe_cc_log_diagnostics_failure) << DiagOpts->DiagnosticLogFile << EC.message(); @@ -775,7 +775,7 @@ std::unique_ptr CompilerInstance::createOutputFile( OSFile = OutFile; OS.reset(new llvm::raw_fd_ostream( OSFile, Error, - (Binary ? llvm::sys::fs::F_None : llvm::sys::fs::F_Text))); + (Binary ? llvm::sys::fs::OF_None : llvm::sys::fs::OF_Text))); if (Error) return nullptr; } @@ -987,8 +987,8 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { StringRef StatsFile = getFrontendOpts().StatsFile; if (!StatsFile.empty()) { std::error_code EC; - auto StatS = llvm::make_unique(StatsFile, EC, - llvm::sys::fs::F_Text); + auto StatS = llvm::make_unique( + StatsFile, EC, llvm::sys::fs::OF_Text); if (EC) { getDiagnostics().Report(diag::warn_fe_unable_to_open_stats_file) << StatsFile << EC.message(); @@ -1370,7 +1370,7 @@ static void checkConfigMacro(Preprocessor &PP, StringRef ConfigMacro, /// Write a new timestamp file with the given path. static void writeTimestampFile(StringRef TimestampFile) { std::error_code EC; - llvm::raw_fd_ostream Out(TimestampFile.str(), EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream Out(TimestampFile.str(), EC, llvm::sys::fs::OF_None); } /// Prune the module cache of modules that haven't been accessed in diff --git a/lib/Frontend/DependencyFile.cpp b/lib/Frontend/DependencyFile.cpp index 375eb91ae3..152fe0360f 100644 --- a/lib/Frontend/DependencyFile.cpp +++ b/lib/Frontend/DependencyFile.cpp @@ -316,7 +316,7 @@ void DependencyFileGenerator::outputDependencyFile(DiagnosticsEngine &Diags) { } std::error_code EC; - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_Text); if (EC) { Diags.Report(diag::err_fe_error_opening) << OutputFile << EC.message(); return; diff --git a/lib/Frontend/DependencyGraph.cpp b/lib/Frontend/DependencyGraph.cpp index 90624323a0..a123f1c689 100644 --- a/lib/Frontend/DependencyGraph.cpp +++ b/lib/Frontend/DependencyGraph.cpp @@ -100,7 +100,7 @@ DependencyGraphCallback::writeNodeReference(raw_ostream &OS, void DependencyGraphCallback::OutputGraphFile() { std::error_code EC; - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_Text); if (EC) { PP->getDiagnostics().Report(diag::err_fe_error_opening) << OutputFile << EC.message(); diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index e37afae533..1bea322ced 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -695,7 +695,7 @@ void DumpModuleInfoAction::ExecuteAction() { if (!OutputFileName.empty() && OutputFileName != "-") { std::error_code EC; OutFile.reset(new llvm::raw_fd_ostream(OutputFileName.str(), EC, - llvm::sys::fs::F_Text)); + llvm::sys::fs::OF_Text)); } llvm::raw_ostream &Out = OutFile.get()? *OutFile.get() : llvm::outs(); diff --git a/lib/Frontend/HeaderIncludeGen.cpp b/lib/Frontend/HeaderIncludeGen.cpp index d60f5333bf..821a7e2cd9 100644 --- a/lib/Frontend/HeaderIncludeGen.cpp +++ b/lib/Frontend/HeaderIncludeGen.cpp @@ -100,7 +100,8 @@ void clang::AttachHeaderIncludeGen(Preprocessor &PP, if (!OutputPath.empty()) { std::error_code EC; llvm::raw_fd_ostream *OS = new llvm::raw_fd_ostream( - OutputPath.str(), EC, llvm::sys::fs::F_Append | llvm::sys::fs::F_Text); + OutputPath.str(), EC, + llvm::sys::fs::OF_Append | llvm::sys::fs::OF_Text); if (EC) { PP.getDiagnostics().Report(clang::diag::warn_fe_cc_print_header_failure) << EC.message(); diff --git a/lib/Frontend/ModuleDependencyCollector.cpp b/lib/Frontend/ModuleDependencyCollector.cpp index c1d8c0d9eb..4398d5f36a 100644 --- a/lib/Frontend/ModuleDependencyCollector.cpp +++ b/lib/Frontend/ModuleDependencyCollector.cpp @@ -148,7 +148,7 @@ void ModuleDependencyCollector::writeFileMap() { std::error_code EC; SmallString<256> YAMLPath = VFSDir; llvm::sys::path::append(YAMLPath, "vfs.yaml"); - llvm::raw_fd_ostream OS(YAMLPath, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(YAMLPath, EC, llvm::sys::fs::OF_Text); if (EC) { HasErrors = true; return; diff --git a/lib/Frontend/Rewrite/FixItRewriter.cpp b/lib/Frontend/Rewrite/FixItRewriter.cpp index 667b9f0469..0217b3385a 100644 --- a/lib/Frontend/Rewrite/FixItRewriter.cpp +++ b/lib/Frontend/Rewrite/FixItRewriter.cpp @@ -101,7 +101,7 @@ bool FixItRewriter::WriteFixedFiles( if (fd != -1) { OS.reset(new llvm::raw_fd_ostream(fd, /*shouldClose=*/true)); } else { - OS.reset(new llvm::raw_fd_ostream(Filename, EC, llvm::sys::fs::F_None)); + OS.reset(new llvm::raw_fd_ostream(Filename, EC, llvm::sys::fs::OF_None)); } if (EC) { Diags.Report(clang::diag::err_fe_unable_to_open_output) << Filename diff --git a/lib/Frontend/SerializedDiagnosticPrinter.cpp b/lib/Frontend/SerializedDiagnosticPrinter.cpp index c1434a95cc..0732d63dfe 100644 --- a/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -781,7 +781,7 @@ void SDiagsWriter::finish() { std::error_code EC; auto OS = llvm::make_unique(State->OutputFile.c_str(), - EC, llvm::sys::fs::F_None); + EC, llvm::sys::fs::OF_None); if (EC) { getMetaDiags()->Report(diag::warn_fe_serialized_diag_failure) << State->OutputFile << EC.message(); diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index e1b08dbc1a..4b6775de05 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -4042,7 +4042,7 @@ static void updateModuleTimestamp(ModuleFile &MF) { // Overwrite the timestamp file contents so that file's mtime changes. std::string TimestampFilename = MF.getTimestampFilename(); std::error_code EC; - llvm::raw_fd_ostream OS(TimestampFilename, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(TimestampFilename, EC, llvm::sys::fs::OF_Text); if (EC) return; OS << "Timestamp file\n"; diff --git a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp index 15b8e0c41c..d79d91679a 100644 --- a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -599,7 +599,7 @@ void PlistDiagnostics::FlushDiagnosticsImpl( // Open the file. std::error_code EC; - llvm::raw_fd_ostream o(OutputFile, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream o(OutputFile, EC, llvm::sys::fs::OF_Text); if (EC) { llvm::errs() << "warning: could not create file: " << EC.message() << '\n'; return; diff --git a/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp b/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp index fd6d5010db..f4e85b3fa8 100644 --- a/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp +++ b/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp @@ -335,7 +335,7 @@ void SarifDiagnostics::FlushDiagnosticsImpl( // file can become large very quickly, so decoding into JSON to append a run // may be an expensive operation. std::error_code EC; - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_Text); if (EC) { llvm::errs() << "warning: could not create file: " << EC.message() << '\n'; return; diff --git a/tools/clang-offload-bundler/ClangOffloadBundler.cpp b/tools/clang-offload-bundler/ClangOffloadBundler.cpp index 0c628963a2..2a31f673a0 100644 --- a/tools/clang-offload-bundler/ClangOffloadBundler.cpp +++ b/tools/clang-offload-bundler/ClangOffloadBundler.cpp @@ -559,7 +559,7 @@ public: // Write the bitcode contents to the temporary file. { std::error_code EC; - raw_fd_ostream BitcodeFile(BitcodeFileName, EC, sys::fs::F_None); + raw_fd_ostream BitcodeFile(BitcodeFileName, EC, sys::fs::OF_None); if (EC) { errs() << "error: unable to open temporary file.\n"; return true; @@ -764,7 +764,7 @@ static bool BundleFiles() { std::error_code EC; // Create output file. - raw_fd_ostream OutputFile(OutputFileNames.front(), EC, sys::fs::F_None); + raw_fd_ostream OutputFile(OutputFileNames.front(), EC, sys::fs::OF_None); if (EC) { errs() << "error: Can't open file " << OutputFileNames.front() << ".\n"; @@ -862,7 +862,7 @@ static bool UnbundleFiles() { // Check if the output file can be opened and copy the bundle to it. std::error_code EC; - raw_fd_ostream OutputFile(Output->second, EC, sys::fs::F_None); + raw_fd_ostream OutputFile(Output->second, EC, sys::fs::OF_None); if (EC) { errs() << "error: Can't open file " << Output->second << ": " << EC.message() << "\n"; @@ -882,7 +882,7 @@ static bool UnbundleFiles() { if (Worklist.size() == TargetNames.size()) { for (auto &E : Worklist) { std::error_code EC; - raw_fd_ostream OutputFile(E.second, EC, sys::fs::F_None); + raw_fd_ostream OutputFile(E.second, EC, sys::fs::OF_None); if (EC) { errs() << "error: Can't open file " << E.second << ": " << EC.message() << "\n"; @@ -905,7 +905,7 @@ static bool UnbundleFiles() { // If we still have any elements in the worklist, create empty files for them. for (auto &E : Worklist) { std::error_code EC; - raw_fd_ostream OutputFile(E.second, EC, sys::fs::F_None); + raw_fd_ostream OutputFile(E.second, EC, sys::fs::OF_None); if (EC) { errs() << "error: Can't open file " << E.second << ": " << EC.message() << "\n"; diff --git a/tools/clang-refactor/ClangRefactor.cpp b/tools/clang-refactor/ClangRefactor.cpp index 68a5cce8db..2e4c6480a1 100644 --- a/tools/clang-refactor/ClangRefactor.cpp +++ b/tools/clang-refactor/ClangRefactor.cpp @@ -497,7 +497,7 @@ public: if (opts::Inplace) { std::error_code EC; - llvm::raw_fd_ostream OS(File, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(File, EC, llvm::sys::fs::OF_Text); if (EC) { llvm::errs() << EC.message() << "\n"; return true; diff --git a/tools/clang-rename/ClangRename.cpp b/tools/clang-rename/ClangRename.cpp index 613885bf75..6dcd33aeb1 100644 --- a/tools/clang-rename/ClangRename.cpp +++ b/tools/clang-rename/ClangRename.cpp @@ -188,7 +188,7 @@ int main(int argc, const char **argv) { if (!ExportFixes.empty()) { std::error_code EC; - llvm::raw_fd_ostream OS(ExportFixes, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream OS(ExportFixes, EC, llvm::sys::fs::OF_None); if (EC) { llvm::errs() << "Error opening output file: " << EC.message() << '\n'; return 1; diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp index a2902b6aa9..390cabff02 100644 --- a/tools/driver/cc1as_main.cpp +++ b/tools/driver/cc1as_main.cpp @@ -313,7 +313,7 @@ getOutputStream(StringRef Path, DiagnosticsEngine &Diags, bool Binary) { std::error_code EC; auto Out = llvm::make_unique( - Path, EC, (Binary ? sys::fs::F_None : sys::fs::F_Text)); + Path, EC, (Binary ? sys::fs::OF_None : sys::fs::OF_Text)); if (EC) { Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message(); return nullptr;