LLVM  14.0.0git
VirtualFileSystem.h
Go to the documentation of this file.
1 //===- VirtualFileSystem.h - Virtual File System Layer ----------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 /// Defines the virtual file system interface vfs::FileSystem.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_SUPPORT_VIRTUALFILESYSTEM_H
15 #define LLVM_SUPPORT_VIRTUALFILESYSTEM_H
16 
18 #include "llvm/ADT/None.h"
19 #include "llvm/ADT/Optional.h"
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/ADT/StringRef.h"
23 #include "llvm/Support/Chrono.h"
24 #include "llvm/Support/ErrorOr.h"
26 #include "llvm/Support/Path.h"
27 #include "llvm/Support/SourceMgr.h"
28 #include <cassert>
29 #include <cstdint>
30 #include <ctime>
31 #include <memory>
32 #include <stack>
33 #include <string>
34 #include <system_error>
35 #include <utility>
36 #include <vector>
37 
38 namespace llvm {
39 
40 class MemoryBuffer;
41 class MemoryBufferRef;
42 class Twine;
43 
44 namespace vfs {
45 
46 /// The result of a \p status operation.
47 class Status {
48  std::string Name;
51  uint32_t User;
52  uint32_t Group;
53  uint64_t Size;
56 
57 public:
58  // FIXME: remove when files support multiple names
59  bool IsVFSMapped = false;
60 
61  Status() = default;
63  Status(const Twine &Name, llvm::sys::fs::UniqueID UID,
66  llvm::sys::fs::perms Perms);
67 
68  /// Get a copy of a Status with a different size.
69  static Status copyWithNewSize(const Status &In, uint64_t NewSize);
70  /// Get a copy of a Status with a different name.
71  static Status copyWithNewName(const Status &In, const Twine &NewName);
73  const Twine &NewName);
74 
75  /// Returns the name that should be used for this file or directory.
76  StringRef getName() const { return Name; }
77 
78  /// @name Status interface from llvm::sys::fs
79  /// @{
81  llvm::sys::fs::perms getPermissions() const { return Perms; }
83  llvm::sys::fs::UniqueID getUniqueID() const { return UID; }
84  uint32_t getUser() const { return User; }
85  uint32_t getGroup() const { return Group; }
86  uint64_t getSize() const { return Size; }
87  /// @}
88  /// @name Status queries
89  /// These are static queries in llvm::sys::fs.
90  /// @{
91  bool equivalent(const Status &Other) const;
92  bool isDirectory() const;
93  bool isRegularFile() const;
94  bool isOther() const;
95  bool isSymlink() const;
96  bool isStatusKnown() const;
97  bool exists() const;
98  /// @}
99 };
100 
101 /// Represents an open file.
102 class File {
103 public:
104  /// Destroy the file after closing it (if open).
105  /// Sub-classes should generally call close() inside their destructors. We
106  /// cannot do that from the base class, since close is virtual.
107  virtual ~File();
108 
109  /// Get the status of the file.
110  virtual llvm::ErrorOr<Status> status() = 0;
111 
112  /// Get the name of the file
114  if (auto Status = status())
115  return Status->getName().str();
116  else
117  return Status.getError();
118  }
119 
120  /// Get the contents of the file as a \p MemoryBuffer.
122  getBuffer(const Twine &Name, int64_t FileSize = -1,
123  bool RequiresNullTerminator = true, bool IsVolatile = false) = 0;
124 
125  /// Closes the file.
126  virtual std::error_code close() = 0;
127 
128  // Get the same file with a different path.
130  getWithPath(ErrorOr<std::unique_ptr<File>> Result, const Twine &P);
131 
132 protected:
133  // Set the file's underlying path.
134  virtual void setPath(const Twine &Path) {}
135 };
136 
137 /// A member of a directory, yielded by a directory_iterator.
138 /// Only information available on most platforms is included.
140  std::string Path;
142 
143 public:
144  directory_entry() = default;
146  : Path(std::move(Path)), Type(Type) {}
147 
148  llvm::StringRef path() const { return Path; }
149  llvm::sys::fs::file_type type() const { return Type; }
150 };
151 
152 namespace detail {
153 
154 /// An interface for virtual file systems to provide an iterator over the
155 /// (non-recursive) contents of a directory.
156 struct DirIterImpl {
157  virtual ~DirIterImpl();
158 
159  /// Sets \c CurrentEntry to the next entry in the directory on success,
160  /// to directory_entry() at end, or returns a system-defined \c error_code.
161  virtual std::error_code increment() = 0;
162 
164 };
165 
166 } // namespace detail
167 
168 /// An input iterator over the entries in a virtual path, similar to
169 /// llvm::sys::fs::directory_iterator.
171  std::shared_ptr<detail::DirIterImpl> Impl; // Input iterator semantics on copy
172 
173 public:
174  directory_iterator(std::shared_ptr<detail::DirIterImpl> I)
175  : Impl(std::move(I)) {
176  assert(Impl.get() != nullptr && "requires non-null implementation");
177  if (Impl->CurrentEntry.path().empty())
178  Impl.reset(); // Normalize the end iterator to Impl == nullptr.
179  }
180 
181  /// Construct an 'end' iterator.
182  directory_iterator() = default;
183 
184  /// Equivalent to operator++, with an error code.
185  directory_iterator &increment(std::error_code &EC) {
186  assert(Impl && "attempting to increment past end");
187  EC = Impl->increment();
188  if (Impl->CurrentEntry.path().empty())
189  Impl.reset(); // Normalize the end iterator to Impl == nullptr.
190  return *this;
191  }
192 
193  const directory_entry &operator*() const { return Impl->CurrentEntry; }
194  const directory_entry *operator->() const { return &Impl->CurrentEntry; }
195 
196  bool operator==(const directory_iterator &RHS) const {
197  if (Impl && RHS.Impl)
198  return Impl->CurrentEntry.path() == RHS.Impl->CurrentEntry.path();
199  return !Impl && !RHS.Impl;
200  }
201  bool operator!=(const directory_iterator &RHS) const {
202  return !(*this == RHS);
203  }
204 };
205 
206 class FileSystem;
207 
208 namespace detail {
209 
210 /// Keeps state for the recursive_directory_iterator.
212  std::stack<directory_iterator, std::vector<directory_iterator>> Stack;
213  bool HasNoPushRequest = false;
214 };
215 
216 } // end namespace detail
217 
218 /// An input iterator over the recursive contents of a virtual path,
219 /// similar to llvm::sys::fs::recursive_directory_iterator.
221  FileSystem *FS;
222  std::shared_ptr<detail::RecDirIterState>
223  State; // Input iterator semantics on copy.
224 
225 public:
227  std::error_code &EC);
228 
229  /// Construct an 'end' iterator.
230  recursive_directory_iterator() = default;
231 
232  /// Equivalent to operator++, with an error code.
233  recursive_directory_iterator &increment(std::error_code &EC);
234 
235  const directory_entry &operator*() const { return *State->Stack.top(); }
236  const directory_entry *operator->() const { return &*State->Stack.top(); }
237 
238  bool operator==(const recursive_directory_iterator &Other) const {
239  return State == Other.State; // identity
240  }
242  return !(*this == RHS);
243  }
244 
245  /// Gets the current level. Starting path is at level 0.
246  int level() const {
247  assert(!State->Stack.empty() &&
248  "Cannot get level without any iteration state");
249  return State->Stack.size() - 1;
250  }
251 
252  void no_push() { State->HasNoPushRequest = true; }
253 };
254 
255 /// The virtual file system interface.
256 class FileSystem : public llvm::ThreadSafeRefCountedBase<FileSystem> {
257 public:
258  virtual ~FileSystem();
259 
260  /// Get the status of the entry at \p Path, if one exists.
261  virtual llvm::ErrorOr<Status> status(const Twine &Path) = 0;
262 
263  /// Get a \p File object for the file at \p Path, if one exists.
265  openFileForRead(const Twine &Path) = 0;
266 
267  /// This is a convenience method that opens a file, gets its content and then
268  /// closes the file.
270  getBufferForFile(const Twine &Name, int64_t FileSize = -1,
271  bool RequiresNullTerminator = true, bool IsVolatile = false);
272 
273  /// Get a directory_iterator for \p Dir.
274  /// \note The 'end' iterator is directory_iterator().
275  virtual directory_iterator dir_begin(const Twine &Dir,
276  std::error_code &EC) = 0;
277 
278  /// Set the working directory. This will affect all following operations on
279  /// this file system and may propagate down for nested file systems.
280  virtual std::error_code setCurrentWorkingDirectory(const Twine &Path) = 0;
281 
282  /// Get the working directory of this file system.
284 
285  /// Gets real path of \p Path e.g. collapse all . and .. patterns, resolve
286  /// symlinks. For real file system, this uses `llvm::sys::fs::real_path`.
287  /// This returns errc::operation_not_permitted if not implemented by subclass.
288  virtual std::error_code getRealPath(const Twine &Path,
289  SmallVectorImpl<char> &Output) const;
290 
291  /// Check whether a file exists. Provided for convenience.
292  bool exists(const Twine &Path);
293 
294  /// Is the file mounted on a local filesystem?
295  virtual std::error_code isLocal(const Twine &Path, bool &Result);
296 
297  /// Make \a Path an absolute path.
298  ///
299  /// Makes \a Path absolute using the current directory if it is not already.
300  /// An empty \a Path will result in the current directory.
301  ///
302  /// /absolute/path => /absolute/path
303  /// relative/../path => <current-directory>/relative/../path
304  ///
305  /// \param Path A path that is modified to be an absolute path.
306  /// \returns success if \a path has been made absolute, otherwise a
307  /// platform-specific error_code.
308  virtual std::error_code makeAbsolute(SmallVectorImpl<char> &Path) const;
309 };
310 
311 /// Gets an \p vfs::FileSystem for the 'real' file system, as seen by
312 /// the operating system.
313 /// The working directory is linked to the process's working directory.
314 /// (This is usually thread-hostile).
316 
317 /// Create an \p vfs::FileSystem for the 'real' file system, as seen by
318 /// the operating system.
319 /// It has its own working directory, independent of (but initially equal to)
320 /// that of the process.
321 std::unique_ptr<FileSystem> createPhysicalFileSystem();
322 
323 /// A file system that allows overlaying one \p AbstractFileSystem on top
324 /// of another.
325 ///
326 /// Consists of a stack of >=1 \p FileSystem objects, which are treated as being
327 /// one merged file system. When there is a directory that exists in more than
328 /// one file system, the \p OverlayFileSystem contains a directory containing
329 /// the union of their contents. The attributes (permissions, etc.) of the
330 /// top-most (most recently added) directory are used. When there is a file
331 /// that exists in more than one file system, the file in the top-most file
332 /// system overrides the other(s).
335 
336  /// The stack of file systems, implemented as a list in order of
337  /// their addition.
338  FileSystemList FSList;
339 
340 public:
342 
343  /// Pushes a file system on top of the stack.
345 
346  llvm::ErrorOr<Status> status(const Twine &Path) override;
348  openFileForRead(const Twine &Path) override;
349  directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override;
351  std::error_code setCurrentWorkingDirectory(const Twine &Path) override;
352  std::error_code isLocal(const Twine &Path, bool &Result) override;
353  std::error_code getRealPath(const Twine &Path,
354  SmallVectorImpl<char> &Output) const override;
355 
356  using iterator = FileSystemList::reverse_iterator;
357  using const_iterator = FileSystemList::const_reverse_iterator;
360 
361  /// Get an iterator pointing to the most recently added file system.
362  iterator overlays_begin() { return FSList.rbegin(); }
363  const_iterator overlays_begin() const { return FSList.rbegin(); }
364 
365  /// Get an iterator pointing one-past the least recently added file system.
366  iterator overlays_end() { return FSList.rend(); }
367  const_iterator overlays_end() const { return FSList.rend(); }
368 
369  /// Get an iterator pointing to the least recently added file system.
370  reverse_iterator overlays_rbegin() { return FSList.begin(); }
371  const_reverse_iterator overlays_rbegin() const { return FSList.begin(); }
372 
373  /// Get an iterator pointing one-past the most recently added file system.
374  reverse_iterator overlays_rend() { return FSList.end(); }
375  const_reverse_iterator overlays_rend() const { return FSList.end(); }
376 };
377 
378 /// By default, this delegates all calls to the underlying file system. This
379 /// is useful when derived file systems want to override some calls and still
380 /// proxy other calls.
381 class ProxyFileSystem : public FileSystem {
382 public:
384  : FS(std::move(FS)) {}
385 
386  llvm::ErrorOr<Status> status(const Twine &Path) override {
387  return FS->status(Path);
388  }
390  openFileForRead(const Twine &Path) override {
391  return FS->openFileForRead(Path);
392  }
393  directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override {
394  return FS->dir_begin(Dir, EC);
395  }
397  return FS->getCurrentWorkingDirectory();
398  }
399  std::error_code setCurrentWorkingDirectory(const Twine &Path) override {
400  return FS->setCurrentWorkingDirectory(Path);
401  }
402  std::error_code getRealPath(const Twine &Path,
403  SmallVectorImpl<char> &Output) const override {
404  return FS->getRealPath(Path, Output);
405  }
406  std::error_code isLocal(const Twine &Path, bool &Result) override {
407  return FS->isLocal(Path, Result);
408  }
409 
410 protected:
411  FileSystem &getUnderlyingFS() { return *FS; }
412 
413 private:
415 
416  virtual void anchor();
417 };
418 
419 namespace detail {
420 
421 class InMemoryDirectory;
422 class InMemoryFile;
423 class InMemoryNode;
424 
430  std::unique_ptr<llvm::MemoryBuffer> Buffer;
435 
436  Status makeStatus() const;
437 };
438 
439 } // namespace detail
440 
441 /// An in-memory file system.
443  std::unique_ptr<detail::InMemoryDirectory> Root;
444  std::string WorkingDirectory;
445  bool UseNormalizedPaths = true;
446 
449 
450  /// Create node with \p MakeNode and add it into this filesystem at \p Path.
451  bool addFile(const Twine &Path, time_t ModificationTime,
452  std::unique_ptr<llvm::MemoryBuffer> Buffer,
456 
457 public:
458  explicit InMemoryFileSystem(bool UseNormalizedPaths = true);
459  ~InMemoryFileSystem() override;
460 
461  /// Add a file containing a buffer or a directory to the VFS with a
462  /// path. The VFS owns the buffer. If present, User, Group, Type
463  /// and Perms apply to the newly-created file or directory.
464  /// \return true if the file or directory was successfully added,
465  /// false if the file or directory already exists in the file system with
466  /// different contents.
467  bool addFile(const Twine &Path, time_t ModificationTime,
468  std::unique_ptr<llvm::MemoryBuffer> Buffer,
472 
473  /// Add a hard link to a file.
474  /// Here hard links are not intended to be fully equivalent to the classical
475  /// filesystem. Both the hard link and the file share the same buffer and
476  /// status (and thus have the same UniqueID). Because of this there is no way
477  /// to distinguish between the link and the file after the link has been
478  /// added.
479  ///
480  /// The To path must be an existing file or a hardlink. The From file must not
481  /// have been added before. The To Path must not be a directory. The From Node
482  /// is added as a hard link which points to the resolved file of To Node.
483  /// \return true if the above condition is satisfied and hardlink was
484  /// successfully created, false otherwise.
485  bool addHardLink(const Twine &From, const Twine &To);
486 
487  /// Add a buffer to the VFS with a path. The VFS does not own the buffer.
488  /// If present, User, Group, Type and Perms apply to the newly-created file
489  /// or directory.
490  /// \return true if the file or directory was successfully added,
491  /// false if the file or directory already exists in the file system with
492  /// different contents.
493  bool addFileNoOwn(const Twine &Path, time_t ModificationTime,
494  const llvm::MemoryBufferRef &Buffer,
496  Optional<uint32_t> Group = None,
499 
500  std::string toString() const;
501 
502  /// Return true if this file system normalizes . and .. in paths.
503  bool useNormalizedPaths() const { return UseNormalizedPaths; }
504 
505  llvm::ErrorOr<Status> status(const Twine &Path) override;
507  openFileForRead(const Twine &Path) override;
508  directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override;
509 
511  return WorkingDirectory;
512  }
513  /// Canonicalizes \p Path by combining with the current working
514  /// directory and normalizing the path (e.g. remove dots). If the current
515  /// working directory is not set, this returns errc::operation_not_permitted.
516  ///
517  /// This doesn't resolve symlinks as they are not supported in in-memory file
518  /// system.
519  std::error_code getRealPath(const Twine &Path,
520  SmallVectorImpl<char> &Output) const override;
521  std::error_code isLocal(const Twine &Path, bool &Result) override;
522  std::error_code setCurrentWorkingDirectory(const Twine &Path) override;
523 };
524 
525 /// Get a globally unique ID for a virtual file or directory.
527 
528 /// Gets a \p FileSystem for a virtual file system described in YAML
529 /// format.
530 std::unique_ptr<FileSystem>
531 getVFSFromYAML(std::unique_ptr<llvm::MemoryBuffer> Buffer,
533  StringRef YAMLFilePath, void *DiagContext = nullptr,
535 
536 struct YAMLVFSEntry {
537  template <typename T1, typename T2>
538  YAMLVFSEntry(T1 &&VPath, T2 &&RPath, bool IsDirectory = false)
539  : VPath(std::forward<T1>(VPath)), RPath(std::forward<T2>(RPath)),
541  std::string VPath;
542  std::string RPath;
543  bool IsDirectory = false;
544 };
545 
548 
549 /// A virtual file system parsed from a YAML file.
550 ///
551 /// Currently, this class allows creating virtual files and directories. Virtual
552 /// files map to existing external files in \c ExternalFS, and virtual
553 /// directories may either map to existing directories in \c ExternalFS or list
554 /// their contents in the form of other virtual directories and/or files.
555 ///
556 /// The basic structure of the parsed file is:
557 /// \verbatim
558 /// {
559 /// 'version': <version number>,
560 /// <optional configuration>
561 /// 'roots': [
562 /// <directory entries>
563 /// ]
564 /// }
565 /// \endverbatim
566 ///
567 /// The roots may be absolute or relative. If relative they will be made
568 /// absolute against the current working directory.
569 ///
570 /// All configuration options are optional.
571 /// 'case-sensitive': <boolean, default=(true for Posix, false for Windows)>
572 /// 'use-external-names': <boolean, default=true>
573 /// 'overlay-relative': <boolean, default=false>
574 /// 'fallthrough': <boolean, default=true>
575 ///
576 /// Virtual directories that list their contents are represented as
577 /// \verbatim
578 /// {
579 /// 'type': 'directory',
580 /// 'name': <string>,
581 /// 'contents': [ <file or directory entries> ]
582 /// }
583 /// \endverbatim
584 ///
585 /// The default attributes for such virtual directories are:
586 /// \verbatim
587 /// MTime = now() when created
588 /// Perms = 0777
589 /// User = Group = 0
590 /// Size = 0
591 /// UniqueID = unspecified unique value
592 /// \endverbatim
593 ///
594 /// When a path prefix matches such a directory, the next component in the path
595 /// is matched against the entries in the 'contents' array.
596 ///
597 /// Re-mapped directories, on the other hand, are represented as
598 /// /// \verbatim
599 /// {
600 /// 'type': 'directory-remap',
601 /// 'name': <string>,
602 /// 'use-external-name': <boolean>, # Optional
603 /// 'external-contents': <path to external directory>
604 /// }
605 /// \endverbatim
606 ///
607 /// and inherit their attributes from the external directory. When a path
608 /// prefix matches such an entry, the unmatched components are appended to the
609 /// 'external-contents' path, and the resulting path is looked up in the
610 /// external file system instead.
611 ///
612 /// Re-mapped files are represented as
613 /// \verbatim
614 /// {
615 /// 'type': 'file',
616 /// 'name': <string>,
617 /// 'use-external-name': <boolean>, # Optional
618 /// 'external-contents': <path to external file>
619 /// }
620 /// \endverbatim
621 ///
622 /// Their attributes and file contents are determined by looking up the file at
623 /// their 'external-contents' path in the external file system.
624 ///
625 /// For 'file', 'directory' and 'directory-remap' entries the 'name' field may
626 /// contain multiple path components (e.g. /path/to/file). However, any
627 /// directory in such a path that contains more than one child must be uniquely
628 /// represented by a 'directory' entry.
629 ///
630 /// When the 'use-external-name' field is set, calls to \a vfs::File::status()
631 /// give the external (remapped) filesystem name instead of the name the file
632 /// was accessed by. This is an intentional leak through the \a
633 /// RedirectingFileSystem abstraction layer. It enables clients to discover
634 /// (and use) the external file location when communicating with users or tools
635 /// that don't use the same VFS overlay.
636 ///
637 /// FIXME: 'use-external-name' causes behaviour that's inconsistent with how
638 /// "real" filesystems behave. Maybe there should be a separate channel for
639 /// this information.
641 public:
644 
645  /// A single file or directory in the VFS.
646  class Entry {
647  EntryKind Kind;
648  std::string Name;
649 
650  public:
651  Entry(EntryKind K, StringRef Name) : Kind(K), Name(Name) {}
652  virtual ~Entry() = default;
653 
654  StringRef getName() const { return Name; }
655  EntryKind getKind() const { return Kind; }
656  };
657 
658  /// A directory in the vfs with explicitly specified contents.
659  class DirectoryEntry : public Entry {
660  std::vector<std::unique_ptr<Entry>> Contents;
661  Status S;
662 
663  public:
664  /// Constructs a directory entry with explicitly specified contents.
665  DirectoryEntry(StringRef Name, std::vector<std::unique_ptr<Entry>> Contents,
666  Status S)
667  : Entry(EK_Directory, Name), Contents(std::move(Contents)),
668  S(std::move(S)) {}
669 
670  /// Constructs an empty directory entry.
672  : Entry(EK_Directory, Name), S(std::move(S)) {}
673 
674  Status getStatus() { return S; }
675 
676  void addContent(std::unique_ptr<Entry> Content) {
677  Contents.push_back(std::move(Content));
678  }
679 
680  Entry *getLastContent() const { return Contents.back().get(); }
681 
682  using iterator = decltype(Contents)::iterator;
683 
684  iterator contents_begin() { return Contents.begin(); }
685  iterator contents_end() { return Contents.end(); }
686 
687  static bool classof(const Entry *E) { return E->getKind() == EK_Directory; }
688  };
689 
690  /// A file or directory in the vfs that is mapped to a file or directory in
691  /// the external filesystem.
692  class RemapEntry : public Entry {
693  std::string ExternalContentsPath;
694  NameKind UseName;
695 
696  protected:
697  RemapEntry(EntryKind K, StringRef Name, StringRef ExternalContentsPath,
698  NameKind UseName)
699  : Entry(K, Name), ExternalContentsPath(ExternalContentsPath),
700  UseName(UseName) {}
701 
702  public:
703  StringRef getExternalContentsPath() const { return ExternalContentsPath; }
704 
705  /// Whether to use the external path as the name for this file or directory.
706  bool useExternalName(bool GlobalUseExternalName) const {
707  return UseName == NK_NotSet ? GlobalUseExternalName
708  : (UseName == NK_External);
709  }
710 
711  NameKind getUseName() const { return UseName; }
712 
713  static bool classof(const Entry *E) {
714  switch (E->getKind()) {
715  case EK_DirectoryRemap:
717  case EK_File:
718  return true;
719  case EK_Directory:
720  return false;
721  }
722  llvm_unreachable("invalid entry kind");
723  }
724  };
725 
726  /// A directory in the vfs that maps to a directory in the external file
727  /// system.
729  public:
730  DirectoryRemapEntry(StringRef Name, StringRef ExternalContentsPath,
731  NameKind UseName)
732  : RemapEntry(EK_DirectoryRemap, Name, ExternalContentsPath, UseName) {}
733 
734  static bool classof(const Entry *E) {
735  return E->getKind() == EK_DirectoryRemap;
736  }
737  };
738 
739  /// A file in the vfs that maps to a file in the external file system.
740  class FileEntry : public RemapEntry {
741  public:
742  FileEntry(StringRef Name, StringRef ExternalContentsPath, NameKind UseName)
743  : RemapEntry(EK_File, Name, ExternalContentsPath, UseName) {}
744 
745  static bool classof(const Entry *E) { return E->getKind() == EK_File; }
746  };
747 
748  /// Represents the result of a path lookup into the RedirectingFileSystem.
749  struct LookupResult {
750  /// The entry the looked-up path corresponds to.
752 
753  private:
754  /// When the found Entry is a DirectoryRemapEntry, stores the path in the
755  /// external file system that the looked-up path in the virtual file system
756  // corresponds to.
757  Optional<std::string> ExternalRedirect;
758 
759  public:
762 
763  /// If the found Entry maps the the input path to a path in the external
764  /// file system (i.e. it is a FileEntry or DirectoryRemapEntry), returns
765  /// that path.
767  if (isa<DirectoryRemapEntry>(E))
768  return StringRef(*ExternalRedirect);
769  if (auto *FE = dyn_cast<FileEntry>(E))
770  return FE->getExternalContentsPath();
771  return None;
772  }
773  };
774 
775 private:
778 
779  bool shouldUseExternalFS() const { return IsFallthrough; }
780 
781  /// Canonicalize path by removing ".", "..", "./", components. This is
782  /// a VFS request, do not bother about symlinks in the path components
783  /// but canonicalize in order to perform the correct entry search.
784  std::error_code makeCanonical(SmallVectorImpl<char> &Path) const;
785 
786  /// Whether to fall back to the external file system when an operation fails
787  /// with the given error code on a path associated with the provided Entry.
788  bool shouldFallBackToExternalFS(std::error_code EC, Entry *E = nullptr) const;
789 
790  /// Get the File status, or error, from the underlying external file system.
791  /// This returns the status with the originally requested name, while looking
792  /// up the entry using the canonical path.
793  ErrorOr<Status> getExternalStatus(const Twine &CanonicalPath,
794  const Twine &OriginalPath) const;
795 
796  // In a RedirectingFileSystem, keys can be specified in Posix or Windows
797  // style (or even a mixture of both), so this comparison helper allows
798  // slashes (representing a root) to match backslashes (and vice versa). Note
799  // that, other than the root, path components should not contain slashes or
800  // backslashes.
801  bool pathComponentMatches(llvm::StringRef lhs, llvm::StringRef rhs) const {
802  if ((CaseSensitive ? lhs.equals(rhs) : lhs.equals_insensitive(rhs)))
803  return true;
804  return (lhs == "/" && rhs == "\\") || (lhs == "\\" && rhs == "/");
805  }
806 
807  /// The root(s) of the virtual file system.
808  std::vector<std::unique_ptr<Entry>> Roots;
809 
810  /// The current working directory of the file system.
811  std::string WorkingDirectory;
812 
813  /// The file system to use for external references.
815 
816  /// If IsRelativeOverlay is set, this represents the directory
817  /// path that should be prefixed to each 'external-contents' entry
818  /// when reading from YAML files.
819  std::string ExternalContentsPrefixDir;
820 
821  /// @name Configuration
822  /// @{
823 
824  /// Whether to perform case-sensitive comparisons.
825  ///
826  /// Currently, case-insensitive matching only works correctly with ASCII.
827  bool CaseSensitive = is_style_posix(sys::path::Style::native);
828 
829  /// IsRelativeOverlay marks whether a ExternalContentsPrefixDir path must
830  /// be prefixed in every 'external-contents' when reading from YAML files.
831  bool IsRelativeOverlay = false;
832 
833  /// Whether to use to use the value of 'external-contents' for the
834  /// names of files. This global value is overridable on a per-file basis.
835  bool UseExternalNames = true;
836 
837  /// Whether to attempt a file lookup in external file system after it wasn't
838  /// found in VFS.
839  bool IsFallthrough = true;
840  /// @}
841 
842  RedirectingFileSystem(IntrusiveRefCntPtr<FileSystem> ExternalFS);
843 
844  /// Looks up the path <tt>[Start, End)</tt> in \p From, possibly recursing
845  /// into the contents of \p From if it is a directory. Returns a LookupResult
846  /// giving the matched entry and, if that entry is a FileEntry or
847  /// DirectoryRemapEntry, the path it redirects to in the external file system.
850  Entry *From) const;
851 
852  /// Get the status for a path with the provided \c LookupResult.
853  ErrorOr<Status> status(const Twine &CanonicalPath, const Twine &OriginalPath,
854  const LookupResult &Result);
855 
856 public:
857  /// Looks up \p Path in \c Roots and returns a LookupResult giving the
858  /// matched entry and, if the entry was a FileEntry or DirectoryRemapEntry,
859  /// the path it redirects to in the external file system.
861 
862  /// Parses \p Buffer, which is expected to be in YAML format and
863  /// returns a virtual file system representing its contents.
864  static std::unique_ptr<RedirectingFileSystem>
865  create(std::unique_ptr<MemoryBuffer> Buffer,
867  void *DiagContext, IntrusiveRefCntPtr<FileSystem> ExternalFS);
868 
869  /// Redirect each of the remapped files from first to second.
870  static std::unique_ptr<RedirectingFileSystem>
871  create(ArrayRef<std::pair<std::string, std::string>> RemappedFiles,
872  bool UseExternalNames, FileSystem &ExternalFS);
873 
874  ErrorOr<Status> status(const Twine &Path) override;
875  ErrorOr<std::unique_ptr<File>> openFileForRead(const Twine &Path) override;
876 
877  std::error_code getRealPath(const Twine &Path,
878  SmallVectorImpl<char> &Output) const override;
879 
881 
882  std::error_code setCurrentWorkingDirectory(const Twine &Path) override;
883 
884  std::error_code isLocal(const Twine &Path, bool &Result) override;
885 
886  std::error_code makeAbsolute(SmallVectorImpl<char> &Path) const override;
887 
888  directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override;
889 
890  void setExternalContentsPrefixDir(StringRef PrefixDir);
891 
893 
894  void setFallthrough(bool Fallthrough);
895 
896  std::vector<llvm::StringRef> getRoots() const;
897 
898  void dump(raw_ostream &OS) const;
899  void dumpEntry(raw_ostream &OS, Entry *E, int NumSpaces = 0) const;
900 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
901  LLVM_DUMP_METHOD void dump() const;
902 #endif
903 };
904 
905 /// Collect all pairs of <virtual path, real path> entries from the
906 /// \p YAMLFilePath. This is used by the module dependency collector to forward
907 /// the entries into the reproducer output VFS YAML file.
908 void collectVFSFromYAML(
909  std::unique_ptr<llvm::MemoryBuffer> Buffer,
910  llvm::SourceMgr::DiagHandlerTy DiagHandler, StringRef YAMLFilePath,
911  SmallVectorImpl<YAMLVFSEntry> &CollectedEntries,
912  void *DiagContext = nullptr,
913  IntrusiveRefCntPtr<FileSystem> ExternalFS = getRealFileSystem());
914 
916  std::vector<YAMLVFSEntry> Mappings;
917  Optional<bool> IsCaseSensitive;
918  Optional<bool> IsOverlayRelative;
919  Optional<bool> UseExternalNames;
920  std::string OverlayDir;
921 
922  void addEntry(StringRef VirtualPath, StringRef RealPath, bool IsDirectory);
923 
924 public:
925  YAMLVFSWriter() = default;
926 
927  void addFileMapping(StringRef VirtualPath, StringRef RealPath);
928  void addDirectoryMapping(StringRef VirtualPath, StringRef RealPath);
929 
930  void setCaseSensitivity(bool CaseSensitive) {
931  IsCaseSensitive = CaseSensitive;
932  }
933 
934  void setUseExternalNames(bool UseExtNames) { UseExternalNames = UseExtNames; }
935 
936  void setOverlayDir(StringRef OverlayDirectory) {
937  IsOverlayRelative = true;
938  OverlayDir.assign(OverlayDirectory.str());
939  }
940 
941  const std::vector<YAMLVFSEntry> &getMappings() const { return Mappings; }
942 
943  void write(llvm::raw_ostream &OS);
944 };
945 
946 } // namespace vfs
947 } // namespace llvm
948 
949 #endif // LLVM_SUPPORT_VIRTUALFILESYSTEM_H
llvm::vfs::File::getBuffer
virtual llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > getBuffer(const Twine &Name, int64_t FileSize=-1, bool RequiresNullTerminator=true, bool IsVolatile=false)=0
Get the contents of the file as a MemoryBuffer.
llvm::vfs::RedirectingFileSystem::EK_File
@ EK_File
Definition: VirtualFileSystem.h:642
llvm::vfs::RedirectingFSDirIterImpl
Directory iterator implementation for RedirectingFileSystem's directory entries.
Definition: VirtualFileSystem.cpp:1096
llvm::vfs::InMemoryFileSystem::setCurrentWorkingDirectory
std::error_code setCurrentWorkingDirectory(const Twine &Path) override
Set the working directory.
Definition: VirtualFileSystem.cpp:1014
llvm::vfs::FileSystem::dir_begin
virtual directory_iterator dir_begin(const Twine &Dir, std::error_code &EC)=0
Get a directory_iterator for Dir.
LLVM_DUMP_METHOD
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition: Compiler.h:507
llvm::vfs::Status::isRegularFile
bool isRegularFile() const
Definition: VirtualFileSystem.cpp:100
llvm::vfs::RedirectingFileSystem::setCurrentWorkingDirectory
std::error_code setCurrentWorkingDirectory(const Twine &Path) override
Set the working directory.
Definition: VirtualFileSystem.cpp:1186
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:22
llvm::vfs::RedirectingFileSystem::DirectoryEntry::getLastContent
Entry * getLastContent() const
Definition: VirtualFileSystem.h:680
llvm::vfs::RedirectingFileSystem::getCurrentWorkingDirectory
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
Get the working directory of this file system.
Definition: VirtualFileSystem.cpp:1181
llvm::vfs::RedirectingFileSystem::RemapEntry::getUseName
NameKind getUseName() const
Definition: VirtualFileSystem.h:711
Optional.h
llvm::vfs::YAMLVFSWriter::YAMLVFSWriter
YAMLVFSWriter()=default
llvm::vfs::detail::DirIterImpl::CurrentEntry
directory_entry CurrentEntry
Definition: VirtualFileSystem.h:163
FileSystem.h
llvm::vfs::RedirectingFileSystem::RemapEntry::useExternalName
bool useExternalName(bool GlobalUseExternalName) const
Whether to use the external path as the name for this file or directory.
Definition: VirtualFileSystem.h:706
llvm::X86AS::FS
@ FS
Definition: X86.h:188
llvm::vfs::RedirectingFileSystem::DirectoryRemapEntry::classof
static bool classof(const Entry *E)
Definition: VirtualFileSystem.h:734
llvm::vfs::detail::NewInMemoryNodeInfo::Name
StringRef Name
Definition: VirtualFileSystem.h:428
llvm::vfs::ProxyFileSystem::dir_begin
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
Get a directory_iterator for Dir.
Definition: VirtualFileSystem.h:393
llvm::vfs::createPhysicalFileSystem
std::unique_ptr< FileSystem > createPhysicalFileSystem()
Create an vfs::FileSystem for the 'real' file system, as seen by the operating system.
Definition: VirtualFileSystem.cpp:362
llvm::vfs::InMemoryFileSystem::getCurrentWorkingDirectory
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
Get the working directory of this file system.
Definition: VirtualFileSystem.h:510
llvm::vfs::RedirectingFileSystem::LookupResult::E
Entry * E
The entry the looked-up path corresponds to.
Definition: VirtualFileSystem.h:751
llvm::vfs::RedirectingFileSystem::FileEntry::FileEntry
FileEntry(StringRef Name, StringRef ExternalContentsPath, NameKind UseName)
Definition: VirtualFileSystem.h:742
llvm::vfs::InMemoryFileSystem::dir_begin
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
Get a directory_iterator for Dir.
Definition: VirtualFileSystem.cpp:998
StringRef.h
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::vfs::recursive_directory_iterator::recursive_directory_iterator
recursive_directory_iterator()=default
Construct an 'end' iterator.
llvm::vfs::RedirectingFileSystem::DirectoryEntry::contents_begin
iterator contents_begin()
Definition: VirtualFileSystem.h:684
llvm::vfs::RedirectingFileSystem::setFallthrough
void setFallthrough(bool Fallthrough)
Definition: VirtualFileSystem.cpp:1311
llvm::vfs::ProxyFileSystem::getUnderlyingFS
FileSystem & getUnderlyingFS()
Definition: VirtualFileSystem.h:411
llvm::vfs::RedirectingFileSystem::DirectoryRemapEntry
A directory in the vfs that maps to a directory in the external file system.
Definition: VirtualFileSystem.h:728
llvm::vfs::directory_iterator::operator!=
bool operator!=(const directory_iterator &RHS) const
Definition: VirtualFileSystem.h:201
llvm::vfs::ProxyFileSystem::getRealPath
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) const override
Gets real path of Path e.g.
Definition: VirtualFileSystem.h:402
llvm::vfs::RedirectingFileSystem::create
static std::unique_ptr< RedirectingFileSystem > create(std::unique_ptr< MemoryBuffer > Buffer, SourceMgr::DiagHandlerTy DiagHandler, StringRef YAMLFilePath, void *DiagContext, IntrusiveRefCntPtr< FileSystem > ExternalFS)
Parses Buffer, which is expected to be in YAML format and returns a virtual file system representing ...
Definition: VirtualFileSystem.cpp:1816
llvm::SmallVector< IntrusiveRefCntPtr< FileSystem >, 1 >
llvm::vfs::Status::IsVFSMapped
bool IsVFSMapped
Definition: VirtualFileSystem.h:59
Path.h
llvm::vfs::InMemoryFileSystem::useNormalizedPaths
bool useNormalizedPaths() const
Return true if this file system normalizes . and .. in paths.
Definition: VirtualFileSystem.h:503
llvm::vfs::RedirectingFileSystem::NK_External
@ NK_External
Definition: VirtualFileSystem.h:643
llvm::vfs::InMemoryFileSystem::InMemoryFileSystem
InMemoryFileSystem(bool UseNormalizedPaths=true)
Definition: VirtualFileSystem.cpp:739
Content
T Content
Definition: ELFObjHandler.cpp:89
llvm::vfs::detail::DirIterImpl
An interface for virtual file systems to provide an iterator over the (non-recursive) contents of a d...
Definition: VirtualFileSystem.h:156
llvm::vfs::YAMLVFSEntry::VPath
std::string VPath
Definition: VirtualFileSystem.h:541
llvm::vfs::detail::DirIterImpl::~DirIterImpl
virtual ~DirIterImpl()
llvm::vfs::InMemoryFileSystem::getRealPath
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) const override
Canonicalizes Path by combining with the current working directory and normalizing the path (e....
Definition: VirtualFileSystem.cpp:1032
llvm::vfs::detail::NewInMemoryNodeInfo
Definition: VirtualFileSystem.h:425
llvm::vfs::RedirectingFileSystem::Entry::getName
StringRef getName() const
Definition: VirtualFileSystem.h:654
llvm::vfs::FileSystem::status
virtual llvm::ErrorOr< Status > status(const Twine &Path)=0
Get the status of the entry at Path, if one exists.
llvm::vfs::FileSystem::setCurrentWorkingDirectory
virtual std::error_code setCurrentWorkingDirectory(const Twine &Path)=0
Set the working directory.
llvm::vfs::RedirectingFileSystem::FileEntry
A file in the vfs that maps to a file in the external file system.
Definition: VirtualFileSystem.h:740
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::vfs::OverlayFileSystem::overlays_rend
reverse_iterator overlays_rend()
Get an iterator pointing one-past the most recently added file system.
Definition: VirtualFileSystem.h:374
llvm::vfs::directory_iterator
An input iterator over the entries in a virtual path, similar to llvm::sys::fs::directory_iterator.
Definition: VirtualFileSystem.h:170
llvm::vfs::OverlayFileSystem::getCurrentWorkingDirectory
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
Get the working directory of this file system.
Definition: VirtualFileSystem.cpp:433
T1
#define T1
Definition: Mips16ISelLowering.cpp:340
llvm::vfs::OverlayFileSystem::overlays_rbegin
const_reverse_iterator overlays_rbegin() const
Definition: VirtualFileSystem.h:371
llvm::vfs::ProxyFileSystem::isLocal
std::error_code isLocal(const Twine &Path, bool &Result) override
Is the file mounted on a local filesystem?
Definition: VirtualFileSystem.h:406
llvm::Optional< uint32_t >
llvm::vfs::Status::getSize
uint64_t getSize() const
Definition: VirtualFileSystem.h:86
llvm::vfs::recursive_directory_iterator::level
int level() const
Gets the current level. Starting path is at level 0.
Definition: VirtualFileSystem.h:246
llvm::vfs::detail::NewInMemoryNodeInfo::Perms
llvm::sys::fs::perms Perms
Definition: VirtualFileSystem.h:434
llvm::vfs::RedirectingFileSystem::EK_Directory
@ EK_Directory
Definition: VirtualFileSystem.h:642
RHS
Value * RHS
Definition: X86PartialReduction.cpp:74
llvm::vfs::Status
The result of a status operation.
Definition: VirtualFileSystem.h:47
IntrusiveRefCntPtr.h
llvm::vfs::detail::NewInMemoryNodeInfo::DirUID
llvm::sys::fs::UniqueID DirUID
Definition: VirtualFileSystem.h:426
llvm::vfs::RedirectingFileSystem::openFileForRead
ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
Get a File object for the file at Path, if one exists.
Definition: VirtualFileSystem.cpp:2106
llvm::MemoryBufferRef
Definition: MemoryBufferRef.h:22
llvm::vfs::OverlayFileSystem::getRealPath
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) const override
Gets real path of Path e.g.
Definition: VirtualFileSystem.cpp:454
llvm::vfs::detail::NewInMemoryNodeInfo::User
uint32_t User
Definition: VirtualFileSystem.h:431
llvm::vfs::RedirectingFileSystem
A virtual file system parsed from a YAML file.
Definition: VirtualFileSystem.h:640
llvm::vfs::RedirectingFileSystem::Entry::Entry
Entry(EntryKind K, StringRef Name)
Definition: VirtualFileSystem.h:651
llvm::vfs::RedirectingFileSystem::isLocal
std::error_code isLocal(const Twine &Path, bool &Result) override
Is the file mounted on a local filesystem?
Definition: VirtualFileSystem.cpp:1199
llvm::vfs::FileSystem::isLocal
virtual std::error_code isLocal(const Twine &Path, bool &Result)
Is the file mounted on a local filesystem?
Definition: VirtualFileSystem.cpp:145
llvm::sys::TimePoint
std::chrono::time_point< std::chrono::system_clock, D > TimePoint
A time point on the system clock.
Definition: Chrono.h:34
llvm::vfs::OverlayFileSystem::overlays_end
iterator overlays_end()
Get an iterator pointing one-past the least recently added file system.
Definition: VirtualFileSystem.h:366
Chrono.h
llvm::vfs::OverlayFileSystem::iterator
FileSystemList::reverse_iterator iterator
Definition: VirtualFileSystem.h:356
Mappings
Inject TLI Mappings
Definition: InjectTLIMappings.cpp:172
llvm::vfs::directory_entry::directory_entry
directory_entry(std::string Path, llvm::sys::fs::file_type Type)
Definition: VirtualFileSystem.h:145
llvm::vfs::Status::getPermissions
llvm::sys::fs::perms getPermissions() const
Definition: VirtualFileSystem.h:81
llvm::vfs::OverlayFileSystem::status
llvm::ErrorOr< Status > status(const Twine &Path) override
Get the status of the entry at Path, if one exists.
Definition: VirtualFileSystem.cpp:411
llvm::vfs::RedirectingFileSystem::getRealPath
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) const override
Gets real path of Path e.g.
Definition: VirtualFileSystem.cpp:2154
llvm::orc::tpctypes::LookupResult
std::vector< JITTargetAddress > LookupResult
Definition: TargetProcessControlTypes.h:119
llvm::vfs::Status::copyWithNewName
static Status copyWithNewName(const Status &In, const Twine &NewName)
Get a copy of a Status with a different name.
Definition: VirtualFileSystem.cpp:81
llvm::vfs::recursive_directory_iterator::operator==
bool operator==(const recursive_directory_iterator &Other) const
Definition: VirtualFileSystem.h:238
llvm::vfs::detail::RecDirIterState::HasNoPushRequest
bool HasNoPushRequest
Definition: VirtualFileSystem.h:213
llvm::vfs::YAMLVFSWriter
Definition: VirtualFileSystem.h:915
llvm::vfs::RedirectingFileSystem::RemapEntry::getExternalContentsPath
StringRef getExternalContentsPath() const
Definition: VirtualFileSystem.h:703
llvm::vfs::RedirectingFileSystem::DirectoryEntry::DirectoryEntry
DirectoryEntry(StringRef Name, std::vector< std::unique_ptr< Entry >> Contents, Status S)
Constructs a directory entry with explicitly specified contents.
Definition: VirtualFileSystem.h:665
llvm::vfs::FileSystem::getBufferForFile
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > getBufferForFile(const Twine &Name, int64_t FileSize=-1, bool RequiresNullTerminator=true, bool IsVolatile=false)
This is a convenience method that opens a file, gets its content and then closes the file.
Definition: VirtualFileSystem.cpp:119
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::User
Definition: User.h:44
llvm::vfs::collectVFSFromYAML
void collectVFSFromYAML(std::unique_ptr< llvm::MemoryBuffer > Buffer, llvm::SourceMgr::DiagHandlerTy DiagHandler, StringRef YAMLFilePath, SmallVectorImpl< YAMLVFSEntry > &CollectedEntries, void *DiagContext=nullptr, IntrusiveRefCntPtr< FileSystem > ExternalFS=getRealFileSystem())
Collect all pairs of <virtual path, real path> entries from the YAMLFilePath.
llvm::vfs::detail::NewInMemoryNodeInfo::Buffer
std::unique_ptr< llvm::MemoryBuffer > Buffer
Definition: VirtualFileSystem.h:430
llvm::vfs::directory_iterator::increment
directory_iterator & increment(std::error_code &EC)
Equivalent to operator++, with an error code.
Definition: VirtualFileSystem.h:185
llvm::sys::fs::file_type::status_error
@ status_error
llvm::vfs::OverlayFileSystem::overlays_begin
iterator overlays_begin()
Get an iterator pointing to the most recently added file system.
Definition: VirtualFileSystem.h:362
llvm::vfs::FileSystem::openFileForRead
virtual llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path)=0
Get a File object for the file at Path, if one exists.
llvm::vfs::detail::DirIterImpl::increment
virtual std::error_code increment()=0
Sets CurrentEntry to the next entry in the directory on success, to directory_entry() at end,...
llvm::vfs::RedirectingFileSystem::LookupResult::getExternalRedirect
Optional< StringRef > getExternalRedirect() const
If the found Entry maps the the input path to a path in the external file system (i....
Definition: VirtualFileSystem.h:766
llvm::vfs::ProxyFileSystem::setCurrentWorkingDirectory
std::error_code setCurrentWorkingDirectory(const Twine &Path) override
Set the working directory.
Definition: VirtualFileSystem.h:399
llvm::vfs::InMemoryFileSystem::~InMemoryFileSystem
~InMemoryFileSystem() override
llvm::vfs::OverlayFileSystem::overlays_rend
const_reverse_iterator overlays_rend() const
Definition: VirtualFileSystem.h:375
llvm::ThreadSafeRefCountedBase
A thread-safe version of RefCountedBase.
Definition: IntrusiveRefCntPtr.h:101
llvm::vfs::RedirectingFileSystem::DirectoryEntry::addContent
void addContent(std::unique_ptr< Entry > Content)
Definition: VirtualFileSystem.h:676
llvm::vfs::directory_entry::path
llvm::StringRef path() const
Definition: VirtualFileSystem.h:148
llvm::vfs::RedirectingFileSystem::Entry::getKind
EntryKind getKind() const
Definition: VirtualFileSystem.h:655
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::vfs::OverlayFileSystem::overlays_rbegin
reverse_iterator overlays_rbegin()
Get an iterator pointing to the least recently added file system.
Definition: VirtualFileSystem.h:370
llvm::vfs::RedirectingFileSystem::RemapEntry::RemapEntry
RemapEntry(EntryKind K, StringRef Name, StringRef ExternalContentsPath, NameKind UseName)
Definition: VirtualFileSystem.h:697
llvm::vfs::FileSystem::exists
bool exists(const Twine &Path)
Check whether a file exists. Provided for convenience.
Definition: VirtualFileSystem.cpp:149
STLFunctionalExtras.h
llvm::vfs::getVFSFromYAML
std::unique_ptr< FileSystem > getVFSFromYAML(std::unique_ptr< llvm::MemoryBuffer > Buffer, llvm::SourceMgr::DiagHandlerTy DiagHandler, StringRef YAMLFilePath, void *DiagContext=nullptr, IntrusiveRefCntPtr< FileSystem > ExternalFS=getRealFileSystem())
Gets a FileSystem for a virtual file system described in YAML format.
llvm::sys::fs::file_type
file_type
An enumeration for the file system's view of the type.
Definition: FileSystem.h:66
llvm::vfs::RedirectingFileSystem::DirectoryEntry::iterator
decltype(Contents)::iterator iterator
Definition: VirtualFileSystem.h:682
llvm::vfs::directory_entry
A member of a directory, yielded by a directory_iterator.
Definition: VirtualFileSystem.h:139
llvm::StringRef::str
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:245
llvm::InstrProfKind::FE
@ FE
llvm::None
const NoneType None
Definition: None.h:23
llvm::vfs::RedirectingFileSystem::RemapEntry::classof
static bool classof(const Entry *E)
Definition: VirtualFileSystem.h:713
SourceMgr.h
llvm::StringRef::equals
LLVM_NODISCARD bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
Definition: StringRef.h:187
llvm::vfs::recursive_directory_iterator::no_push
void no_push()
Definition: VirtualFileSystem.h:252
llvm::vfs::RedirectingFileSystem::getExternalContentsPrefixDir
StringRef getExternalContentsPrefixDir() const
Definition: VirtualFileSystem.cpp:1307
llvm::vfs::File::getName
virtual llvm::ErrorOr< std::string > getName()
Get the name of the file.
Definition: VirtualFileSystem.h:113
llvm::vfs::YAMLVFSEntry::IsDirectory
bool IsDirectory
Definition: VirtualFileSystem.h:543
llvm::sys::path::is_style_posix
constexpr bool is_style_posix(Style S)
Check if S uses POSIX path rules.
Definition: Path.h:37
llvm::vfs::Status::isOther
bool isOther() const
Definition: VirtualFileSystem.cpp:102
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
llvm::tgtok::In
@ In
Definition: TGLexer.h:51
llvm::sys::fs::file_type::type_unknown
@ type_unknown
llvm::vfs::RedirectingFileSystem::EntryKind
EntryKind
Definition: VirtualFileSystem.h:642
llvm::sys::fs::UniqueID
Definition: UniqueID.h:26
llvm::sys::fs::file_status
Represents the result of a call to sys::fs::status().
Definition: FileSystem.h:226
llvm::vfs::Status::getName
StringRef getName() const
Returns the name that should be used for this file or directory.
Definition: VirtualFileSystem.h:76
llvm::vfs::getRealFileSystem
IntrusiveRefCntPtr< FileSystem > getRealFileSystem()
Gets an vfs::FileSystem for the 'real' file system, as seen by the operating system.
Definition: VirtualFileSystem.cpp:357
llvm::vfs::FileSystem::getCurrentWorkingDirectory
virtual llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const =0
Get the working directory of this file system.
llvm::vfs::Status::getUser
uint32_t getUser() const
Definition: VirtualFileSystem.h:84
llvm::StringRef::equals_insensitive
LLVM_NODISCARD bool equals_insensitive(StringRef RHS) const
Check for string equality, ignoring case.
Definition: StringRef.h:194
llvm::vfs::YAMLVFSEntry
Definition: VirtualFileSystem.h:536
llvm::vfs::ProxyFileSystem::status
llvm::ErrorOr< Status > status(const Twine &Path) override
Get the status of the entry at Path, if one exists.
Definition: VirtualFileSystem.h:386
llvm::vfs::recursive_directory_iterator::increment
recursive_directory_iterator & increment(std::error_code &EC)
Equivalent to operator++, with an error code.
Definition: VirtualFileSystem.cpp:2457
llvm::vfs::OverlayFileSystem::const_reverse_iterator
FileSystemList::const_iterator const_reverse_iterator
Definition: VirtualFileSystem.h:359
llvm::vfs::RedirectingFileSystem::NameKind
NameKind
Definition: VirtualFileSystem.h:643
uint64_t
llvm::vfs::Status::copyWithNewSize
static Status copyWithNewSize(const Status &In, uint64_t NewSize)
Get a copy of a Status with a different size.
Definition: VirtualFileSystem.cpp:75
llvm::vfs::File::setPath
virtual void setPath(const Twine &Path)
Definition: VirtualFileSystem.h:134
llvm::vfs::RedirectingFileSystem::RemapEntry
A file or directory in the vfs that is mapped to a file or directory in the external filesystem.
Definition: VirtualFileSystem.h:692
llvm::vfs::RedirectingFileSystem::DirectoryEntry::DirectoryEntry
DirectoryEntry(StringRef Name, Status S)
Constructs an empty directory entry.
Definition: VirtualFileSystem.h:671
llvm::vfs::File::getWithPath
static ErrorOr< std::unique_ptr< File > > getWithPath(ErrorOr< std::unique_ptr< File >> Result, const Twine &P)
Definition: VirtualFileSystem.cpp:2094
llvm::vfs::detail::NewInMemoryNodeInfo::Type
llvm::sys::fs::file_type Type
Definition: VirtualFileSystem.h:433
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::vfs::Status::isDirectory
bool isDirectory() const
Definition: VirtualFileSystem.cpp:98
llvm::vfs::RedirectingFileSystem::DirectoryEntry::contents_end
iterator contents_end()
Definition: VirtualFileSystem.h:685
llvm::vfs::InMemoryFileSystem::toString
std::string toString() const
Definition: VirtualFileSystem.cpp:749
ErrorOr.h
llvm::SourceMgr::DiagHandlerTy
void(*)(const SMDiagnostic &, void *Context) DiagHandlerTy
Clients that want to handle their own diagnostics in a custom way can register a function pointer+con...
Definition: SourceMgr.h:43
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::vfs::RedirectingFileSystem::dir_begin
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
Get a directory_iterator for Dir.
Definition: VirtualFileSystem.cpp:1247
llvm::sys::path::Style::native
@ native
llvm::SmallVectorImpl< IntrusiveRefCntPtr< FileSystem > >::const_iterator
typename SuperClass::const_iterator const_iterator
Definition: SmallVector.h:558
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::vfs::RedirectingFileSystem::setExternalContentsPrefixDir
void setExternalContentsPrefixDir(StringRef PrefixDir)
Definition: VirtualFileSystem.cpp:1303
llvm::vfs::YAMLVFSEntry::YAMLVFSEntry
YAMLVFSEntry(T1 &&VPath, T2 &&RPath, bool IsDirectory=false)
Definition: VirtualFileSystem.h:538
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1650
llvm::vfs::ProxyFileSystem::openFileForRead
llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
Get a File object for the file at Path, if one exists.
Definition: VirtualFileSystem.h:390
llvm::vfs::OverlayFileSystem::overlays_end
const_iterator overlays_end() const
Definition: VirtualFileSystem.h:367
llvm::vfs::RedirectingFileSystemParser
A helper class to hold the common YAML parsing state.
Definition: VirtualFileSystem.cpp:1351
llvm::vfs::InMemoryFileSystem::status
llvm::ErrorOr< Status > status(const Twine &Path) override
Get the status of the entry at Path, if one exists.
Definition: VirtualFileSystem.cpp:926
llvm::vfs::directory_iterator::directory_iterator
directory_iterator()=default
Construct an 'end' iterator.
llvm::vfs::detail::NewInMemoryNodeInfo::Group
uint32_t Group
Definition: VirtualFileSystem.h:432
llvm::vfs::getNextVirtualUniqueID
llvm::sys::fs::UniqueID getNextVirtualUniqueID()
Get a globally unique ID for a virtual file or directory.
Definition: VirtualFileSystem.cpp:2251
llvm::vfs::YAMLVFSWriter::setCaseSensitivity
void setCaseSensitivity(bool CaseSensitive)
Definition: VirtualFileSystem.h:930
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
None.h
DiagHandler
static void DiagHandler(const SMDiagnostic &Diag, void *Context)
Definition: TextStub.cpp:1094
llvm::vfs::RedirectingFileSystem::getRoots
std::vector< llvm::StringRef > getRoots() const
Definition: VirtualFileSystem.cpp:1315
llvm::vfs::RedirectingFileSystem::DirectoryEntry
A directory in the vfs with explicitly specified contents.
Definition: VirtualFileSystem.h:659
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:134
uint32_t
llvm::vfs::RedirectingFileSystem::dump
LLVM_DUMP_METHOD void dump() const
Definition: VirtualFileSystem.cpp:1347
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::vfs::Status::getUniqueID
llvm::sys::fs::UniqueID getUniqueID() const
Definition: VirtualFileSystem.h:83
llvm::vfs::OverlayFileSystem
A file system that allows overlaying one AbstractFileSystem on top of another.
Definition: VirtualFileSystem.h:333
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsVolatile
constexpr char IsVolatile[]
Key for Kernel::Arg::Metadata::mIsVolatile.
Definition: AMDGPUMetadata.h:194
llvm::vfs::detail::NewInMemoryNodeInfo::Path
StringRef Path
Definition: VirtualFileSystem.h:427
llvm::vfs::YAMLVFSWriter::write
void write(llvm::raw_ostream &OS)
Definition: VirtualFileSystem.cpp:2437
LLVM_FALLTHROUGH
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Definition: Compiler.h:287
llvm::vfs::InMemoryFileSystem::addHardLink
bool addHardLink(const Twine &From, const Twine &To)
Add a hard link to a file.
Definition: VirtualFileSystem.cpp:911
llvm::sys::path::const_iterator
Path iterator.
Definition: Path.h:74
llvm::vfs::File
Represents an open file.
Definition: VirtualFileSystem.h:102
llvm::vfs::directory_entry::type
llvm::sys::fs::file_type type() const
Definition: VirtualFileSystem.h:149
llvm::vfs::recursive_directory_iterator::operator!=
bool operator!=(const recursive_directory_iterator &RHS) const
Definition: VirtualFileSystem.h:241
llvm::vfs::YAMLVFSWriter::setOverlayDir
void setOverlayDir(StringRef OverlayDirectory)
Definition: VirtualFileSystem.h:936
llvm::vfs::directory_iterator::directory_iterator
directory_iterator(std::shared_ptr< detail::DirIterImpl > I)
Definition: VirtualFileSystem.h:174
llvm::vfs::Status::isSymlink
bool isSymlink() const
Definition: VirtualFileSystem.cpp:106
llvm::vfs::InMemoryFileSystem::addFileNoOwn
bool addFileNoOwn(const Twine &Path, time_t ModificationTime, const llvm::MemoryBufferRef &Buffer, Optional< uint32_t > User=None, Optional< uint32_t > Group=None, Optional< llvm::sys::fs::file_type > Type=None, Optional< llvm::sys::fs::perms > Perms=None)
Add a buffer to the VFS with a path.
Definition: VirtualFileSystem.cpp:848
llvm::vfs::RedirectingFileSystem::DirectoryEntry::classof
static bool classof(const Entry *E)
Definition: VirtualFileSystem.h:687
llvm::vfs::RedirectingFileSystem::dumpEntry
void dumpEntry(raw_ostream &OS, Entry *E, int NumSpaces=0) const
Definition: VirtualFileSystem.cpp:1327
llvm::vfs::recursive_directory_iterator
An input iterator over the recursive contents of a virtual path, similar to llvm::sys::fs::recursive_...
Definition: VirtualFileSystem.h:220
llvm::vfs::OverlayFileSystem::reverse_iterator
FileSystemList::iterator reverse_iterator
Definition: VirtualFileSystem.h:358
llvm::vfs::YAMLVFSWriter::setUseExternalNames
void setUseExternalNames(bool UseExtNames)
Definition: VirtualFileSystem.h:934
llvm::vfs::File::close
virtual std::error_code close()=0
Closes the file.
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::vfs::RedirectingFileSystem::DirectoryRemapEntry::DirectoryRemapEntry
DirectoryRemapEntry(StringRef Name, StringRef ExternalContentsPath, NameKind UseName)
Definition: VirtualFileSystem.h:730
llvm::vfs::OverlayFileSystem::const_iterator
FileSystemList::const_reverse_iterator const_iterator
Definition: VirtualFileSystem.h:357
llvm::vfs::RedirectingFileSystem::EK_DirectoryRemap
@ EK_DirectoryRemap
Definition: VirtualFileSystem.h:642
llvm::vfs::FileSystem
The virtual file system interface.
Definition: VirtualFileSystem.h:256
llvm::vfs::OverlayFileSystem::overlays_begin
const_iterator overlays_begin() const
Definition: VirtualFileSystem.h:363
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
std
Definition: BitVector.h:850
llvm::vfs::RedirectingFileSystem::DirectoryEntry::getStatus
Status getStatus()
Definition: VirtualFileSystem.h:674
llvm::vfs::InMemoryFileSystem
An in-memory file system.
Definition: VirtualFileSystem.h:442
llvm::vfs::directory_iterator::operator->
const directory_entry * operator->() const
Definition: VirtualFileSystem.h:194
llvm::vfs::RedirectingFileSystem::LookupResult::LookupResult
LookupResult(Entry *E, sys::path::const_iterator Start, sys::path::const_iterator End)
Definition: VirtualFileSystem.cpp:1911
llvm::vfs::directory_entry::directory_entry
directory_entry()=default
llvm::vfs::ProxyFileSystem::getCurrentWorkingDirectory
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
Get the working directory of this file system.
Definition: VirtualFileSystem.h:396
llvm::vfs::recursive_directory_iterator::operator->
const directory_entry * operator->() const
Definition: VirtualFileSystem.h:236
llvm::vfs::RedirectingFileSystem::lookupPath
ErrorOr< LookupResult > lookupPath(StringRef Path) const
Looks up Path in Roots and returns a LookupResult giving the matched entry and, if the entry was a Fi...
Definition: VirtualFileSystem.cpp:1948
llvm::vfs::OverlayFileSystem::dir_begin
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
Get a directory_iterator for Dir.
Definition: VirtualFileSystem.cpp:547
llvm::vfs::RedirectingFileSystem::NK_Virtual
@ NK_Virtual
Definition: VirtualFileSystem.h:643
llvm::vfs::directory_iterator::operator*
const directory_entry & operator*() const
Definition: VirtualFileSystem.h:193
llvm::vfs::RedirectingFileSystem::NK_NotSet
@ NK_NotSet
Definition: VirtualFileSystem.h:643
llvm::vfs::File::status
virtual llvm::ErrorOr< Status > status()=0
Get the status of the file.
llvm::vfs::YAMLVFSWriter::addFileMapping
void addFileMapping(StringRef VirtualPath, StringRef RealPath)
Definition: VirtualFileSystem.cpp:2267
llvm::vfs::detail::RecDirIterState::Stack
std::stack< directory_iterator, std::vector< directory_iterator > > Stack
Definition: VirtualFileSystem.h:212
llvm::vfs::OverlayFileSystem::setCurrentWorkingDirectory
std::error_code setCurrentWorkingDirectory(const Twine &Path) override
Set the working directory.
Definition: VirtualFileSystem.cpp:439
llvm::vfs::ProxyFileSystem
By default, this delegates all calls to the underlying file system.
Definition: VirtualFileSystem.h:381
llvm::vfs::Status::exists
bool exists() const
Definition: VirtualFileSystem.cpp:110
llvm::vfs::InMemoryFileSystem::isLocal
std::error_code isLocal(const Twine &Path, bool &Result) override
Is the file mounted on a local filesystem?
Definition: VirtualFileSystem.cpp:1044
llvm::vfs::File::~File
virtual ~File()
Destroy the file after closing it (if open).
llvm::vfs::OverlayFileSystem::pushOverlay
void pushOverlay(IntrusiveRefCntPtr< FileSystem > FS)
Pushes a file system on top of the stack.
Definition: VirtualFileSystem.cpp:404
llvm::vfs::Status::getLastModificationTime
llvm::sys::TimePoint getLastModificationTime() const
Definition: VirtualFileSystem.h:82
llvm::vfs::OverlayFileSystem::openFileForRead
llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
Get a File object for the file at Path, if one exists.
Definition: VirtualFileSystem.cpp:422
llvm::sys::fs::perms
perms
Definition: FileSystem.h:86
SmallVector.h
llvm::vfs::YAMLVFSWriter::getMappings
const std::vector< YAMLVFSEntry > & getMappings() const
Definition: VirtualFileSystem.h:941
llvm::vfs::RedirectingFileSystem::FileEntry::classof
static bool classof(const Entry *E)
Definition: VirtualFileSystem.h:745
llvm::vfs::YAMLVFSEntry::RPath
std::string RPath
Definition: VirtualFileSystem.h:542
llvm::SmallVectorImpl< IntrusiveRefCntPtr< FileSystem > >::iterator
typename SuperClass::iterator iterator
Definition: SmallVector.h:557
llvm::sys::fs::status
std::error_code status(const Twine &path, file_status &result, bool follow=true)
Get file status as if by POSIX stat().
llvm::ErrorOr
Represents either an error or a value T.
Definition: ErrorOr.h:56
llvm::vfs::RedirectingFileSystem::LookupResult
Represents the result of a path lookup into the RedirectingFileSystem.
Definition: VirtualFileSystem.h:749
llvm::vfs::YAMLVFSWriter::addDirectoryMapping
void addDirectoryMapping(StringRef VirtualPath, StringRef RealPath)
Definition: VirtualFileSystem.cpp:2271
llvm::vfs::Status::getType
llvm::sys::fs::file_type getType() const
Definition: VirtualFileSystem.h:80
llvm::vfs::detail::RecDirIterState
Keeps state for the recursive_directory_iterator.
Definition: VirtualFileSystem.h:211
llvm::vfs::directory_iterator::operator==
bool operator==(const directory_iterator &RHS) const
Definition: VirtualFileSystem.h:196
llvm::vfs::recursive_directory_iterator::operator*
const directory_entry & operator*() const
Definition: VirtualFileSystem.h:235
llvm::vfs::Status::getGroup
uint32_t getGroup() const
Definition: VirtualFileSystem.h:85
llvm::SmallVectorImpl< char >
llvm::vfs::FileSystem::getRealPath
virtual std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) const
Gets real path of Path e.g.
Definition: VirtualFileSystem.cpp:140
llvm::vfs::FileSystem::makeAbsolute
virtual std::error_code makeAbsolute(SmallVectorImpl< char > &Path) const
Make Path an absolute path.
Definition: VirtualFileSystem.cpp:128
llvm::vfs::detail::NewInMemoryNodeInfo::ModificationTime
time_t ModificationTime
Definition: VirtualFileSystem.h:429
llvm::vfs::ProxyFileSystem::ProxyFileSystem
ProxyFileSystem(IntrusiveRefCntPtr< FileSystem > FS)
Definition: VirtualFileSystem.h:383
From
BlockVerifier::State From
Definition: BlockVerifier.cpp:55
llvm::vfs::RedirectingFileSystem::makeAbsolute
std::error_code makeAbsolute(SmallVectorImpl< char > &Path) const override
Make Path an absolute path.
Definition: VirtualFileSystem.cpp:1210
llvm::vfs::Status::equivalent
bool equivalent(const Status &Other) const
Definition: VirtualFileSystem.cpp:93
llvm::vfs::OverlayFileSystem::isLocal
std::error_code isLocal(const Twine &Path, bool &Result) override
Is the file mounted on a local filesystem?
Definition: VirtualFileSystem.cpp:446
llvm::vfs::InMemoryFileSystem::openFileForRead
llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
Get a File object for the file at Path, if one exists.
Definition: VirtualFileSystem.cpp:934
llvm::vfs::detail::NewInMemoryNodeInfo::makeStatus
Status makeStatus() const
Definition: VirtualFileSystem.cpp:729
llvm::vfs::Status::isStatusKnown
bool isStatusKnown() const
Definition: VirtualFileSystem.cpp:108
llvm::IntrusiveRefCntPtr
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
Definition: IntrusiveRefCntPtr.h:163
llvm::vfs::Status::Status
Status()=default
llvm::sampleprof::Base
@ Base
Definition: Discriminator.h:58
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1198
llvm::vfs::RedirectingFileSystem::Entry
A single file or directory in the VFS.
Definition: VirtualFileSystem.h:646
llvm::vfs::FileSystem::~FileSystem
virtual ~FileSystem()
llvm::vfs::RedirectingFileSystem::Entry::~Entry
virtual ~Entry()=default
llvm::vfs::OverlayFileSystem::OverlayFileSystem
OverlayFileSystem(IntrusiveRefCntPtr< FileSystem > Base)
Definition: VirtualFileSystem.cpp:400