Browse Source

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
Fangrui Song 6 years ago
parent
commit
231854d01b

+ 2 - 2
lib/ARCMigrate/FileRemapper.cpp

@@ -121,7 +121,7 @@ bool FileRemapper::flushToFile(StringRef outputPath, DiagnosticsEngine &Diag) {
 
 
   std::error_code EC;
   std::error_code EC;
   std::string infoFile = outputPath;
   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)
   if (EC)
     return report(EC.message(), Diag);
     return report(EC.message(), Diag);
 
 
@@ -177,7 +177,7 @@ bool FileRemapper::overwriteOriginal(DiagnosticsEngine &Diag,
                     Diag);
                     Diag);
 
 
     std::error_code EC;
     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)
     if (EC)
       return report(EC.message(), Diag);
       return report(EC.message(), Diag);
 
 

+ 1 - 1
lib/ARCMigrate/ObjCMT.cpp

@@ -1951,7 +1951,7 @@ void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) {
 
 
  if (IsOutputFile) {
  if (IsOutputFile) {
    std::error_code EC;
    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) {
    if (EC) {
       DiagnosticsEngine &Diags = Ctx.getDiagnostics();
       DiagnosticsEngine &Diags = Ctx.getDiagnostics();
       Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0"))
       Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0"))

+ 1 - 1
lib/ARCMigrate/PlistReporter.cpp

@@ -56,7 +56,7 @@ void arcmt::writeARCDiagsToPlist(const std::string &outPath,
   }
   }
 
 
   std::error_code EC;
   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) {
   if (EC) {
     llvm::errs() << "error: could not create file: " << outPath << '\n';
     llvm::errs() << "error: could not create file: " << outPath << '\n';
     return;
     return;

+ 1 - 1
lib/CodeGen/BackendUtil.cpp

@@ -119,7 +119,7 @@ class EmitAssemblyHelper {
   std::unique_ptr<llvm::ToolOutputFile> openOutputFile(StringRef Path) {
   std::unique_ptr<llvm::ToolOutputFile> openOutputFile(StringRef Path) {
     std::error_code EC;
     std::error_code EC;
     auto F = llvm::make_unique<llvm::ToolOutputFile>(Path, EC,
     auto F = llvm::make_unique<llvm::ToolOutputFile>(Path, EC,
-                                                     llvm::sys::fs::F_None);
+                                                     llvm::sys::fs::OF_None);
     if (EC) {
     if (EC) {
       Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message();
       Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message();
       F.reset();
       F.reset();

+ 1 - 1
lib/Driver/Compilation.cpp

@@ -161,7 +161,7 @@ int Compilation::ExecuteCommand(const Command &C,
       std::error_code EC;
       std::error_code EC;
       OwnedStream.reset(new llvm::raw_fd_ostream(
       OwnedStream.reset(new llvm::raw_fd_ostream(
           getDriver().CCPrintOptionsFilename, EC,
           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) {
       if (EC) {
         getDriver().Diag(diag::err_drv_cc_print_options_failure)
         getDriver().Diag(diag::err_drv_cc_print_options_failure)
             << EC.message();
             << EC.message();

+ 2 - 1
lib/Driver/ToolChains/Clang.cpp

@@ -1995,7 +1995,8 @@ void Clang::DumpCompilationDatabase(Compilation &C, StringRef Filename,
 
 
   if (!CompilationDatabase) {
   if (!CompilationDatabase) {
     std::error_code EC;
     std::error_code EC;
-    auto File = llvm::make_unique<llvm::raw_fd_ostream>(Filename, EC, llvm::sys::fs::F_Text);
+    auto File = llvm::make_unique<llvm::raw_fd_ostream>(Filename, EC,
+                                                        llvm::sys::fs::OF_Text);
     if (EC) {
     if (EC) {
       D.Diag(clang::diag::err_drv_compilationdatabase) << Filename
       D.Diag(clang::diag::err_drv_compilationdatabase) << Filename
                                                        << EC.message();
                                                        << EC.message();

+ 2 - 2
lib/Driver/ToolChains/CommonArgs.cpp

@@ -1350,7 +1350,7 @@ void tools::AddOpenMPLinkerScript(const ToolChain &TC, Compilation &C,
 
 
   // Open script file and write the contents.
   // Open script file and write the contents.
   std::error_code EC;
   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) {
   if (EC) {
     C.getDriver().Diag(clang::diag::err_unable_to_make_temp) << EC.message();
     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.
   // Open script file and write the contents.
   std::error_code EC;
   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) {
   if (EC) {
     C.getDriver().Diag(clang::diag::err_unable_to_make_temp) << EC.message();
     C.getDriver().Diag(clang::diag::err_unable_to_make_temp) << EC.message();

+ 5 - 5
lib/Frontend/CompilerInstance.cpp

@@ -216,7 +216,7 @@ static void SetUpDiagnosticLog(DiagnosticOptions *DiagOpts,
     // Create the output stream.
     // Create the output stream.
     auto FileOS = llvm::make_unique<llvm::raw_fd_ostream>(
     auto FileOS = llvm::make_unique<llvm::raw_fd_ostream>(
         DiagOpts->DiagnosticLogFile, EC,
         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) {
     if (EC) {
       Diags.Report(diag::warn_fe_cc_log_diagnostics_failure)
       Diags.Report(diag::warn_fe_cc_log_diagnostics_failure)
           << DiagOpts->DiagnosticLogFile << EC.message();
           << DiagOpts->DiagnosticLogFile << EC.message();
@@ -775,7 +775,7 @@ std::unique_ptr<llvm::raw_pwrite_stream> CompilerInstance::createOutputFile(
     OSFile = OutFile;
     OSFile = OutFile;
     OS.reset(new llvm::raw_fd_ostream(
     OS.reset(new llvm::raw_fd_ostream(
         OSFile, Error,
         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)
     if (Error)
       return nullptr;
       return nullptr;
   }
   }
@@ -987,8 +987,8 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
   StringRef StatsFile = getFrontendOpts().StatsFile;
   StringRef StatsFile = getFrontendOpts().StatsFile;
   if (!StatsFile.empty()) {
   if (!StatsFile.empty()) {
     std::error_code EC;
     std::error_code EC;
-    auto StatS = llvm::make_unique<llvm::raw_fd_ostream>(StatsFile, EC,
-                                                         llvm::sys::fs::F_Text);
+    auto StatS = llvm::make_unique<llvm::raw_fd_ostream>(
+        StatsFile, EC, llvm::sys::fs::OF_Text);
     if (EC) {
     if (EC) {
       getDiagnostics().Report(diag::warn_fe_unable_to_open_stats_file)
       getDiagnostics().Report(diag::warn_fe_unable_to_open_stats_file)
           << StatsFile << EC.message();
           << StatsFile << EC.message();
@@ -1370,7 +1370,7 @@ static void checkConfigMacro(Preprocessor &PP, StringRef ConfigMacro,
 /// Write a new timestamp file with the given path.
 /// Write a new timestamp file with the given path.
 static void writeTimestampFile(StringRef TimestampFile) {
 static void writeTimestampFile(StringRef TimestampFile) {
   std::error_code EC;
   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
 /// Prune the module cache of modules that haven't been accessed in

+ 1 - 1
lib/Frontend/DependencyFile.cpp

@@ -316,7 +316,7 @@ void DependencyFileGenerator::outputDependencyFile(DiagnosticsEngine &Diags) {
   }
   }
 
 
   std::error_code EC;
   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) {
   if (EC) {
     Diags.Report(diag::err_fe_error_opening) << OutputFile << EC.message();
     Diags.Report(diag::err_fe_error_opening) << OutputFile << EC.message();
     return;
     return;

+ 1 - 1
lib/Frontend/DependencyGraph.cpp

@@ -100,7 +100,7 @@ DependencyGraphCallback::writeNodeReference(raw_ostream &OS,
 
 
 void DependencyGraphCallback::OutputGraphFile() {
 void DependencyGraphCallback::OutputGraphFile() {
   std::error_code EC;
   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) {
   if (EC) {
     PP->getDiagnostics().Report(diag::err_fe_error_opening) << OutputFile
     PP->getDiagnostics().Report(diag::err_fe_error_opening) << OutputFile
                                                             << EC.message();
                                                             << EC.message();

+ 1 - 1
lib/Frontend/FrontendActions.cpp

@@ -695,7 +695,7 @@ void DumpModuleInfoAction::ExecuteAction() {
   if (!OutputFileName.empty() && OutputFileName != "-") {
   if (!OutputFileName.empty() && OutputFileName != "-") {
     std::error_code EC;
     std::error_code EC;
     OutFile.reset(new llvm::raw_fd_ostream(OutputFileName.str(), 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();
   llvm::raw_ostream &Out = OutFile.get()? *OutFile.get() : llvm::outs();
 
 

+ 2 - 1
lib/Frontend/HeaderIncludeGen.cpp

@@ -100,7 +100,8 @@ void clang::AttachHeaderIncludeGen(Preprocessor &PP,
   if (!OutputPath.empty()) {
   if (!OutputPath.empty()) {
     std::error_code EC;
     std::error_code EC;
     llvm::raw_fd_ostream *OS = new llvm::raw_fd_ostream(
     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) {
     if (EC) {
       PP.getDiagnostics().Report(clang::diag::warn_fe_cc_print_header_failure)
       PP.getDiagnostics().Report(clang::diag::warn_fe_cc_print_header_failure)
           << EC.message();
           << EC.message();

+ 1 - 1
lib/Frontend/ModuleDependencyCollector.cpp

@@ -148,7 +148,7 @@ void ModuleDependencyCollector::writeFileMap() {
   std::error_code EC;
   std::error_code EC;
   SmallString<256> YAMLPath = VFSDir;
   SmallString<256> YAMLPath = VFSDir;
   llvm::sys::path::append(YAMLPath, "vfs.yaml");
   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) {
   if (EC) {
     HasErrors = true;
     HasErrors = true;
     return;
     return;

+ 1 - 1
lib/Frontend/Rewrite/FixItRewriter.cpp

@@ -101,7 +101,7 @@ bool FixItRewriter::WriteFixedFiles(
     if (fd != -1) {
     if (fd != -1) {
       OS.reset(new llvm::raw_fd_ostream(fd, /*shouldClose=*/true));
       OS.reset(new llvm::raw_fd_ostream(fd, /*shouldClose=*/true));
     } else {
     } 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) {
     if (EC) {
       Diags.Report(clang::diag::err_fe_unable_to_open_output) << Filename
       Diags.Report(clang::diag::err_fe_unable_to_open_output) << Filename

+ 1 - 1
lib/Frontend/SerializedDiagnosticPrinter.cpp

@@ -781,7 +781,7 @@ void SDiagsWriter::finish() {
 
 
   std::error_code EC;
   std::error_code EC;
   auto OS = llvm::make_unique<llvm::raw_fd_ostream>(State->OutputFile.c_str(),
   auto OS = llvm::make_unique<llvm::raw_fd_ostream>(State->OutputFile.c_str(),
-                                                    EC, llvm::sys::fs::F_None);
+                                                    EC, llvm::sys::fs::OF_None);
   if (EC) {
   if (EC) {
     getMetaDiags()->Report(diag::warn_fe_serialized_diag_failure)
     getMetaDiags()->Report(diag::warn_fe_serialized_diag_failure)
         << State->OutputFile << EC.message();
         << State->OutputFile << EC.message();

+ 1 - 1
lib/Serialization/ASTReader.cpp

@@ -4042,7 +4042,7 @@ static void updateModuleTimestamp(ModuleFile &MF) {
   // Overwrite the timestamp file contents so that file's mtime changes.
   // Overwrite the timestamp file contents so that file's mtime changes.
   std::string TimestampFilename = MF.getTimestampFilename();
   std::string TimestampFilename = MF.getTimestampFilename();
   std::error_code EC;
   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)
   if (EC)
     return;
     return;
   OS << "Timestamp file\n";
   OS << "Timestamp file\n";

+ 1 - 1
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp

@@ -599,7 +599,7 @@ void PlistDiagnostics::FlushDiagnosticsImpl(
 
 
   // Open the file.
   // Open the file.
   std::error_code EC;
   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) {
   if (EC) {
     llvm::errs() << "warning: could not create file: " << EC.message() << '\n';
     llvm::errs() << "warning: could not create file: " << EC.message() << '\n';
     return;
     return;

+ 1 - 1
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
   // file can become large very quickly, so decoding into JSON to append a run
   // may be an expensive operation.
   // may be an expensive operation.
   std::error_code EC;
   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) {
   if (EC) {
     llvm::errs() << "warning: could not create file: " << EC.message() << '\n';
     llvm::errs() << "warning: could not create file: " << EC.message() << '\n';
     return;
     return;

+ 5 - 5
tools/clang-offload-bundler/ClangOffloadBundler.cpp

@@ -559,7 +559,7 @@ public:
       // Write the bitcode contents to the temporary file.
       // Write the bitcode contents to the temporary file.
       {
       {
         std::error_code EC;
         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) {
         if (EC) {
           errs() << "error: unable to open temporary file.\n";
           errs() << "error: unable to open temporary file.\n";
           return true;
           return true;
@@ -764,7 +764,7 @@ static bool BundleFiles() {
   std::error_code EC;
   std::error_code EC;
 
 
   // Create output file.
   // 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) {
   if (EC) {
     errs() << "error: Can't open file " << OutputFileNames.front() << ".\n";
     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.
     // Check if the output file can be opened and copy the bundle to it.
     std::error_code EC;
     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) {
     if (EC) {
       errs() << "error: Can't open file " << Output->second << ": "
       errs() << "error: Can't open file " << Output->second << ": "
              << EC.message() << "\n";
              << EC.message() << "\n";
@@ -882,7 +882,7 @@ static bool UnbundleFiles() {
   if (Worklist.size() == TargetNames.size()) {
   if (Worklist.size() == TargetNames.size()) {
     for (auto &E : Worklist) {
     for (auto &E : Worklist) {
       std::error_code EC;
       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) {
       if (EC) {
         errs() << "error: Can't open file " << E.second << ": " << EC.message()
         errs() << "error: Can't open file " << E.second << ": " << EC.message()
                << "\n";
                << "\n";
@@ -905,7 +905,7 @@ static bool UnbundleFiles() {
   // If we still have any elements in the worklist, create empty files for them.
   // If we still have any elements in the worklist, create empty files for them.
   for (auto &E : Worklist) {
   for (auto &E : Worklist) {
     std::error_code EC;
     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) {
     if (EC) {
       errs() << "error: Can't open file " << E.second << ": "  << EC.message()
       errs() << "error: Can't open file " << E.second << ": "  << EC.message()
              << "\n";
              << "\n";

+ 1 - 1
tools/clang-refactor/ClangRefactor.cpp

@@ -497,7 +497,7 @@ public:
 
 
       if (opts::Inplace) {
       if (opts::Inplace) {
         std::error_code EC;
         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) {
         if (EC) {
           llvm::errs() << EC.message() << "\n";
           llvm::errs() << EC.message() << "\n";
           return true;
           return true;

+ 1 - 1
tools/clang-rename/ClangRename.cpp

@@ -188,7 +188,7 @@ int main(int argc, const char **argv) {
 
 
     if (!ExportFixes.empty()) {
     if (!ExportFixes.empty()) {
       std::error_code EC;
       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) {
       if (EC) {
         llvm::errs() << "Error opening output file: " << EC.message() << '\n';
         llvm::errs() << "Error opening output file: " << EC.message() << '\n';
         return 1;
         return 1;

+ 1 - 1
tools/driver/cc1as_main.cpp

@@ -313,7 +313,7 @@ getOutputStream(StringRef Path, DiagnosticsEngine &Diags, bool Binary) {
 
 
   std::error_code EC;
   std::error_code EC;
   auto Out = llvm::make_unique<raw_fd_ostream>(
   auto Out = llvm::make_unique<raw_fd_ostream>(
-      Path, EC, (Binary ? sys::fs::F_None : sys::fs::F_Text));
+      Path, EC, (Binary ? sys::fs::OF_None : sys::fs::OF_Text));
   if (EC) {
   if (EC) {
     Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message();
     Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message();
     return nullptr;
     return nullptr;