]> granicus.if.org Git - clang/commitdiff
Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC
authorFangrui Song <maskray@google.com>
Mon, 5 Aug 2019 05:43:48 +0000 (05:43 +0000)
committerFangrui Song <maskray@google.com>
Mon, 5 Aug 2019 05:43:48 +0000 (05:43 +0000)
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

22 files changed:
lib/ARCMigrate/FileRemapper.cpp
lib/ARCMigrate/ObjCMT.cpp
lib/ARCMigrate/PlistReporter.cpp
lib/CodeGen/BackendUtil.cpp
lib/Driver/Compilation.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Driver/ToolChains/CommonArgs.cpp
lib/Frontend/CompilerInstance.cpp
lib/Frontend/DependencyFile.cpp
lib/Frontend/DependencyGraph.cpp
lib/Frontend/FrontendActions.cpp
lib/Frontend/HeaderIncludeGen.cpp
lib/Frontend/ModuleDependencyCollector.cpp
lib/Frontend/Rewrite/FixItRewriter.cpp
lib/Frontend/SerializedDiagnosticPrinter.cpp
lib/Serialization/ASTReader.cpp
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
tools/clang-offload-bundler/ClangOffloadBundler.cpp
tools/clang-refactor/ClangRefactor.cpp
tools/clang-rename/ClangRename.cpp
tools/driver/cc1as_main.cpp

index 70b32dc0117357c13bdd214efda7408e0bf8cd44..a031fe22ac1321daf03cbb7bedd55b51e59ba283 100644 (file)
@@ -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);
 
index fbf2a1560afbe0872a16148f217d91850d480f45..b0ffdda8b2fef3f235b6aa95a10f08e47e51540e 100644 (file)
@@ -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"))
index 6d7fcb053b4828b7d5361010e03f3bfe50a9300c..d01563b2974dde620a536ac8636475016cfaf363 100644 (file)
@@ -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;
index 84552e27a4c65f8167e016c74258c702b00daed5..60ce5174a12a3a47160166cd003994d078d44b53 100644 (file)
@@ -119,7 +119,7 @@ class EmitAssemblyHelper {
   std::unique_ptr<llvm::ToolOutputFile> openOutputFile(StringRef Path) {
     std::error_code EC;
     auto F = llvm::make_unique<llvm::ToolOutputFile>(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();
index 5f3026e6ce508b143318f814bcd6a1fc405bc62b..ba188f5c4083c79b30169f04db7e673021142a09 100644 (file)
@@ -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();
index 60062d5c3277483a500f03a4a5a30b8cac3e85f9..4681e0138930c5b25b41139903abfdfa09b5fb67 100644 (file)
@@ -1995,7 +1995,8 @@ void Clang::DumpCompilationDatabase(Compilation &C, StringRef Filename,
 
   if (!CompilationDatabase) {
     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) {
       D.Diag(clang::diag::err_drv_compilationdatabase) << Filename
                                                        << EC.message();
index f13e7b9781d9fb78cd4c1fa2037d568b9931c64f..93b823b72e8fbd31ef19ecb22bb05cb668b11066 100644 (file)
@@ -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();
index 93715d831e61c1fdcd55a3fd6de26e3492b90052..a556f4e0df11712141ef7bd725c1038c2273aeb9 100644 (file)
@@ -216,7 +216,7 @@ static void SetUpDiagnosticLog(DiagnosticOptions *DiagOpts,
     // Create the output stream.
     auto FileOS = llvm::make_unique<llvm::raw_fd_ostream>(
         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<llvm::raw_pwrite_stream> 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<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) {
       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
index 375eb91ae3666b749b48c51c37f3dbba0f4a4e33..152fe0360f56b68fc32534b9d96afe7a23d97ed0 100644 (file)
@@ -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;
index 90624323a000acfd75e76f5eb380d79697daa1bf..a123f1c689742c2aa1351dba9145dfd4c9536e46 100644 (file)
@@ -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();
index e37afae5332a0f92edd761867ed546a846e9a621..1bea322cedce282fa63aa1053d82c671ddaff1bc 100644 (file)
@@ -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();
 
index d60f5333bf5bf7edb899b0ae88ddf4a1c6025762..821a7e2cd910d16bac9fc5133854800fdce72ca1 100644 (file)
@@ -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();
index c1d8c0d9eb24c2a95fd2cf5541cbef5af24bdbf6..4398d5f36a4add2aea7e5c69804783c9893566cd 100644 (file)
@@ -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;
index 667b9f0469f7eac8564a55a7858f24721880bc49..0217b3385a51864413e979b1fb9a05351e901ba7 100644 (file)
@@ -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
index c1434a95cc709c0920949285f3c00cddad39cd71..0732d63dfe4264062044f0ac446716b85cb33e0c 100644 (file)
@@ -781,7 +781,7 @@ void SDiagsWriter::finish() {
 
   std::error_code EC;
   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) {
     getMetaDiags()->Report(diag::warn_fe_serialized_diag_failure)
         << State->OutputFile << EC.message();
index e1b08dbc1ac8970dfd4c4d16e3cff6cc049f5fd8..4b6775de055c8df437471032b8f70e696ab1b628 100644 (file)
@@ -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";
index 15b8e0c41c3fbe3b489e0292afdae31e2844d383..d79d91679ad599b4a31f7d1f340b00ab7a924752 100644 (file)
@@ -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;
index fd6d5010db5327ded31a87d1913a84624e0e7282..f4e85b3fa8fc8081940d4a2fa11cf4f2912a4c31 100644 (file)
@@ -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;
index 0c628963a29180fc843c12353994a786051dad17..2a31f673a07069cecf219865dcc8e80af1ba98c2 100644 (file)
@@ -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";
index 68a5cce8db5afeceff58e3db009f7f273e2067d4..2e4c6480a1e890f65623602aded45355f33ea91c 100644 (file)
@@ -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;
index 613885bf759ee107c04630782e189fe875cbd426..6dcd33aeb164366389a97e3ca8f871808d5d6cea 100644 (file)
@@ -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;
index a2902b6aa926306b3769c6c3bde40b0d542a017a..390cabff0217399b105fac75bb3d2d8291cefa9b 100644 (file)
@@ -313,7 +313,7 @@ getOutputStream(StringRef Path, DiagnosticsEngine &Diags, bool Binary) {
 
   std::error_code EC;
   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) {
     Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message();
     return nullptr;