[llvm] r345213 - [VFS] Remove 'ignore-non-existent-contents' attribute for YAML-based VFS.

Volodymyr Sapsai via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 24 15:40:54 PDT 2018


Author: vsapsai
Date: Wed Oct 24 15:40:54 2018
New Revision: 345213

URL: http://llvm.org/viewvc/llvm-project?rev=345213&view=rev
Log:
[VFS] Remove 'ignore-non-existent-contents' attribute for YAML-based VFS.

'ignore-non-existent-contents' stopped working after r342232 in a way
that the actual attribute value isn't used and it works as if it is
always `true`.

Common use case for VFS iteration is iterating through files in umbrella
directories for modules. Ability to detect if some VFS entries point to
non-existing files is nice but non-critical. Instead of adding back
support for `'ignore-non-existent-contents': false` I am removing the
attribute, because such scenario isn't used widely enough and stricter
checks don't provide enough value to justify the maintenance.

Change is done both in LLVM and Clang, corresponding Clang commit is r345212.

rdar://problem/45176119

Reviewers: bruno

Reviewed By: bruno

Subscribers: hiraditya, dexonsmith, sammccall, cfe-commits

Differential Revision: https://reviews.llvm.org/D53228

Modified:
    llvm/trunk/include/llvm/Support/VirtualFileSystem.h
    llvm/trunk/lib/Support/VirtualFileSystem.cpp

Modified: llvm/trunk/include/llvm/Support/VirtualFileSystem.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/VirtualFileSystem.h?rev=345213&r1=345212&r2=345213&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/VirtualFileSystem.h (original)
+++ llvm/trunk/include/llvm/Support/VirtualFileSystem.h Wed Oct 24 15:40:54 2018
@@ -490,7 +490,6 @@ class YAMLVFSWriter {
   Optional<bool> IsCaseSensitive;
   Optional<bool> IsOverlayRelative;
   Optional<bool> UseExternalNames;
-  Optional<bool> IgnoreNonExistentContents;
   std::string OverlayDir;
 
 public:
@@ -504,10 +503,6 @@ public:
 
   void setUseExternalNames(bool UseExtNames) { UseExternalNames = UseExtNames; }
 
-  void setIgnoreNonExistentContents(bool IgnoreContents) {
-    IgnoreNonExistentContents = IgnoreContents;
-  }
-
   void setOverlayDir(StringRef OverlayDirectory) {
     IsOverlayRelative = true;
     OverlayDir.assign(OverlayDirectory.str());

Modified: llvm/trunk/lib/Support/VirtualFileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/VirtualFileSystem.cpp?rev=345213&r1=345212&r2=345213&view=diff
==============================================================================
--- llvm/trunk/lib/Support/VirtualFileSystem.cpp (original)
+++ llvm/trunk/lib/Support/VirtualFileSystem.cpp Wed Oct 24 15:40:54 2018
@@ -1028,7 +1028,6 @@ public:
 ///   'case-sensitive': <boolean, default=true>
 ///   'use-external-names': <boolean, default=true>
 ///   'overlay-relative': <boolean, default=false>
-///   'ignore-non-existent-contents': <boolean, default=true>
 ///
 /// Virtual directories are represented as
 /// \verbatim
@@ -1092,14 +1091,6 @@ class RedirectingFileSystem : public vfs
   /// Whether to use to use the value of 'external-contents' for the
   /// names of files.  This global value is overridable on a per-file basis.
   bool UseExternalNames = true;
-
-  /// Whether an invalid path obtained via 'external-contents' should
-  /// cause iteration on the VFS to stop. If 'true', the VFS should ignore
-  /// the entry and continue with the next. Allows YAML files to be shared
-  /// across multiple compiler invocations regardless of prior existent
-  /// paths in 'external-contents'. This global value is overridable on a
-  /// per-file basis.
-  bool IgnoreNonExistentContents = true;
   /// @}
 
   /// Virtual file paths and external files could be canonicalized without "..",
@@ -1176,8 +1167,6 @@ public:
     return ExternalContentsPrefixDir;
   }
 
-  bool ignoreNonExistentContents() const { return IgnoreNonExistentContents; }
-
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
   LLVM_DUMP_METHOD void dump() const {
     for (const auto &Root : Roots)
@@ -1549,7 +1538,6 @@ public:
         KeyStatusPair("case-sensitive", false),
         KeyStatusPair("use-external-names", false),
         KeyStatusPair("overlay-relative", false),
-        KeyStatusPair("ignore-non-existent-contents", false),
         KeyStatusPair("roots", true),
     };
 
@@ -1607,9 +1595,6 @@ public:
       } else if (Key == "use-external-names") {
         if (!parseScalarBool(I.getValue(), FS->UseExternalNames))
           return false;
-      } else if (Key == "ignore-non-existent-contents") {
-        if (!parseScalarBool(I.getValue(), FS->IgnoreNonExistentContents))
-          return false;
       } else {
         llvm_unreachable("key missing from Keys");
       }
@@ -1915,7 +1900,7 @@ public:
 
   void write(ArrayRef<YAMLVFSEntry> Entries, Optional<bool> UseExternalNames,
              Optional<bool> IsCaseSensitive, Optional<bool> IsOverlayRelative,
-             Optional<bool> IgnoreNonExistentContents, StringRef OverlayDir);
+             StringRef OverlayDir);
 };
 
 } // namespace
@@ -1973,7 +1958,6 @@ void JSONWriter::write(ArrayRef<YAMLVFSE
                        Optional<bool> UseExternalNames,
                        Optional<bool> IsCaseSensitive,
                        Optional<bool> IsOverlayRelative,
-                       Optional<bool> IgnoreNonExistentContents,
                        StringRef OverlayDir) {
   using namespace llvm::sys;
 
@@ -1991,9 +1975,6 @@ void JSONWriter::write(ArrayRef<YAMLVFSE
     OS << "  'overlay-relative': '" << (UseOverlayRelative ? "true" : "false")
        << "',\n";
   }
-  if (IgnoreNonExistentContents.hasValue())
-    OS << "  'ignore-non-existent-contents': '"
-       << (IgnoreNonExistentContents.getValue() ? "true" : "false") << "',\n";
   OS << "  'roots': [\n";
 
   if (!Entries.empty()) {
@@ -2049,8 +2030,7 @@ void YAMLVFSWriter::write(llvm::raw_ostr
   });
 
   JSONWriter(OS).write(Mappings, UseExternalNames, IsCaseSensitive,
-                       IsOverlayRelative, IgnoreNonExistentContents,
-                       OverlayDir);
+                       IsOverlayRelative, OverlayDir);
 }
 
 VFSFromYamlDirIterImpl::VFSFromYamlDirIterImpl(




More information about the llvm-commits mailing list