dexonsmith created this revision.
dexonsmith added a reviewer: zturner.
Herald added subscribers: dcaballe, cota, teijeong, rdzhabarov, tatianashp, 
bmahjour, msifontes, jurahul, Kayjukh, grosul1, jvesely, Joonsoo, liufengdb, 
aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, rriddle, 
mehdi_amini, hiraditya, arichardson, emaste.
Herald added a reviewer: MaskRay.
dexonsmith requested review of this revision.
Herald added subscribers: cfe-commits, stephenneuendorffer, nicolasvasilache.
Herald added projects: clang, MLIR, LLVM.

Clean up compatibility spellings of `OF_{None,Text,Append}` missing the
initial `O` left behind by 1f67a3cba9b09636c56e2109d8a35ae96dc15782.
Seems better to use the canonical ones everywhere.

No functionality change here, just an API cleanup.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101506

Files:
  clang/lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp
  clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp
  libclc/utils/prepare-builtins.cpp
  lld/ELF/Driver.cpp
  llvm/include/llvm/Support/FileSystem.h
  llvm/lib/Analysis/CFGPrinter.cpp
  llvm/lib/Analysis/CallPrinter.cpp
  llvm/lib/Analysis/DDGPrinter.cpp
  llvm/tools/llvm-ml/llvm-ml.cpp
  mlir/lib/Support/FileUtilities.cpp

Index: mlir/lib/Support/FileUtilities.cpp
===================================================================
--- mlir/lib/Support/FileUtilities.cpp
+++ mlir/lib/Support/FileUtilities.cpp
@@ -35,7 +35,7 @@
 mlir::openOutputFile(StringRef outputFilename, std::string *errorMessage) {
   std::error_code error;
   auto result = std::make_unique<llvm::ToolOutputFile>(outputFilename, error,
-                                                       llvm::sys::fs::F_None);
+                                                       llvm::sys::fs::OF_None);
   if (error) {
     if (errorMessage)
       *errorMessage = "cannot open output file '" + outputFilename.str() +
Index: llvm/tools/llvm-ml/llvm-ml.cpp
===================================================================
--- llvm/tools/llvm-ml/llvm-ml.cpp
+++ llvm/tools/llvm-ml/llvm-ml.cpp
@@ -96,7 +96,7 @@
 
 static std::unique_ptr<ToolOutputFile> GetOutputStream(StringRef Path) {
   std::error_code EC;
-  auto Out = std::make_unique<ToolOutputFile>(Path, EC, sys::fs::F_None);
+  auto Out = std::make_unique<ToolOutputFile>(Path, EC, sys::fs::OF_None);
   if (EC) {
     WithColor::error() << EC.message() << '\n';
     return nullptr;
Index: llvm/lib/Analysis/DDGPrinter.cpp
===================================================================
--- llvm/lib/Analysis/DDGPrinter.cpp
+++ llvm/lib/Analysis/DDGPrinter.cpp
@@ -42,7 +42,7 @@
   errs() << "Writing '" << Filename << "'...";
 
   std::error_code EC;
-  raw_fd_ostream File(Filename, EC, sys::fs::F_Text);
+  raw_fd_ostream File(Filename, EC, sys::fs::OF_Text);
 
   if (!EC)
     // We only provide the constant verson of the DOTGraphTrait specialization,
Index: llvm/lib/Analysis/CallPrinter.cpp
===================================================================
--- llvm/lib/Analysis/CallPrinter.cpp
+++ llvm/lib/Analysis/CallPrinter.cpp
@@ -274,7 +274,7 @@
   errs() << "Writing '" << Filename << "'...";
 
   std::error_code EC;
-  raw_fd_ostream File(Filename, EC, sys::fs::F_Text);
+  raw_fd_ostream File(Filename, EC, sys::fs::OF_Text);
 
   CallGraph CG(M);
   CallGraphDOTInfo CFGInfo(&M, &CG, LookupBFI);
Index: llvm/lib/Analysis/CFGPrinter.cpp
===================================================================
--- llvm/lib/Analysis/CFGPrinter.cpp
+++ llvm/lib/Analysis/CFGPrinter.cpp
@@ -63,7 +63,7 @@
   errs() << "Writing '" << Filename << "'...";
 
   std::error_code EC;
-  raw_fd_ostream File(Filename, EC, sys::fs::F_Text);
+  raw_fd_ostream File(Filename, EC, sys::fs::OF_Text);
 
   DOTFuncInfo CFGInfo(&F, BFI, BPI, MaxFreq);
   CFGInfo.setHeatColors(ShowHeatColors);
Index: llvm/include/llvm/Support/FileSystem.h
===================================================================
--- llvm/include/llvm/Support/FileSystem.h
+++ llvm/include/llvm/Support/FileSystem.h
@@ -755,12 +755,10 @@
 
 enum OpenFlags : unsigned {
   OF_None = 0,
-  F_None = 0, // For compatibility
 
   /// The file should be opened in text mode on platforms like z/OS that make
   /// this distinction.
   OF_Text = 1,
-  F_Text = 1, // For compatibility
 
   /// The file should use a carriage linefeed '\r\n'. This flag should only be
   /// used with OF_Text. Only makes a difference on Windows.
@@ -773,7 +771,6 @@
 
   /// The file should be opened in append mode.
   OF_Append = 4,
-  F_Append = 4, // For compatibility
 
   /// Delete the file on close. Only makes a difference on windows.
   OF_Delete = 8,
Index: lld/ELF/Driver.cpp
===================================================================
--- lld/ELF/Driver.cpp
+++ lld/ELF/Driver.cpp
@@ -1690,7 +1690,7 @@
 // easily.
 static void writeDependencyFile() {
   std::error_code ec;
-  raw_fd_ostream os(config->dependencyFile, ec, sys::fs::F_None);
+  raw_fd_ostream os(config->dependencyFile, ec, sys::fs::OF_None);
   if (ec) {
     error("cannot open " + config->dependencyFile + ": " + ec.message());
     return;
Index: libclc/utils/prepare-builtins.cpp
===================================================================
--- libclc/utils/prepare-builtins.cpp
+++ libclc/utils/prepare-builtins.cpp
@@ -95,10 +95,10 @@
   std::error_code EC;
 #if HAVE_LLVM >= 0x0600
   std::unique_ptr<ToolOutputFile> Out(
-      new ToolOutputFile(OutputFilename, EC, sys::fs::F_None));
+      new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None));
 #else
   std::unique_ptr<tool_output_file> Out(
-      new tool_output_file(OutputFilename, EC, sys::fs::F_None));
+      new tool_output_file(OutputFilename, EC, sys::fs::OF_None));
 #endif
   if (EC) {
     errs() << EC.message() << '\n';
Index: clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp
===================================================================
--- clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp
+++ clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp
@@ -71,7 +71,7 @@
 
   if (SkipProcessing) {
     std::error_code EC;
-    llvm::raw_fd_ostream JsonOut(JsonOutputPath, EC, llvm::sys::fs::F_Text);
+    llvm::raw_fd_ostream JsonOut(JsonOutputPath, EC, llvm::sys::fs::OF_Text);
     if (EC)
       return 1;
     JsonOut << formatv("{0:2}", llvm::json::Value(llvm::json::Object()));
Index: clang/lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp
===================================================================
--- clang/lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp
+++ clang/lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp
@@ -122,7 +122,7 @@
   }
 
   std::error_code EC;
-  llvm::raw_fd_ostream JsonOut(JsonPath, EC, llvm::sys::fs::F_Text);
+  llvm::raw_fd_ostream JsonOut(JsonPath, EC, llvm::sys::fs::OF_Text);
   if (EC)
     return;
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D101506: S... Duncan P. N. Exon Smith via Phabricator via cfe-commits

Reply via email to