Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.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
17#include "llvm/ADT/IntrusiveRefCntPtr.h"
18#include "llvm/ADT/STLFunctionalExtras.h"
19#include "llvm/ADT/SmallVector.h"
20#include "llvm/ADT/StringRef.h"
21#include "llvm/Support/Chrono.h"
22#include "llvm/Support/Errc.h"
23#include "llvm/Support/Error.h"
24#include "llvm/Support/ErrorOr.h"
25#include "llvm/Support/ExtensibleRTTI.h"
26#include "llvm/Support/FileSystem.h"
27#include "llvm/Support/Path.h"
28#include "llvm/Support/SourceMgr.h"
29#include <cassert>
30#include <cstdint>
31#include <ctime>
32#include <memory>
33#include <optional>
34#include <string>
35#include <system_error>
36#include <utility>
37#include <vector>
38
39namespacellvm {
40
41classMemoryBuffer;
42classMemoryBufferRef;
43classTwine;
44
45namespacevfs {
46
47/// The result of a \p status operation.
48classStatus {
49 std::string Name;
50llvm::sys::fs::UniqueID UID;
51llvm::sys::TimePoint<> MTime;
52uint32_tUser;
53uint32_t Group;
54uint64_t Size;
55llvm::sys::fs::file_typeType =llvm::sys::fs::file_type::status_error;
56llvm::sys::fs::perms Perms;
57
58public:
59 /// Whether this entity has an external path different from the virtual path,
60 /// and the external path is exposed by leaking it through the abstraction.
61 /// For example, a RedirectingFileSystem will set this for paths where
62 /// UseExternalName is true.
63 ///
64 /// FIXME: Currently the external path is exposed by replacing the virtual
65 /// path in this Status object. Instead, we should leave the path in the
66 /// Status intact (matching the requested virtual path) - see
67 /// FileManager::getFileRef for how we plan to fix this.
68boolExposesExternalVFSPath =false;
69
70Status() =default;
71Status(constllvm::sys::fs::file_status &Status);
72Status(constTwine &Name,llvm::sys::fs::UniqueID UID,
73llvm::sys::TimePoint<> MTime,uint32_tUser,uint32_t Group,
74uint64_t Size,llvm::sys::fs::file_typeType,
75llvm::sys::fs::perms Perms);
76
77 /// Get a copy of a Status with a different size.
78staticStatuscopyWithNewSize(constStatus &In,uint64_t NewSize);
79 /// Get a copy of a Status with a different name.
80staticStatuscopyWithNewName(constStatus &In,constTwine &NewName);
81staticStatuscopyWithNewName(constllvm::sys::fs::file_status &In,
82constTwine &NewName);
83
84 /// Returns the name that should be used for this file or directory.
85StringRefgetName() const{return Name; }
86
87 /// @name Status interface from llvm::sys::fs
88 /// @{
89llvm::sys::fs::file_typegetType() const{returnType; }
90llvm::sys::fs::permsgetPermissions() const{return Perms; }
91llvm::sys::TimePoint<>getLastModificationTime() const{return MTime; }
92llvm::sys::fs::UniqueIDgetUniqueID() const{return UID; }
93uint32_tgetUser() const{returnUser; }
94uint32_tgetGroup() const{return Group; }
95uint64_tgetSize() const{return Size; }
96 /// @}
97 /// @name Status queries
98 /// These are static queries in llvm::sys::fs.
99 /// @{
100boolequivalent(constStatus &Other)const;
101boolisDirectory()const;
102boolisRegularFile()const;
103boolisOther()const;
104boolisSymlink()const;
105boolisStatusKnown()const;
106boolexists()const;
107 /// @}
108};
109
110/// Represents an open file.
111classFile {
112public:
113 /// Destroy the file after closing it (if open).
114 /// Sub-classes should generally call close() inside their destructors. We
115 /// cannot do that from the base class, since close is virtual.
116virtual~File();
117
118 /// Get the status of the file.
119virtualllvm::ErrorOr<Status>status() = 0;
120
121 /// Get the name of the file
122virtualllvm::ErrorOr<std::string>getName() {
123if (autoStatus =status())
124returnStatus->getName().str();
125else
126returnStatus.getError();
127 }
128
129 /// Get the contents of the file as a \p MemoryBuffer.
130virtualllvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
131getBuffer(constTwine &Name, int64_t FileSize = -1,
132bool RequiresNullTerminator =true,bool IsVolatile =false) = 0;
133
134 /// Closes the file.
135virtual std::error_codeclose() = 0;
136
137// Get the same file with a different path.
138staticErrorOr<std::unique_ptr<File>>
139getWithPath(ErrorOr<std::unique_ptr<File>> Result,constTwine &P);
140
141protected:
142// Set the file's underlying path.
143virtualvoidsetPath(constTwine &Path) {}
144};
145
146/// A member of a directory, yielded by a directory_iterator.
147/// Only information available on most platforms is included.
148classdirectory_entry {
149 std::string Path;
150llvm::sys::fs::file_typeType =llvm::sys::fs::file_type::type_unknown;
151
152public:
153directory_entry() =default;
154directory_entry(std::string Path,llvm::sys::fs::file_typeType)
155 : Path(std::move(Path)),Type(Type) {}
156
157llvm::StringRefpath() const{return Path; }
158llvm::sys::fs::file_typetype() const{returnType; }
159};
160
161namespacedetail {
162
163/// An interface for virtual file systems to provide an iterator over the
164/// (non-recursive) contents of a directory.
165structDirIterImpl {
166virtual~DirIterImpl();
167
168 /// Sets \c CurrentEntry to the next entry in the directory on success,
169 /// to directory_entry() at end, or returns a system-defined \c error_code.
170virtual std::error_codeincrement() = 0;
171
172directory_entryCurrentEntry;
173};
174
175}// namespace detail
176
177/// An input iterator over the entries in a virtual path, similar to
178/// llvm::sys::fs::directory_iterator.
179classdirectory_iterator {
180 std::shared_ptr<detail::DirIterImpl> Impl;// Input iterator semantics on copy
181
182public:
183directory_iterator(std::shared_ptr<detail::DirIterImpl>I)
184 : Impl(std::move(I)) {
185assert(Impl.get() !=nullptr &&"requires non-null implementation");
186if (Impl->CurrentEntry.path().empty())
187 Impl.reset();// Normalize the end iterator to Impl == nullptr.
188 }
189
190 /// Construct an 'end' iterator.
191directory_iterator() =default;
192
193 /// Equivalent to operator++, with an error code.
194directory_iterator &increment(std::error_code &EC) {
195assert(Impl &&"attempting to increment past end");
196 EC = Impl->increment();
197if (Impl->CurrentEntry.path().empty())
198 Impl.reset();// Normalize the end iterator to Impl == nullptr.
199return *this;
200 }
201
202constdirectory_entry &operator*() const{return Impl->CurrentEntry; }
203constdirectory_entry *operator->() const{return &Impl->CurrentEntry; }
204
205booloperator==(constdirectory_iterator &RHS) const{
206if (Impl &&RHS.Impl)
207return Impl->CurrentEntry.path() ==RHS.Impl->CurrentEntry.path();
208return !Impl && !RHS.Impl;
209 }
210booloperator!=(constdirectory_iterator &RHS) const{
211return !(*this ==RHS);
212 }
213};
214
215classFileSystem;
216
217namespacedetail {
218
219/// Keeps state for the recursive_directory_iterator.
220structRecDirIterState {
221 std::vector<directory_iterator>Stack;
222boolHasNoPushRequest =false;
223};
224
225}// end namespace detail
226
227/// An input iterator over the recursive contents of a virtual path,
228/// similar to llvm::sys::fs::recursive_directory_iterator.
229classrecursive_directory_iterator {
230FileSystem *FS;
231 std::shared_ptr<detail::RecDirIterState>
232 State;// Input iterator semantics on copy.
233
234public:
235recursive_directory_iterator(FileSystem &FS,constTwine &Path,
236 std::error_code &EC);
237
238 /// Construct an 'end' iterator.
239recursive_directory_iterator() =default;
240
241 /// Equivalent to operator++, with an error code.
242recursive_directory_iterator &increment(std::error_code &EC);
243
244constdirectory_entry &operator*() const{return *State->Stack.back(); }
245constdirectory_entry *operator->() const{return &*State->Stack.back(); }
246
247booloperator==(constrecursive_directory_iterator &Other) const{
248return State ==Other.State;// identity
249 }
250booloperator!=(constrecursive_directory_iterator &RHS) const{
251return !(*this ==RHS);
252 }
253
254 /// Gets the current level. Starting path is at level 0.
255intlevel() const{
256assert(!State->Stack.empty() &&
257"Cannot get level without any iteration state");
258return State->Stack.size() - 1;
259 }
260
261voidno_push() { State->HasNoPushRequest =true; }
262};
263
264/// The virtual file system interface.
265classFileSystem :publicllvm::ThreadSafeRefCountedBase<FileSystem>,
266publicRTTIExtends<FileSystem, RTTIRoot> {
267public:
268staticconstcharID;
269virtual~FileSystem();
270
271 /// Get the status of the entry at \p Path, if one exists.
272virtualllvm::ErrorOr<Status>status(constTwine &Path) = 0;
273
274 /// Get a \p File object for the text file at \p Path, if one exists.
275virtualllvm::ErrorOr<std::unique_ptr<File>>
276openFileForRead(constTwine &Path) = 0;
277
278 /// Get a \p File object for the binary file at \p Path, if one exists.
279 /// Some non-ascii based file systems perform encoding conversions
280 /// when reading as a text file, and this function should be used if
281 /// a file's bytes should be read as-is. On most filesystems, this
282 /// is the same behaviour as openFileForRead.
283virtualllvm::ErrorOr<std::unique_ptr<File>>
284openFileForReadBinary(constTwine &Path) {
285returnopenFileForRead(Path);
286 }
287
288 /// This is a convenience method that opens a file, gets its content and then
289 /// closes the file.
290 /// The IsText parameter is used to distinguish whether the file should be
291 /// opened as a binary or text file.
292llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
293getBufferForFile(constTwine &Name, int64_t FileSize = -1,
294bool RequiresNullTerminator =true,bool IsVolatile =false,
295bool IsText =true);
296
297 /// Get a directory_iterator for \p Dir.
298 /// \note The 'end' iterator is directory_iterator().
299virtualdirectory_iteratordir_begin(constTwine &Dir,
300 std::error_code &EC) = 0;
301
302 /// Set the working directory. This will affect all following operations on
303 /// this file system and may propagate down for nested file systems.
304virtual std::error_codesetCurrentWorkingDirectory(constTwine &Path) = 0;
305
306 /// Get the working directory of this file system.
307virtualllvm::ErrorOr<std::string>getCurrentWorkingDirectory()const = 0;
308
309 /// Gets real path of \p Path e.g. collapse all . and .. patterns, resolve
310 /// symlinks. For real file system, this uses `llvm::sys::fs::real_path`.
311 /// This returns errc::operation_not_permitted if not implemented by subclass.
312virtual std::error_codegetRealPath(constTwine &Path,
313SmallVectorImpl<char> &Output);
314
315 /// Check whether \p Path exists. By default this uses \c status(), but
316 /// filesystems may provide a more efficient implementation if available.
317virtualboolexists(constTwine &Path);
318
319 /// Is the file mounted on a local filesystem?
320virtual std::error_codeisLocal(constTwine &Path,bool &Result);
321
322 /// Make \a Path an absolute path.
323 ///
324 /// Makes \a Path absolute using the current directory if it is not already.
325 /// An empty \a Path will result in the current directory.
326 ///
327 /// /absolute/path => /absolute/path
328 /// relative/../path => <current-directory>/relative/../path
329 ///
330 /// \param Path A path that is modified to be an absolute path.
331 /// \returns success if \a path has been made absolute, otherwise a
332 /// platform-specific error_code.
333virtual std::error_codemakeAbsolute(SmallVectorImpl<char> &Path)const;
334
335 /// \returns true if \p A and \p B represent the same file, or an error or
336 /// false if they do not.
337llvm::ErrorOr<bool>equivalent(constTwine &A,constTwine &B);
338
339enum classPrintType {Summary,Contents,RecursiveContents };
340voidprint(raw_ostream &OS,PrintTypeType =PrintType::Contents,
341unsigned IndentLevel = 0) const{
342printImpl(OS,Type, IndentLevel);
343 }
344
345usingVisitCallbackTy =llvm::function_ref<void(FileSystem &)>;
346virtualvoidvisitChildFileSystems(VisitCallbackTy Callback) {}
347voidvisit(VisitCallbackTy Callback) {
348 Callback(*this);
349visitChildFileSystems(Callback);
350 }
351
352#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
353LLVM_DUMP_METHODvoiddump()const;
354#endif
355
356protected:
357virtualvoidprintImpl(raw_ostream &OS,PrintTypeType,
358unsigned IndentLevel) const{
359printIndent(OS, IndentLevel);
360OS <<"FileSystem\n";
361 }
362
363voidprintIndent(raw_ostream &OS,unsigned IndentLevel) const{
364for (unsigned i = 0; i < IndentLevel; ++i)
365OS <<" ";
366 }
367};
368
369/// Gets an \p vfs::FileSystem for the 'real' file system, as seen by
370/// the operating system.
371/// The working directory is linked to the process's working directory.
372/// (This is usually thread-hostile).
373IntrusiveRefCntPtr<FileSystem>getRealFileSystem();
374
375/// Create an \p vfs::FileSystem for the 'real' file system, as seen by
376/// the operating system.
377/// It has its own working directory, independent of (but initially equal to)
378/// that of the process.
379std::unique_ptr<FileSystem>createPhysicalFileSystem();
380
381/// A file system that allows overlaying one \p AbstractFileSystem on top
382/// of another.
383///
384/// Consists of a stack of >=1 \p FileSystem objects, which are treated as being
385/// one merged file system. When there is a directory that exists in more than
386/// one file system, the \p OverlayFileSystem contains a directory containing
387/// the union of their contents. The attributes (permissions, etc.) of the
388/// top-most (most recently added) directory are used. When there is a file
389/// that exists in more than one file system, the file in the top-most file
390/// system overrides the other(s).
391classOverlayFileSystem :publicRTTIExtends<OverlayFileSystem, FileSystem> {
392usingFileSystemList =SmallVector<IntrusiveRefCntPtr<FileSystem>, 1>;
393
394 /// The stack of file systems, implemented as a list in order of
395 /// their addition.
396FileSystemList FSList;
397
398public:
399staticconstcharID;
400OverlayFileSystem(IntrusiveRefCntPtr<FileSystem>Base);
401
402 /// Pushes a file system on top of the stack.
403voidpushOverlay(IntrusiveRefCntPtr<FileSystem> FS);
404
405llvm::ErrorOr<Status>status(constTwine &Path)override;
406boolexists(constTwine &Path)override;
407llvm::ErrorOr<std::unique_ptr<File>>
408openFileForRead(constTwine &Path)override;
409directory_iteratordir_begin(constTwine &Dir, std::error_code &EC)override;
410llvm::ErrorOr<std::string>getCurrentWorkingDirectory()const override;
411 std::error_codesetCurrentWorkingDirectory(constTwine &Path)override;
412 std::error_codeisLocal(constTwine &Path,bool &Result)override;
413 std::error_codegetRealPath(constTwine &Path,
414SmallVectorImpl<char> &Output)override;
415
416usingiterator =FileSystemList::reverse_iterator;
417usingconst_iterator =FileSystemList::const_reverse_iterator;
418usingreverse_iterator =FileSystemList::iterator;
419usingconst_reverse_iterator =FileSystemList::const_iterator;
420usingrange =iterator_range<iterator>;
421usingconst_range =iterator_range<const_iterator>;
422
423 /// Get an iterator pointing to the most recently added file system.
424iteratoroverlays_begin() {return FSList.rbegin(); }
425const_iteratoroverlays_begin() const{return FSList.rbegin(); }
426
427 /// Get an iterator pointing one-past the least recently added file system.
428iteratoroverlays_end() {return FSList.rend(); }
429const_iteratoroverlays_end() const{return FSList.rend(); }
430
431 /// Get an iterator pointing to the least recently added file system.
432reverse_iteratoroverlays_rbegin() {return FSList.begin(); }
433const_reverse_iteratoroverlays_rbegin() const{return FSList.begin(); }
434
435 /// Get an iterator pointing one-past the most recently added file system.
436reverse_iteratoroverlays_rend() {return FSList.end(); }
437const_reverse_iteratoroverlays_rend() const{return FSList.end(); }
438
439rangeoverlays_range() {returnllvm::reverse(FSList); }
440const_rangeoverlays_range() const{returnllvm::reverse(FSList); }
441
442protected:
443voidprintImpl(raw_ostream &OS, PrintTypeType,
444unsigned IndentLevel)const override;
445voidvisitChildFileSystems(VisitCallbackTy Callback)override;
446};
447
448/// By default, this delegates all calls to the underlying file system. This
449/// is useful when derived file systems want to override some calls and still
450/// proxy other calls.
451classProxyFileSystem :publicRTTIExtends<ProxyFileSystem, FileSystem> {
452public:
453staticconstcharID;
454explicitProxyFileSystem(IntrusiveRefCntPtr<FileSystem> FS)
455 : FS(std::move(FS)) {}
456
457llvm::ErrorOr<Status>status(constTwine &Path) override{
458return FS->status(Path);
459 }
460boolexists(constTwine &Path) override{return FS->exists(Path); }
461llvm::ErrorOr<std::unique_ptr<File>>
462openFileForRead(constTwine &Path) override{
463return FS->openFileForRead(Path);
464 }
465directory_iteratordir_begin(constTwine &Dir, std::error_code &EC) override{
466return FS->dir_begin(Dir, EC);
467 }
468llvm::ErrorOr<std::string>getCurrentWorkingDirectory() const override{
469return FS->getCurrentWorkingDirectory();
470 }
471 std::error_codesetCurrentWorkingDirectory(constTwine &Path) override{
472return FS->setCurrentWorkingDirectory(Path);
473 }
474 std::error_codegetRealPath(constTwine &Path,
475SmallVectorImpl<char> &Output) override{
476return FS->getRealPath(Path, Output);
477 }
478 std::error_codeisLocal(constTwine &Path,bool &Result) override{
479return FS->isLocal(Path, Result);
480 }
481
482protected:
483FileSystem &getUnderlyingFS() const{return *FS; }
484voidvisitChildFileSystems(VisitCallbackTy Callback) override{
485if (FS) {
486 Callback(*FS);
487 FS->visitChildFileSystems(Callback);
488 }
489 }
490
491private:
492IntrusiveRefCntPtr<FileSystem> FS;
493
494virtualvoid anchor()override;
495};
496
497namespacedetail {
498
499classInMemoryDirectory;
500classInMemoryNode;
501
502structNewInMemoryNodeInfo {
503llvm::sys::fs::UniqueIDDirUID;
504StringRefPath;
505StringRefName;
506 time_tModificationTime;
507 std::unique_ptr<llvm::MemoryBuffer>Buffer;
508uint32_tUser;
509uint32_tGroup;
510llvm::sys::fs::file_typeType;
511llvm::sys::fs::permsPerms;
512
513StatusmakeStatus()const;
514};
515
516classNamedNodeOrError {
517ErrorOr<std::pair<llvm::SmallString<128>,constdetail::InMemoryNode *>>
518Value;
519
520public:
521NamedNodeOrError(llvm::SmallString<128>Name,
522constdetail::InMemoryNode *Node)
523 :Value(std::make_pair(Name,Node)) {}
524NamedNodeOrError(std::error_code EC) :Value(EC) {}
525NamedNodeOrError(llvm::errc EC) :Value(EC) {}
526
527StringRefgetName() const{return (*Value).first; }
528explicitoperatorbool() const{returnstatic_cast<bool>(Value); }
529operator std::error_code() const{returnValue.getError(); }
530 std::error_codegetError() const{returnValue.getError(); }
531constdetail::InMemoryNode *operator*() const{return (*Value).second; }
532};
533
534}// namespace detail
535
536/// An in-memory file system.
537classInMemoryFileSystem :publicRTTIExtends<InMemoryFileSystem, FileSystem> {
538 std::unique_ptr<detail::InMemoryDirectory> Root;
539 std::string WorkingDirectory;
540bool UseNormalizedPaths =true;
541
542public:
543staticconstcharID;
544
545private:
546usingMakeNodeFn =llvm::function_ref<std::unique_ptr<detail::InMemoryNode>(
547detail::NewInMemoryNodeInfo)>;
548
549 /// Create node with \p MakeNode and add it into this filesystem at \p Path.
550bool addFile(constTwine &Path, time_t ModificationTime,
551 std::unique_ptr<llvm::MemoryBuffer> Buffer,
552 std::optional<uint32_t>User, std::optional<uint32_t> Group,
553 std::optional<llvm::sys::fs::file_type>Type,
554 std::optional<llvm::sys::fs::perms> Perms,MakeNodeFn MakeNode);
555
556 /// Looks up the in-memory node for the path \p P.
557 /// If \p FollowFinalSymlink is true, the returned node is guaranteed to
558 /// not be a symlink and its path may differ from \p P.
559detail::NamedNodeOrError lookupNode(constTwine &P,bool FollowFinalSymlink,
560size_t SymlinkDepth = 0)const;
561
562classDirIterator;
563
564public:
565explicitInMemoryFileSystem(bool UseNormalizedPaths =true);
566~InMemoryFileSystem()override;
567
568 /// Add a file containing a buffer or a directory to the VFS with a
569 /// path. The VFS owns the buffer. If present, User, Group, Type
570 /// and Perms apply to the newly-created file or directory.
571 /// \return true if the file or directory was successfully added,
572 /// false if the file or directory already exists in the file system with
573 /// different contents.
574bool addFile(constTwine &Path, time_t ModificationTime,
575 std::unique_ptr<llvm::MemoryBuffer> Buffer,
576 std::optional<uint32_t>User = std::nullopt,
577 std::optional<uint32_t> Group = std::nullopt,
578 std::optional<llvm::sys::fs::file_type>Type = std::nullopt,
579 std::optional<llvm::sys::fs::perms> Perms = std::nullopt);
580
581 /// Add a hard link to a file.
582 ///
583 /// Here hard links are not intended to be fully equivalent to the classical
584 /// filesystem. Both the hard link and the file share the same buffer and
585 /// status (and thus have the same UniqueID). Because of this there is no way
586 /// to distinguish between the link and the file after the link has been
587 /// added.
588 ///
589 /// The \p Target path must be an existing file or a hardlink. The
590 /// \p NewLink file must not have been added before. The \p Target
591 /// path must not be a directory. The \p NewLink node is added as a hard
592 /// link which points to the resolved file of \p Target node.
593 /// \return true if the above condition is satisfied and hardlink was
594 /// successfully created, false otherwise.
595booladdHardLink(constTwine &NewLink,constTwine &Target);
596
597 /// Arbitrary max depth to search through symlinks. We can get into problems
598 /// if a link links to a link that links back to the link, for example.
599staticconstexprsize_tMaxSymlinkDepth = 16;
600
601 /// Add a symbolic link. Unlike a HardLink, because \p Target doesn't need
602 /// to refer to a file (or refer to anything, as it happens). Also, an
603 /// in-memory directory for \p Target isn't automatically created.
604bool
605addSymbolicLink(constTwine &NewLink,constTwine &Target,
606 time_t ModificationTime,
607 std::optional<uint32_t>User = std::nullopt,
608 std::optional<uint32_t> Group = std::nullopt,
609 std::optional<llvm::sys::fs::perms> Perms = std::nullopt);
610
611 /// Add a buffer to the VFS with a path. The VFS does not own the buffer.
612 /// If present, User, Group, Type and Perms apply to the newly-created file
613 /// or directory.
614 /// \return true if the file or directory was successfully added,
615 /// false if the file or directory already exists in the file system with
616 /// different contents.
617booladdFileNoOwn(constTwine &Path, time_t ModificationTime,
618constllvm::MemoryBufferRef &Buffer,
619 std::optional<uint32_t>User = std::nullopt,
620 std::optional<uint32_t> Group = std::nullopt,
621 std::optional<llvm::sys::fs::file_type>Type = std::nullopt,
622 std::optional<llvm::sys::fs::perms> Perms = std::nullopt);
623
624 std::stringtoString()const;
625
626 /// Return true if this file system normalizes . and .. in paths.
627booluseNormalizedPaths() const{return UseNormalizedPaths; }
628
629llvm::ErrorOr<Status>status(constTwine &Path)override;
630llvm::ErrorOr<std::unique_ptr<File>>
631openFileForRead(constTwine &Path)override;
632directory_iteratordir_begin(constTwine &Dir, std::error_code &EC)override;
633
634llvm::ErrorOr<std::string>getCurrentWorkingDirectory() const override{
635return WorkingDirectory;
636 }
637 /// Canonicalizes \p Path by combining with the current working
638 /// directory and normalizing the path (e.g. remove dots). If the current
639 /// working directory is not set, this returns errc::operation_not_permitted.
640 ///
641 /// This doesn't resolve symlinks as they are not supported in in-memory file
642 /// system.
643 std::error_codegetRealPath(constTwine &Path,
644SmallVectorImpl<char> &Output)override;
645 std::error_codeisLocal(constTwine &Path,bool &Result)override;
646 std::error_codesetCurrentWorkingDirectory(constTwine &Path)override;
647
648protected:
649voidprintImpl(raw_ostream &OS, PrintTypeType,
650unsigned IndentLevel)const override;
651};
652
653/// Get a globally unique ID for a virtual file or directory.
654llvm::sys::fs::UniqueIDgetNextVirtualUniqueID();
655
656/// Gets a \p FileSystem for a virtual file system described in YAML
657/// format.
658std::unique_ptr<FileSystem>
659getVFSFromYAML(std::unique_ptr<llvm::MemoryBuffer> Buffer,
660llvm::SourceMgr::DiagHandlerTyDiagHandler,
661StringRef YAMLFilePath,void *DiagContext =nullptr,
662IntrusiveRefCntPtr<FileSystem> ExternalFS =getRealFileSystem());
663
664structYAMLVFSEntry {
665template <typename T1,typename T2>
666YAMLVFSEntry(T1 &&VPath, T2 &&RPath,boolIsDirectory =false)
667 :VPath(std::forward<T1>(VPath)),RPath(std::forward<T2>(RPath)),
668IsDirectory(IsDirectory) {}
669 std::stringVPath;
670 std::stringRPath;
671boolIsDirectory =false;
672};
673
674classRedirectingFSDirIterImpl;
675classRedirectingFileSystemParser;
676
677/// A virtual file system parsed from a YAML file.
678///
679/// Currently, this class allows creating virtual files and directories. Virtual
680/// files map to existing external files in \c ExternalFS, and virtual
681/// directories may either map to existing directories in \c ExternalFS or list
682/// their contents in the form of other virtual directories and/or files.
683///
684/// The basic structure of the parsed file is:
685/// \verbatim
686/// {
687/// 'version': <version number>,
688/// <optional configuration>
689/// 'roots': [
690/// <directory entries>
691/// ]
692/// }
693/// \endverbatim
694/// The roots may be absolute or relative. If relative they will be made
695/// absolute against either current working directory or the directory where
696/// the Overlay YAML file is located, depending on the 'root-relative'
697/// configuration.
698///
699/// All configuration options are optional.
700/// 'case-sensitive': <boolean, default=(true for Posix, false for Windows)>
701/// 'use-external-names': <boolean, default=true>
702/// 'root-relative': <string, one of 'cwd' or 'overlay-dir', default='cwd'>
703/// 'overlay-relative': <boolean, default=false>
704/// 'fallthrough': <boolean, default=true, deprecated - use 'redirecting-with'
705/// instead>
706/// 'redirecting-with': <string, one of 'fallthrough', 'fallback', or
707/// 'redirect-only', default='fallthrough'>
708///
709/// To clarify, 'root-relative' option will prepend the current working
710/// directory, or the overlay directory to the 'roots->name' field only if
711/// 'roots->name' is a relative path. On the other hand, when 'overlay-relative'
712/// is set to 'true', external paths will always be prepended with the overlay
713/// directory, even if external paths are not relative paths. The
714/// 'root-relative' option has no interaction with the 'overlay-relative'
715/// option.
716///
717/// Virtual directories that list their contents are represented as
718/// \verbatim
719/// {
720/// 'type': 'directory',
721/// 'name': <string>,
722/// 'contents': [ <file or directory entries> ]
723/// }
724/// \endverbatim
725/// The default attributes for such virtual directories are:
726/// \verbatim
727/// MTime = now() when created
728/// Perms = 0777
729/// User = Group = 0
730/// Size = 0
731/// UniqueID = unspecified unique value
732/// \endverbatim
733/// When a path prefix matches such a directory, the next component in the path
734/// is matched against the entries in the 'contents' array.
735///
736/// Re-mapped directories, on the other hand, are represented as
737/// /// \verbatim
738/// {
739/// 'type': 'directory-remap',
740/// 'name': <string>,
741/// 'use-external-name': <boolean>, # Optional
742/// 'external-contents': <path to external directory>
743/// }
744/// \endverbatim
745/// and inherit their attributes from the external directory. When a path
746/// prefix matches such an entry, the unmatched components are appended to the
747/// 'external-contents' path, and the resulting path is looked up in the
748/// external file system instead.
749///
750/// Re-mapped files are represented as
751/// \verbatim
752/// {
753/// 'type': 'file',
754/// 'name': <string>,
755/// 'use-external-name': <boolean>, # Optional
756/// 'external-contents': <path to external file>
757/// }
758/// \endverbatim
759/// Their attributes and file contents are determined by looking up the file at
760/// their 'external-contents' path in the external file system.
761///
762/// For 'file', 'directory' and 'directory-remap' entries the 'name' field may
763/// contain multiple path components (e.g. /path/to/file). However, any
764/// directory in such a path that contains more than one child must be uniquely
765/// represented by a 'directory' entry.
766///
767/// When the 'use-external-name' field is set, calls to \a vfs::File::status()
768/// give the external (remapped) filesystem name instead of the name the file
769/// was accessed by. This is an intentional leak through the \a
770/// RedirectingFileSystem abstraction layer. It enables clients to discover
771/// (and use) the external file location when communicating with users or tools
772/// that don't use the same VFS overlay.
773///
774/// FIXME: 'use-external-name' causes behaviour that's inconsistent with how
775/// "real" filesystems behave. Maybe there should be a separate channel for
776/// this information.
777classRedirectingFileSystem
778 :publicRTTIExtends<RedirectingFileSystem, vfs::FileSystem> {
779public:
780staticconstcharID;
781enumEntryKind {EK_Directory,EK_DirectoryRemap,EK_File };
782enumNameKind {NK_NotSet,NK_External,NK_Virtual };
783
784 /// The type of redirection to perform.
785enum classRedirectKind {
786 /// Lookup the redirected path first (ie. the one specified in
787 /// 'external-contents') and if that fails "fallthrough" to a lookup of the
788 /// originally provided path.
789Fallthrough,
790 /// Lookup the provided path first and if that fails, "fallback" to a
791 /// lookup of the redirected path.
792Fallback,
793 /// Only lookup the redirected path, do not lookup the originally provided
794 /// path.
795RedirectOnly
796 };
797
798 /// The type of relative path used by Roots.
799enum classRootRelativeKind {
800 /// The roots are relative to the current working directory.
801CWD,
802 /// The roots are relative to the directory where the Overlay YAML file
803// locates.
804OverlayDir
805 };
806
807 /// A single file or directory in the VFS.
808classEntry {
809EntryKind Kind;
810 std::string Name;
811
812public:
813Entry(EntryKind K,StringRef Name) : Kind(K), Name(Name) {}
814virtual~Entry() =default;
815
816StringRefgetName() const{return Name; }
817EntryKindgetKind() const{return Kind; }
818 };
819
820 /// A directory in the vfs with explicitly specified contents.
821classDirectoryEntry :publicEntry {
822 std::vector<std::unique_ptr<Entry>> Contents;
823Status S;
824
825public:
826 /// Constructs a directory entry with explicitly specified contents.
827DirectoryEntry(StringRef Name, std::vector<std::unique_ptr<Entry>> Contents,
828Status S)
829 :Entry(EK_Directory, Name), Contents(std::move(Contents)),
830 S(std::move(S)) {}
831
832 /// Constructs an empty directory entry.
833DirectoryEntry(StringRef Name,Status S)
834 :Entry(EK_Directory, Name), S(std::move(S)) {}
835
836StatusgetStatus() {return S; }
837
838voidaddContent(std::unique_ptr<Entry>Content) {
839 Contents.push_back(std::move(Content));
840 }
841
842Entry *getLastContent() const{return Contents.back().get(); }
843
844usingiterator =decltype(Contents)::iterator;
845
846iteratorcontents_begin() {return Contents.begin(); }
847iteratorcontents_end() {return Contents.end(); }
848
849staticboolclassof(constEntry *E) {returnE->getKind() ==EK_Directory; }
850 };
851
852 /// A file or directory in the vfs that is mapped to a file or directory in
853 /// the external filesystem.
854classRemapEntry :publicEntry {
855 std::string ExternalContentsPath;
856NameKind UseName;
857
858protected:
859RemapEntry(EntryKind K,StringRef Name,StringRef ExternalContentsPath,
860NameKind UseName)
861 :Entry(K, Name), ExternalContentsPath(ExternalContentsPath),
862 UseName(UseName) {}
863
864public:
865StringRefgetExternalContentsPath() const{return ExternalContentsPath; }
866
867 /// Whether to use the external path as the name for this file or directory.
868booluseExternalName(bool GlobalUseExternalName) const{
869return UseName ==NK_NotSet ? GlobalUseExternalName
870 : (UseName ==NK_External);
871 }
872
873NameKindgetUseName() const{return UseName; }
874
875staticboolclassof(constEntry *E) {
876switch (E->getKind()) {
877caseEK_DirectoryRemap:
878 [[fallthrough]];
879caseEK_File:
880returntrue;
881caseEK_Directory:
882returnfalse;
883 }
884llvm_unreachable("invalid entry kind");
885 }
886 };
887
888 /// A directory in the vfs that maps to a directory in the external file
889 /// system.
890classDirectoryRemapEntry :publicRemapEntry {
891public:
892DirectoryRemapEntry(StringRef Name,StringRef ExternalContentsPath,
893NameKind UseName)
894 :RemapEntry(EK_DirectoryRemap, Name, ExternalContentsPath, UseName) {}
895
896staticboolclassof(constEntry *E) {
897returnE->getKind() ==EK_DirectoryRemap;
898 }
899 };
900
901 /// A file in the vfs that maps to a file in the external file system.
902classFileEntry :publicRemapEntry {
903public:
904FileEntry(StringRef Name,StringRef ExternalContentsPath,NameKind UseName)
905 :RemapEntry(EK_File, Name, ExternalContentsPath, UseName) {}
906
907staticboolclassof(constEntry *E) {returnE->getKind() ==EK_File; }
908 };
909
910 /// Represents the result of a path lookup into the RedirectingFileSystem.
911structLookupResult {
912 /// Chain of parent directory entries for \c E.
913llvm::SmallVector<Entry *, 32>Parents;
914
915 /// The entry the looked-up path corresponds to.
916Entry *E;
917
918private:
919 /// When the found Entry is a DirectoryRemapEntry, stores the path in the
920 /// external file system that the looked-up path in the virtual file system
921// corresponds to.
922 std::optional<std::string> ExternalRedirect;
923
924public:
925LookupResult(Entry *E,sys::path::const_iterator Start,
926sys::path::const_iteratorEnd);
927
928 /// If the found Entry maps the input path to a path in the external
929 /// file system (i.e. it is a FileEntry or DirectoryRemapEntry), returns
930 /// that path.
931 std::optional<StringRef>getExternalRedirect() const{
932if (isa<DirectoryRemapEntry>(E))
933returnStringRef(*ExternalRedirect);
934if (auto *FE = dyn_cast<FileEntry>(E))
935return FE->getExternalContentsPath();
936return std::nullopt;
937 }
938
939 /// Get the (canonical) path of the found entry. This uses the as-written
940 /// path components from the VFS specification.
941voidgetPath(llvm::SmallVectorImpl<char> &Path)const;
942 };
943
944private:
945friendclassRedirectingFSDirIterImpl;
946friendclassRedirectingFileSystemParser;
947
948 /// Canonicalize path by removing ".", "..", "./", components. This is
949 /// a VFS request, do not bother about symlinks in the path components
950 /// but canonicalize in order to perform the correct entry search.
951 std::error_code makeCanonicalForLookup(SmallVectorImpl<char> &Path)const;
952
953 /// Get the File status, or error, from the underlying external file system.
954 /// This returns the status with the originally requested name, while looking
955 /// up the entry using a potentially different path.
956ErrorOr<Status> getExternalStatus(constTwine &LookupPath,
957constTwine &OriginalPath)const;
958
959 /// Make \a Path an absolute path.
960 ///
961 /// Makes \a Path absolute using the \a WorkingDir if it is not already.
962 ///
963 /// /absolute/path => /absolute/path
964 /// relative/../path => <WorkingDir>/relative/../path
965 ///
966 /// \param WorkingDir A path that will be used as the base Dir if \a Path
967 /// is not already absolute.
968 /// \param Path A path that is modified to be an absolute path.
969 /// \returns success if \a path has been made absolute, otherwise a
970 /// platform-specific error_code.
971 std::error_codemakeAbsolute(StringRef WorkingDir,
972SmallVectorImpl<char> &Path)const;
973
974// In a RedirectingFileSystem, keys can be specified in Posix or Windows
975// style (or even a mixture of both), so this comparison helper allows
976// slashes (representing a root) to match backslashes (and vice versa). Note
977// that, other than the root, path components should not contain slashes or
978// backslashes.
979bool pathComponentMatches(llvm::StringRef lhs,llvm::StringRef rhs) const{
980if ((CaseSensitive ? lhs == rhs : lhs.equals_insensitive(rhs)))
981returntrue;
982return (lhs =="/" && rhs =="\\") || (lhs =="\\" && rhs =="/");
983 }
984
985 /// The root(s) of the virtual file system.
986 std::vector<std::unique_ptr<Entry>> Roots;
987
988 /// The current working directory of the file system.
989 std::string WorkingDirectory;
990
991 /// The file system to use for external references.
992IntrusiveRefCntPtr<FileSystem> ExternalFS;
993
994 /// This represents the directory path that the YAML file is located.
995 /// This will be prefixed to each 'external-contents' if IsRelativeOverlay
996 /// is set. This will also be prefixed to each 'roots->name' if RootRelative
997 /// is set to RootRelativeKind::OverlayDir and the path is relative.
998 std::string OverlayFileDir;
999
1000 /// @name Configuration
1001 /// @{
1002
1003 /// Whether to perform case-sensitive comparisons.
1004 ///
1005 /// Currently, case-insensitive matching only works correctly with ASCII.
1006bool CaseSensitive = is_style_posix(sys::path::Style::native);
1007
1008 /// IsRelativeOverlay marks whether a OverlayFileDir path must
1009 /// be prefixed in every 'external-contents' when reading from YAML files.
1010bool IsRelativeOverlay =false;
1011
1012 /// Whether to use to use the value of 'external-contents' for the
1013 /// names of files. This global value is overridable on a per-file basis.
1014bool UseExternalNames =true;
1015
1016 /// True if this FS has redirected a lookup. This does not include
1017 /// fallthrough.
1018mutablebool HasBeenUsed =false;
1019
1020 /// Used to enable or disable updating `HasBeenUsed`.
1021bool UsageTrackingActive =false;
1022
1023 /// Determines the lookups to perform, as well as their order. See
1024 /// \c RedirectKind for details.
1025RedirectKind Redirection =RedirectKind::Fallthrough;
1026
1027 /// Determine the prefix directory if the roots are relative paths. See
1028 /// \c RootRelativeKind for details.
1029RootRelativeKind RootRelative =RootRelativeKind::CWD;
1030 /// @}
1031
1032RedirectingFileSystem(IntrusiveRefCntPtr<FileSystem> ExternalFS);
1033
1034 /// Looks up the path <tt>[Start, End)</tt> in \p From, possibly recursing
1035 /// into the contents of \p From if it is a directory. Returns a LookupResult
1036 /// giving the matched entry and, if that entry is a FileEntry or
1037 /// DirectoryRemapEntry, the path it redirects to in the external file system.
1038ErrorOr<LookupResult>
1039 lookupPathImpl(llvm::sys::path::const_iterator Start,
1040llvm::sys::path::const_iteratorEnd, Entry *From,
1041llvm::SmallVectorImpl<Entry *> &Entries)const;
1042
1043 /// Get the status for a path with the provided \c LookupResult.
1044ErrorOr<Status> status(constTwine &LookupPath,constTwine &OriginalPath,
1045const LookupResult &Result);
1046
1047public:
1048 /// Looks up \p Path in \c Roots and returns a LookupResult giving the
1049 /// matched entry and, if the entry was a FileEntry or DirectoryRemapEntry,
1050 /// the path it redirects to in the external file system.
1051ErrorOr<LookupResult>lookupPath(StringRef Path)const;
1052
1053 /// Parses \p Buffer, which is expected to be in YAML format and
1054 /// returns a virtual file system representing its contents.
1055static std::unique_ptr<RedirectingFileSystem>
1056create(std::unique_ptr<MemoryBuffer> Buffer,
1057SourceMgr::DiagHandlerTyDiagHandler,StringRef YAMLFilePath,
1058void *DiagContext,IntrusiveRefCntPtr<FileSystem> ExternalFS);
1059
1060 /// Redirect each of the remapped files from first to second.
1061static std::unique_ptr<RedirectingFileSystem>
1062create(ArrayRef<std::pair<std::string, std::string>> RemappedFiles,
1063bool UseExternalNames,FileSystem &ExternalFS);
1064
1065ErrorOr<Status> status(constTwine &Path)override;
1066boolexists(constTwine &Path)override;
1067ErrorOr<std::unique_ptr<File>>openFileForRead(constTwine &Path)override;
1068
1069 std::error_codegetRealPath(constTwine &Path,
1070SmallVectorImpl<char> &Output)override;
1071
1072llvm::ErrorOr<std::string>getCurrentWorkingDirectory()const override;
1073
1074 std::error_codesetCurrentWorkingDirectory(constTwine &Path)override;
1075
1076 std::error_codeisLocal(constTwine &Path,bool &Result)override;
1077
1078 std::error_codemakeAbsolute(SmallVectorImpl<char> &Path)const override;
1079
1080directory_iteratordir_begin(constTwine &Dir, std::error_code &EC)override;
1081
1082voidsetOverlayFileDir(StringRef PrefixDir);
1083
1084StringRefgetOverlayFileDir()const;
1085
1086 /// Sets the redirection kind to \c Fallthrough if true or \c RedirectOnly
1087 /// otherwise. Will removed in the future, use \c setRedirection instead.
1088voidsetFallthrough(boolFallthrough);
1089
1090voidsetRedirection(RedirectingFileSystem::RedirectKind Kind);
1091
1092 std::vector<llvm::StringRef>getRoots()const;
1093
1094boolhasBeenUsed() const{return HasBeenUsed; };
1095voidclearHasBeenUsed() { HasBeenUsed =false; }
1096
1097voidsetUsageTrackingActive(bool Active) { UsageTrackingActive = Active; }
1098
1099voidprintEntry(raw_ostream &OS, Entry *E,unsigned IndentLevel = 0)const;
1100
1101protected:
1102voidprintImpl(raw_ostream &OS,PrintTypeType,
1103unsigned IndentLevel)const override;
1104voidvisitChildFileSystems(VisitCallbackTy Callback)override;
1105};
1106
1107/// Collect all pairs of <virtual path, real path> entries from the
1108/// \p YAMLFilePath. This is used by the module dependency collector to forward
1109/// the entries into the reproducer output VFS YAML file.
1110voidcollectVFSFromYAML(
1111 std::unique_ptr<llvm::MemoryBuffer> Buffer,
1112llvm::SourceMgr::DiagHandlerTyDiagHandler,StringRef YAMLFilePath,
1113SmallVectorImpl<YAMLVFSEntry> &CollectedEntries,
1114void *DiagContext =nullptr,
1115IntrusiveRefCntPtr<FileSystem> ExternalFS =getRealFileSystem());
1116
1117classYAMLVFSWriter {
1118 std::vector<YAMLVFSEntry> Mappings;
1119 std::optional<bool> IsCaseSensitive;
1120 std::optional<bool> IsOverlayRelative;
1121 std::optional<bool> UseExternalNames;
1122 std::string OverlayDir;
1123
1124void addEntry(StringRef VirtualPath,StringRef RealPath,bool IsDirectory);
1125
1126public:
1127YAMLVFSWriter() =default;
1128
1129voidaddFileMapping(StringRef VirtualPath,StringRef RealPath);
1130voidaddDirectoryMapping(StringRef VirtualPath,StringRef RealPath);
1131
1132voidsetCaseSensitivity(bool CaseSensitive) {
1133 IsCaseSensitive = CaseSensitive;
1134 }
1135
1136voidsetUseExternalNames(bool UseExtNames) { UseExternalNames = UseExtNames; }
1137
1138voidsetOverlayDir(StringRef OverlayDirectory) {
1139 IsOverlayRelative =true;
1140 OverlayDir.assign(OverlayDirectory.str());
1141 }
1142
1143const std::vector<YAMLVFSEntry> &getMappings() const{return Mappings; }
1144
1145voidwrite(llvm::raw_ostream &OS);
1146};
1147
1148/// File system that tracks the number of calls to the underlying file system.
1149/// This is particularly useful when wrapped around \c RealFileSystem to add
1150/// lightweight tracking of expensive syscalls.
1151classTracingFileSystem
1152 :publicllvm::RTTIExtends<TracingFileSystem, ProxyFileSystem> {
1153public:
1154staticconstcharID;
1155
1156 std::size_tNumStatusCalls = 0;
1157 std::size_tNumOpenFileForReadCalls = 0;
1158 std::size_tNumDirBeginCalls = 0;
1159 std::size_tNumGetRealPathCalls = 0;
1160 std::size_tNumExistsCalls = 0;
1161 std::size_tNumIsLocalCalls = 0;
1162
1163TracingFileSystem(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS)
1164 :RTTIExtends(std::move(FS)) {}
1165
1166ErrorOr<Status>status(constTwine &Path) override{
1167 ++NumStatusCalls;
1168returnProxyFileSystem::status(Path);
1169 }
1170
1171ErrorOr<std::unique_ptr<File>>openFileForRead(constTwine &Path) override{
1172 ++NumOpenFileForReadCalls;
1173returnProxyFileSystem::openFileForRead(Path);
1174 }
1175
1176directory_iteratordir_begin(constTwine &Dir, std::error_code &EC) override{
1177 ++NumDirBeginCalls;
1178returnProxyFileSystem::dir_begin(Dir, EC);
1179 }
1180
1181 std::error_codegetRealPath(constTwine &Path,
1182SmallVectorImpl<char> &Output) override{
1183 ++NumGetRealPathCalls;
1184returnProxyFileSystem::getRealPath(Path, Output);
1185 }
1186
1187boolexists(constTwine &Path) override{
1188 ++NumExistsCalls;
1189returnProxyFileSystem::exists(Path);
1190 }
1191
1192 std::error_codeisLocal(constTwine &Path,bool &Result) override{
1193 ++NumIsLocalCalls;
1194returnProxyFileSystem::isLocal(Path, Result);
1195 }
1196
1197protected:
1198voidprintImpl(raw_ostream &OS, PrintTypeType,
1199unsigned IndentLevel)const override;
1200};
1201
1202}// namespace vfs
1203}// namespace llvm
1204
1205#endif// LLVM_SUPPORT_VIRTUALFILESYSTEM_H
From
BlockVerifier::State From
Definition:BlockVerifier.cpp:57
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
A
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Chrono.h
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:622
Content
T Content
Definition:ELFObjHandler.cpp:89
Name
std::string Name
Definition:ELFObjHandler.cpp:77
End
bool End
Definition:ELF_riscv.cpp:480
Errc.h
ErrorOr.h
Provides ErrorOr<T> smart pointer.
ExtensibleRTTI.h
makeAbsolute
static void makeAbsolute(SmallVectorImpl< char > &Path)
Make Path absolute.
Definition:FileCollector.cpp:91
FileSystem.h
IntrusiveRefCntPtr.h
This file defines the RefCountedBase, ThreadSafeRefCountedBase, and IntrusiveRefCntPtr classes.
I
#define I(x, y, z)
Definition:MD5.cpp:58
T1
#define T1
Definition:Mips16ISelLowering.cpp:340
P
#define P(N)
Path.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
STLFunctionalExtras.h
OS
raw_pwrite_stream & OS
Definition:SampleProfWriter.cpp:51
SmallVector.h
This file defines the SmallVector class.
StringRef.h
SourceMgr.h
DiagHandler
static void DiagHandler(const SMDiagnostic &Diag, void *Context)
Definition:TextStub.cpp:1060
RHS
Value * RHS
Definition:X86PartialReduction.cpp:74
Node
Definition:ItaniumDemangle.h:163
T
bool
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition:ArrayRef.h:41
llvm::ErrorOr
Represents either an error or a value T.
Definition:ErrorOr.h:56
llvm::IntrusiveRefCntPtr
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
Definition:IntrusiveRefCntPtr.h:173
llvm::MemoryBufferRef
Definition:MemoryBufferRef.h:22
llvm::RTTIExtends
Inheritance utility for extensible RTTI.
Definition:ExtensibleRTTI.h:126
llvm::SmallString
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Definition:SmallString.h:26
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition:SmallVector.h:573
llvm::SmallVectorTemplateCommon::end
iterator end()
Definition:SmallVector.h:269
llvm::SmallVectorTemplateCommon::rbegin
reverse_iterator rbegin()
Definition:SmallVector.h:273
llvm::SmallVectorTemplateCommon::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition:SmallVector.h:254
llvm::SmallVectorTemplateCommon::begin
iterator begin()
Definition:SmallVector.h:267
llvm::SmallVectorTemplateCommon::iterator
T * iterator
Definition:SmallVector.h:251
llvm::SmallVectorTemplateCommon::const_iterator
const T * const_iterator
Definition:SmallVector.h:252
llvm::SmallVectorTemplateCommon::rend
reverse_iterator rend()
Definition:SmallVector.h:275
llvm::SmallVectorTemplateCommon::reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
Definition:SmallVector.h:255
llvm::SmallVector< IntrusiveRefCntPtr< FileSystem >, 1 >
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
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::StringRef::str
std::string str() const
str - Get the contents as an std::string.
Definition:StringRef.h:229
llvm::StringRef::equals_insensitive
bool equals_insensitive(StringRef RHS) const
Check for string equality, ignoring case.
Definition:StringRef.h:176
llvm::Target
Target - Wrapper for Target specific information.
Definition:TargetRegistry.h:144
llvm::ThreadSafeRefCountedBase
A thread-safe version of RefCountedBase.
Definition:IntrusiveRefCntPtr.h:108
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition:Twine.h:81
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition:Type.h:45
llvm::User
Definition:User.h:44
llvm::Value
LLVM Value Representation.
Definition:Value.h:74
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition:STLFunctionalExtras.h:37
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition:iterator_range.h:42
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition:raw_ostream.h:52
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:221
llvm::sys::path::const_iterator
Path iterator.
Definition:Path.h:75
llvm::vfs::FileSystem
The virtual file system interface.
Definition:VirtualFileSystem.h:266
llvm::vfs::FileSystem::VisitCallbackTy
llvm::function_ref< void(FileSystem &)> VisitCallbackTy
Definition:VirtualFileSystem.h:345
llvm::vfs::FileSystem::getCurrentWorkingDirectory
virtual llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const =0
Get the working directory of this file system.
llvm::vfs::FileSystem::exists
virtual bool exists(const Twine &Path)
Check whether Path exists.
Definition:VirtualFileSystem.cpp:149
llvm::vfs::FileSystem::openFileForReadBinary
virtual llvm::ErrorOr< std::unique_ptr< File > > openFileForReadBinary(const Twine &Path)
Get a File object for the binary file at Path, if one exists.
Definition:VirtualFileSystem.h:284
llvm::vfs::FileSystem::PrintType
PrintType
Definition:VirtualFileSystem.h:339
llvm::vfs::FileSystem::PrintType::Summary
@ Summary
llvm::vfs::FileSystem::PrintType::RecursiveContents
@ RecursiveContents
llvm::vfs::FileSystem::PrintType::Contents
@ Contents
llvm::vfs::FileSystem::setCurrentWorkingDirectory
virtual std::error_code setCurrentWorkingDirectory(const Twine &Path)=0
Set the working directory.
llvm::vfs::FileSystem::printImpl
virtual void printImpl(raw_ostream &OS, PrintType Type, unsigned IndentLevel) const
Definition:VirtualFileSystem.h:357
llvm::vfs::FileSystem::makeAbsolute
virtual std::error_code makeAbsolute(SmallVectorImpl< char > &Path) const
Make Path an absolute path.
Definition:VirtualFileSystem.cpp:128
llvm::vfs::FileSystem::ID
static const char ID
Definition:VirtualFileSystem.h:268
llvm::vfs::FileSystem::openFileForRead
virtual llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path)=0
Get a File object for the text file at Path, if one exists.
llvm::vfs::FileSystem::getRealPath
virtual std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output)
Gets real path of Path e.g.
Definition:VirtualFileSystem.cpp:140
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::vfs::FileSystem::printIndent
void printIndent(raw_ostream &OS, unsigned IndentLevel) const
Definition:VirtualFileSystem.h:363
llvm::vfs::FileSystem::~FileSystem
virtual ~FileSystem()
llvm::vfs::FileSystem::dump
LLVM_DUMP_METHOD void dump() const
Definition:VirtualFileSystem.cpp:165
llvm::vfs::FileSystem::print
void print(raw_ostream &OS, PrintType Type=PrintType::Contents, unsigned IndentLevel=0) const
Definition:VirtualFileSystem.h:340
llvm::vfs::FileSystem::visitChildFileSystems
virtual void visitChildFileSystems(VisitCallbackTy Callback)
Definition:VirtualFileSystem.h:346
llvm::vfs::FileSystem::visit
void visit(VisitCallbackTy Callback)
Definition:VirtualFileSystem.h:347
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, bool IsText=true)
This is a convenience method that opens a file, gets its content and then closes the file.
Definition:VirtualFileSystem.cpp:118
llvm::vfs::FileSystem::equivalent
llvm::ErrorOr< bool > equivalent(const Twine &A, const Twine &B)
Definition:VirtualFileSystem.cpp:154
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::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::File
Represents an open file.
Definition:VirtualFileSystem.h:111
llvm::vfs::File::getWithPath
static ErrorOr< std::unique_ptr< File > > getWithPath(ErrorOr< std::unique_ptr< File > > Result, const Twine &P)
Definition:VirtualFileSystem.cpp:2539
llvm::vfs::File::status
virtual llvm::ErrorOr< Status > status()=0
Get the status of the file.
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::File::getName
virtual llvm::ErrorOr< std::string > getName()
Get the name of the file.
Definition:VirtualFileSystem.h:122
llvm::vfs::File::setPath
virtual void setPath(const Twine &Path)
Definition:VirtualFileSystem.h:143
llvm::vfs::File::~File
virtual ~File()
Destroy the file after closing it (if open).
llvm::vfs::File::close
virtual std::error_code close()=0
Closes the file.
llvm::vfs::InMemoryFileSystem::DirIterator
Adaptor from InMemoryDir::iterator to directory_iterator.
Definition:VirtualFileSystem.cpp:1104
llvm::vfs::InMemoryFileSystem
An in-memory file system.
Definition:VirtualFileSystem.h:537
llvm::vfs::InMemoryFileSystem::isLocal
std::error_code isLocal(const Twine &Path, bool &Result) override
Definition:VirtualFileSystem.cpp:1202
llvm::vfs::InMemoryFileSystem::dir_begin
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
Definition:VirtualFileSystem.cpp:1157
llvm::vfs::InMemoryFileSystem::getRealPath
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) override
Canonicalizes Path by combining with the current working directory and normalizing the path (e....
Definition:VirtualFileSystem.cpp:1190
llvm::vfs::InMemoryFileSystem::~InMemoryFileSystem
~InMemoryFileSystem() override
llvm::vfs::InMemoryFileSystem::ID
static const char ID
Definition:VirtualFileSystem.h:543
llvm::vfs::InMemoryFileSystem::MaxSymlinkDepth
static constexpr size_t MaxSymlinkDepth
Arbitrary max depth to search through symlinks.
Definition:VirtualFileSystem.h:599
llvm::vfs::InMemoryFileSystem::useNormalizedPaths
bool useNormalizedPaths() const
Return true if this file system normalizes . and .. in paths.
Definition:VirtualFileSystem.h:627
llvm::vfs::InMemoryFileSystem::printImpl
void printImpl(raw_ostream &OS, PrintType Type, unsigned IndentLevel) const override
Definition:VirtualFileSystem.cpp:1207
llvm::vfs::InMemoryFileSystem::getCurrentWorkingDirectory
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
Definition:VirtualFileSystem.h:634
llvm::vfs::InMemoryFileSystem::addHardLink
bool addHardLink(const Twine &NewLink, const Twine &Target)
Add a hard link to a file.
Definition:VirtualFileSystem.cpp:1041
llvm::vfs::InMemoryFileSystem::toString
std::string toString() const
Definition:VirtualFileSystem.cpp:848
llvm::vfs::InMemoryFileSystem::addFileNoOwn
bool addFileNoOwn(const Twine &Path, time_t ModificationTime, const llvm::MemoryBufferRef &Buffer, std::optional< uint32_t > User=std::nullopt, std::optional< uint32_t > Group=std::nullopt, std::optional< llvm::sys::fs::file_type > Type=std::nullopt, std::optional< llvm::sys::fs::perms > Perms=std::nullopt)
Add a buffer to the VFS with a path.
Definition:VirtualFileSystem.cpp:948
llvm::vfs::InMemoryFileSystem::addSymbolicLink
bool addSymbolicLink(const Twine &NewLink, const Twine &Target, time_t ModificationTime, std::optional< uint32_t > User=std::nullopt, std::optional< uint32_t > Group=std::nullopt, std::optional< llvm::sys::fs::perms > Perms=std::nullopt)
Add a symbolic link.
Definition:VirtualFileSystem.cpp:1060
llvm::vfs::InMemoryFileSystem::setCurrentWorkingDirectory
std::error_code setCurrentWorkingDirectory(const Twine &Path) override
Definition:VirtualFileSystem.cpp:1173
llvm::vfs::InMemoryFileSystem::status
llvm::ErrorOr< Status > status(const Twine &Path) override
Definition:VirtualFileSystem.cpp:1080
llvm::vfs::InMemoryFileSystem::openFileForRead
llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
Definition:VirtualFileSystem.cpp:1088
llvm::vfs::OverlayFileSystem
A file system that allows overlaying one AbstractFileSystem on top of another.
Definition:VirtualFileSystem.h:391
llvm::vfs::OverlayFileSystem::overlays_end
const_iterator overlays_end() const
Definition:VirtualFileSystem.h:429
llvm::vfs::OverlayFileSystem::overlays_begin
const_iterator overlays_begin() const
Definition:VirtualFileSystem.h:425
llvm::vfs::OverlayFileSystem::dir_begin
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
Definition:VirtualFileSystem.cpp:615
llvm::vfs::OverlayFileSystem::overlays_rbegin
reverse_iterator overlays_rbegin()
Get an iterator pointing to the least recently added file system.
Definition:VirtualFileSystem.h:432
llvm::vfs::OverlayFileSystem::overlays_range
const_range overlays_range() const
Definition:VirtualFileSystem.h:440
llvm::vfs::OverlayFileSystem::visitChildFileSystems
void visitChildFileSystems(VisitCallbackTy Callback) override
Definition:VirtualFileSystem.cpp:512
llvm::vfs::OverlayFileSystem::overlays_rend
const_reverse_iterator overlays_rend() const
Definition:VirtualFileSystem.h:437
llvm::vfs::OverlayFileSystem::openFileForRead
llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
Definition:VirtualFileSystem.cpp:473
llvm::vfs::OverlayFileSystem::overlays_rend
reverse_iterator overlays_rend()
Get an iterator pointing one-past the most recently added file system.
Definition:VirtualFileSystem.h:436
llvm::vfs::OverlayFileSystem::getRealPath
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) override
Definition:VirtualFileSystem.cpp:504
llvm::vfs::OverlayFileSystem::setCurrentWorkingDirectory
std::error_code setCurrentWorkingDirectory(const Twine &Path) override
Definition:VirtualFileSystem.cpp:490
llvm::vfs::OverlayFileSystem::pushOverlay
void pushOverlay(IntrusiveRefCntPtr< FileSystem > FS)
Pushes a file system on top of the stack.
Definition:VirtualFileSystem.cpp:446
llvm::vfs::OverlayFileSystem::const_iterator
FileSystemList::const_reverse_iterator const_iterator
Definition:VirtualFileSystem.h:417
llvm::vfs::OverlayFileSystem::getCurrentWorkingDirectory
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
Definition:VirtualFileSystem.cpp:484
llvm::vfs::OverlayFileSystem::overlays_end
iterator overlays_end()
Get an iterator pointing one-past the least recently added file system.
Definition:VirtualFileSystem.h:428
llvm::vfs::OverlayFileSystem::isLocal
std::error_code isLocal(const Twine &Path, bool &Result) override
Definition:VirtualFileSystem.cpp:497
llvm::vfs::OverlayFileSystem::overlays_range
range overlays_range()
Definition:VirtualFileSystem.h:439
llvm::vfs::OverlayFileSystem::exists
bool exists(const Twine &Path) override
Definition:VirtualFileSystem.cpp:463
llvm::vfs::OverlayFileSystem::status
llvm::ErrorOr< Status > status(const Twine &Path) override
Definition:VirtualFileSystem.cpp:453
llvm::vfs::OverlayFileSystem::overlays_begin
iterator overlays_begin()
Get an iterator pointing to the most recently added file system.
Definition:VirtualFileSystem.h:424
llvm::vfs::OverlayFileSystem::overlays_rbegin
const_reverse_iterator overlays_rbegin() const
Definition:VirtualFileSystem.h:433
llvm::vfs::OverlayFileSystem::ID
static const char ID
Definition:VirtualFileSystem.h:399
llvm::vfs::OverlayFileSystem::iterator
FileSystemList::reverse_iterator iterator
Definition:VirtualFileSystem.h:416
llvm::vfs::OverlayFileSystem::printImpl
void printImpl(raw_ostream &OS, PrintType Type, unsigned IndentLevel) const override
Definition:VirtualFileSystem.cpp:519
llvm::vfs::ProxyFileSystem
By default, this delegates all calls to the underlying file system.
Definition:VirtualFileSystem.h:451
llvm::vfs::ProxyFileSystem::openFileForRead
llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
Definition:VirtualFileSystem.h:462
llvm::vfs::ProxyFileSystem::visitChildFileSystems
void visitChildFileSystems(VisitCallbackTy Callback) override
Definition:VirtualFileSystem.h:484
llvm::vfs::ProxyFileSystem::getRealPath
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) override
Definition:VirtualFileSystem.h:474
llvm::vfs::ProxyFileSystem::dir_begin
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
Definition:VirtualFileSystem.h:465
llvm::vfs::ProxyFileSystem::status
llvm::ErrorOr< Status > status(const Twine &Path) override
Definition:VirtualFileSystem.h:457
llvm::vfs::ProxyFileSystem::exists
bool exists(const Twine &Path) override
Definition:VirtualFileSystem.h:460
llvm::vfs::ProxyFileSystem::setCurrentWorkingDirectory
std::error_code setCurrentWorkingDirectory(const Twine &Path) override
Definition:VirtualFileSystem.h:471
llvm::vfs::ProxyFileSystem::isLocal
std::error_code isLocal(const Twine &Path, bool &Result) override
Definition:VirtualFileSystem.h:478
llvm::vfs::ProxyFileSystem::ID
static const char ID
Definition:VirtualFileSystem.h:453
llvm::vfs::ProxyFileSystem::ProxyFileSystem
ProxyFileSystem(IntrusiveRefCntPtr< FileSystem > FS)
Definition:VirtualFileSystem.h:454
llvm::vfs::ProxyFileSystem::getCurrentWorkingDirectory
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
Definition:VirtualFileSystem.h:468
llvm::vfs::ProxyFileSystem::getUnderlyingFS
FileSystem & getUnderlyingFS() const
Definition:VirtualFileSystem.h:483
llvm::vfs::RedirectingFSDirIterImpl
Directory iterator implementation for RedirectingFileSystem's directory entries.
Definition:VirtualFileSystem.cpp:1269
llvm::vfs::RedirectingFileSystemParser
A helper class to hold the common YAML parsing state.
Definition:VirtualFileSystem.cpp:1628
llvm::vfs::RedirectingFileSystem::DirectoryEntry
A directory in the vfs with explicitly specified contents.
Definition:VirtualFileSystem.h:821
llvm::vfs::RedirectingFileSystem::DirectoryEntry::contents_begin
iterator contents_begin()
Definition:VirtualFileSystem.h:846
llvm::vfs::RedirectingFileSystem::DirectoryEntry::getStatus
Status getStatus()
Definition:VirtualFileSystem.h:836
llvm::vfs::RedirectingFileSystem::DirectoryEntry::classof
static bool classof(const Entry *E)
Definition:VirtualFileSystem.h:849
llvm::vfs::RedirectingFileSystem::DirectoryEntry::contents_end
iterator contents_end()
Definition:VirtualFileSystem.h:847
llvm::vfs::RedirectingFileSystem::DirectoryEntry::DirectoryEntry
DirectoryEntry(StringRef Name, Status S)
Constructs an empty directory entry.
Definition:VirtualFileSystem.h:833
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:827
llvm::vfs::RedirectingFileSystem::DirectoryEntry::iterator
decltype(Contents)::iterator iterator
Definition:VirtualFileSystem.h:844
llvm::vfs::RedirectingFileSystem::DirectoryEntry::addContent
void addContent(std::unique_ptr< Entry > Content)
Definition:VirtualFileSystem.h:838
llvm::vfs::RedirectingFileSystem::DirectoryEntry::getLastContent
Entry * getLastContent() const
Definition:VirtualFileSystem.h:842
llvm::vfs::RedirectingFileSystem::DirectoryRemapEntry
A directory in the vfs that maps to a directory in the external file system.
Definition:VirtualFileSystem.h:890
llvm::vfs::RedirectingFileSystem::DirectoryRemapEntry::DirectoryRemapEntry
DirectoryRemapEntry(StringRef Name, StringRef ExternalContentsPath, NameKind UseName)
Definition:VirtualFileSystem.h:892
llvm::vfs::RedirectingFileSystem::DirectoryRemapEntry::classof
static bool classof(const Entry *E)
Definition:VirtualFileSystem.h:896
llvm::vfs::RedirectingFileSystem::Entry
A single file or directory in the VFS.
Definition:VirtualFileSystem.h:808
llvm::vfs::RedirectingFileSystem::Entry::~Entry
virtual ~Entry()=default
llvm::vfs::RedirectingFileSystem::Entry::getName
StringRef getName() const
Definition:VirtualFileSystem.h:816
llvm::vfs::RedirectingFileSystem::Entry::getKind
EntryKind getKind() const
Definition:VirtualFileSystem.h:817
llvm::vfs::RedirectingFileSystem::Entry::Entry
Entry(EntryKind K, StringRef Name)
Definition:VirtualFileSystem.h:813
llvm::vfs::RedirectingFileSystem::FileEntry
A file in the vfs that maps to a file in the external file system.
Definition:VirtualFileSystem.h:902
llvm::vfs::RedirectingFileSystem::FileEntry::classof
static bool classof(const Entry *E)
Definition:VirtualFileSystem.h:907
llvm::vfs::RedirectingFileSystem::FileEntry::FileEntry
FileEntry(StringRef Name, StringRef ExternalContentsPath, NameKind UseName)
Definition:VirtualFileSystem.h:904
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:854
llvm::vfs::RedirectingFileSystem::RemapEntry::getExternalContentsPath
StringRef getExternalContentsPath() const
Definition:VirtualFileSystem.h:865
llvm::vfs::RedirectingFileSystem::RemapEntry::getUseName
NameKind getUseName() const
Definition:VirtualFileSystem.h:873
llvm::vfs::RedirectingFileSystem::RemapEntry::RemapEntry
RemapEntry(EntryKind K, StringRef Name, StringRef ExternalContentsPath, NameKind UseName)
Definition:VirtualFileSystem.h:859
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:868
llvm::vfs::RedirectingFileSystem::RemapEntry::classof
static bool classof(const Entry *E)
Definition:VirtualFileSystem.h:875
llvm::vfs::RedirectingFileSystem
A virtual file system parsed from a YAML file.
Definition:VirtualFileSystem.h:778
llvm::vfs::RedirectingFileSystem::setUsageTrackingActive
void setUsageTrackingActive(bool Active)
Definition:VirtualFileSystem.h:1097
llvm::vfs::RedirectingFileSystem::RootRelativeKind
RootRelativeKind
The type of relative path used by Roots.
Definition:VirtualFileSystem.h:799
llvm::vfs::RedirectingFileSystem::RootRelativeKind::OverlayDir
@ OverlayDir
The roots are relative to the directory where the Overlay YAML file.
llvm::vfs::RedirectingFileSystem::RootRelativeKind::CWD
@ CWD
The roots are relative to the current working directory.
llvm::vfs::RedirectingFileSystem::exists
bool exists(const Twine &Path) override
Check whether Path exists.
Definition:VirtualFileSystem.cpp:2464
llvm::vfs::RedirectingFileSystem::printImpl
void printImpl(raw_ostream &OS, PrintType Type, unsigned IndentLevel) const override
Definition:VirtualFileSystem.cpp:1567
llvm::vfs::RedirectingFileSystem::getRoots
std::vector< llvm::StringRef > getRoots() const
Definition:VirtualFileSystem.cpp:1559
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:1438
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:2309
llvm::vfs::RedirectingFileSystem::RedirectKind
RedirectKind
The type of redirection to perform.
Definition:VirtualFileSystem.h:785
llvm::vfs::RedirectingFileSystem::RedirectKind::Fallthrough
@ Fallthrough
Lookup the redirected path first (ie.
llvm::vfs::RedirectingFileSystem::RedirectKind::Fallback
@ Fallback
Lookup the provided path first and if that fails, "fallback" to a lookup of the redirected path.
llvm::vfs::RedirectingFileSystem::RedirectKind::RedirectOnly
@ RedirectOnly
Only lookup the redirected path, do not lookup the originally provided path.
llvm::vfs::RedirectingFileSystem::setFallthrough
void setFallthrough(bool Fallthrough)
Sets the redirection kind to Fallthrough if true or RedirectOnly otherwise.
Definition:VirtualFileSystem.cpp:1546
llvm::vfs::RedirectingFileSystem::visitChildFileSystems
void visitChildFileSystems(VisitCallbackTy Callback) override
Definition:VirtualFileSystem.cpp:1620
llvm::vfs::RedirectingFileSystem::getRealPath
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) override
Gets real path of Path e.g.
Definition:VirtualFileSystem.cpp:2614
llvm::vfs::RedirectingFileSystem::openFileForRead
ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
Get a File object for the text file at Path, if one exists.
Definition:VirtualFileSystem.cpp:2553
llvm::vfs::RedirectingFileSystem::setOverlayFileDir
void setOverlayFileDir(StringRef PrefixDir)
Definition:VirtualFileSystem.cpp:1538
llvm::vfs::RedirectingFileSystem::getCurrentWorkingDirectory
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
Get the working directory of this file system.
Definition:VirtualFileSystem.cpp:1353
llvm::vfs::RedirectingFileSystem::NameKind
NameKind
Definition:VirtualFileSystem.h:782
llvm::vfs::RedirectingFileSystem::NK_Virtual
@ NK_Virtual
Definition:VirtualFileSystem.h:782
llvm::vfs::RedirectingFileSystem::NK_External
@ NK_External
Definition:VirtualFileSystem.h:782
llvm::vfs::RedirectingFileSystem::NK_NotSet
@ NK_NotSet
Definition:VirtualFileSystem.h:782
llvm::vfs::RedirectingFileSystem::setRedirection
void setRedirection(RedirectingFileSystem::RedirectKind Kind)
Definition:VirtualFileSystem.cpp:1554
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:1371
llvm::vfs::RedirectingFileSystem::EntryKind
EntryKind
Definition:VirtualFileSystem.h:781
llvm::vfs::RedirectingFileSystem::EK_File
@ EK_File
Definition:VirtualFileSystem.h:781
llvm::vfs::RedirectingFileSystem::EK_DirectoryRemap
@ EK_DirectoryRemap
Definition:VirtualFileSystem.h:781
llvm::vfs::RedirectingFileSystem::EK_Directory
@ EK_Directory
Definition:VirtualFileSystem.h:781
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:2176
llvm::vfs::RedirectingFileSystem::hasBeenUsed
bool hasBeenUsed() const
Definition:VirtualFileSystem.h:1094
llvm::vfs::RedirectingFileSystem::ID
static const char ID
Definition:VirtualFileSystem.h:780
llvm::vfs::RedirectingFileSystem::setCurrentWorkingDirectory
std::error_code setCurrentWorkingDirectory(const Twine &Path) override
Set the working directory.
Definition:VirtualFileSystem.cpp:1358
llvm::vfs::RedirectingFileSystem::clearHasBeenUsed
void clearHasBeenUsed()
Definition:VirtualFileSystem.h:1095
llvm::vfs::RedirectingFileSystem::getOverlayFileDir
StringRef getOverlayFileDir() const
Definition:VirtualFileSystem.cpp:1542
llvm::vfs::RedirectingFileSystem::printEntry
void printEntry(raw_ostream &OS, Entry *E, unsigned IndentLevel=0) const
Definition:VirtualFileSystem.cpp:1584
llvm::vfs::Status
The result of a status operation.
Definition:VirtualFileSystem.h:48
llvm::vfs::Status::getPermissions
llvm::sys::fs::perms getPermissions() const
Definition:VirtualFileSystem.h:90
llvm::vfs::Status::getUniqueID
llvm::sys::fs::UniqueID getUniqueID() const
Definition:VirtualFileSystem.h:92
llvm::vfs::Status::getUser
uint32_t getUser() const
Definition:VirtualFileSystem.h:93
llvm::vfs::Status::equivalent
bool equivalent(const Status &Other) const
Definition:VirtualFileSystem.cpp:92
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:80
llvm::vfs::Status::getSize
uint64_t getSize() const
Definition:VirtualFileSystem.h:95
llvm::vfs::Status::isStatusKnown
bool isStatusKnown() const
Definition:VirtualFileSystem.cpp:107
llvm::vfs::Status::exists
bool exists() const
Definition:VirtualFileSystem.cpp:109
llvm::vfs::Status::ExposesExternalVFSPath
bool ExposesExternalVFSPath
Whether this entity has an external path different from the virtual path, and the external path is ex...
Definition:VirtualFileSystem.h:68
llvm::vfs::Status::getGroup
uint32_t getGroup() const
Definition:VirtualFileSystem.h:94
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:74
llvm::vfs::Status::isOther
bool isOther() const
Definition:VirtualFileSystem.cpp:101
llvm::vfs::Status::isSymlink
bool isSymlink() const
Definition:VirtualFileSystem.cpp:105
llvm::vfs::Status::getLastModificationTime
llvm::sys::TimePoint getLastModificationTime() const
Definition:VirtualFileSystem.h:91
llvm::vfs::Status::getType
llvm::sys::fs::file_type getType() const
Definition:VirtualFileSystem.h:89
llvm::vfs::Status::isRegularFile
bool isRegularFile() const
Definition:VirtualFileSystem.cpp:99
llvm::vfs::Status::isDirectory
bool isDirectory() const
Definition:VirtualFileSystem.cpp:97
llvm::vfs::Status::getName
StringRef getName() const
Returns the name that should be used for this file or directory.
Definition:VirtualFileSystem.h:85
llvm::vfs::Status::Status
Status(const Twine &Name, llvm::sys::fs::UniqueID UID, llvm::sys::TimePoint<> MTime, uint32_t User, uint32_t Group, uint64_t Size, llvm::sys::fs::file_type Type, llvm::sys::fs::perms Perms)
llvm::vfs::Status::Status
Status()=default
llvm::vfs::TracingFileSystem
File system that tracks the number of calls to the underlying file system.
Definition:VirtualFileSystem.h:1152
llvm::vfs::TracingFileSystem::exists
bool exists(const Twine &Path) override
Definition:VirtualFileSystem.h:1187
llvm::vfs::TracingFileSystem::TracingFileSystem
TracingFileSystem(llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS)
Definition:VirtualFileSystem.h:1163
llvm::vfs::TracingFileSystem::ID
static const char ID
Definition:VirtualFileSystem.h:1154
llvm::vfs::TracingFileSystem::openFileForRead
ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
Definition:VirtualFileSystem.h:1171
llvm::vfs::TracingFileSystem::NumOpenFileForReadCalls
std::size_t NumOpenFileForReadCalls
Definition:VirtualFileSystem.h:1157
llvm::vfs::TracingFileSystem::NumIsLocalCalls
std::size_t NumIsLocalCalls
Definition:VirtualFileSystem.h:1161
llvm::vfs::TracingFileSystem::dir_begin
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
Definition:VirtualFileSystem.h:1176
llvm::vfs::TracingFileSystem::NumExistsCalls
std::size_t NumExistsCalls
Definition:VirtualFileSystem.h:1160
llvm::vfs::TracingFileSystem::status
ErrorOr< Status > status(const Twine &Path) override
Definition:VirtualFileSystem.h:1166
llvm::vfs::TracingFileSystem::printImpl
void printImpl(raw_ostream &OS, PrintType Type, unsigned IndentLevel) const override
Definition:VirtualFileSystem.cpp:2961
llvm::vfs::TracingFileSystem::isLocal
std::error_code isLocal(const Twine &Path, bool &Result) override
Definition:VirtualFileSystem.h:1192
llvm::vfs::TracingFileSystem::NumDirBeginCalls
std::size_t NumDirBeginCalls
Definition:VirtualFileSystem.h:1158
llvm::vfs::TracingFileSystem::NumGetRealPathCalls
std::size_t NumGetRealPathCalls
Definition:VirtualFileSystem.h:1159
llvm::vfs::TracingFileSystem::NumStatusCalls
std::size_t NumStatusCalls
Definition:VirtualFileSystem.h:1156
llvm::vfs::TracingFileSystem::getRealPath
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) override
Definition:VirtualFileSystem.h:1181
llvm::vfs::YAMLVFSWriter
Definition:VirtualFileSystem.h:1117
llvm::vfs::YAMLVFSWriter::addFileMapping
void addFileMapping(StringRef VirtualPath, StringRef RealPath)
Definition:VirtualFileSystem.cpp:2745
llvm::vfs::YAMLVFSWriter::setCaseSensitivity
void setCaseSensitivity(bool CaseSensitive)
Definition:VirtualFileSystem.h:1132
llvm::vfs::YAMLVFSWriter::setOverlayDir
void setOverlayDir(StringRef OverlayDirectory)
Definition:VirtualFileSystem.h:1138
llvm::vfs::YAMLVFSWriter::YAMLVFSWriter
YAMLVFSWriter()=default
llvm::vfs::YAMLVFSWriter::getMappings
const std::vector< YAMLVFSEntry > & getMappings() const
Definition:VirtualFileSystem.h:1143
llvm::vfs::YAMLVFSWriter::write
void write(llvm::raw_ostream &OS)
Definition:VirtualFileSystem.cpp:2914
llvm::vfs::YAMLVFSWriter::addDirectoryMapping
void addDirectoryMapping(StringRef VirtualPath, StringRef RealPath)
Definition:VirtualFileSystem.cpp:2749
llvm::vfs::YAMLVFSWriter::setUseExternalNames
void setUseExternalNames(bool UseExtNames)
Definition:VirtualFileSystem.h:1136
llvm::vfs::detail::InMemoryNode
The in memory file system is a tree of Nodes.
Definition:VirtualFileSystem.cpp:640
llvm::vfs::detail::NamedNodeOrError
Definition:VirtualFileSystem.h:516
llvm::vfs::detail::NamedNodeOrError::getError
std::error_code getError() const
Definition:VirtualFileSystem.h:530
llvm::vfs::detail::NamedNodeOrError::NamedNodeOrError
NamedNodeOrError(std::error_code EC)
Definition:VirtualFileSystem.h:524
llvm::vfs::detail::NamedNodeOrError::operator*
const detail::InMemoryNode * operator*() const
Definition:VirtualFileSystem.h:531
llvm::vfs::detail::NamedNodeOrError::getName
StringRef getName() const
Definition:VirtualFileSystem.h:527
llvm::vfs::detail::NamedNodeOrError::NamedNodeOrError
NamedNodeOrError(llvm::errc EC)
Definition:VirtualFileSystem.h:525
llvm::vfs::detail::NamedNodeOrError::NamedNodeOrError
NamedNodeOrError(llvm::SmallString< 128 > Name, const detail::InMemoryNode *Node)
Definition:VirtualFileSystem.h:521
llvm::vfs::directory_entry
A member of a directory, yielded by a directory_iterator.
Definition:VirtualFileSystem.h:148
llvm::vfs::directory_entry::directory_entry
directory_entry()=default
llvm::vfs::directory_entry::directory_entry
directory_entry(std::string Path, llvm::sys::fs::file_type Type)
Definition:VirtualFileSystem.h:154
llvm::vfs::directory_entry::path
llvm::StringRef path() const
Definition:VirtualFileSystem.h:157
llvm::vfs::directory_entry::type
llvm::sys::fs::file_type type() const
Definition:VirtualFileSystem.h:158
llvm::vfs::directory_iterator
An input iterator over the entries in a virtual path, similar to llvm::sys::fs::directory_iterator.
Definition:VirtualFileSystem.h:179
llvm::vfs::directory_iterator::directory_iterator
directory_iterator(std::shared_ptr< detail::DirIterImpl > I)
Definition:VirtualFileSystem.h:183
llvm::vfs::directory_iterator::operator==
bool operator==(const directory_iterator &RHS) const
Definition:VirtualFileSystem.h:205
llvm::vfs::directory_iterator::operator->
const directory_entry * operator->() const
Definition:VirtualFileSystem.h:203
llvm::vfs::directory_iterator::operator*
const directory_entry & operator*() const
Definition:VirtualFileSystem.h:202
llvm::vfs::directory_iterator::increment
directory_iterator & increment(std::error_code &EC)
Equivalent to operator++, with an error code.
Definition:VirtualFileSystem.h:194
llvm::vfs::directory_iterator::operator!=
bool operator!=(const directory_iterator &RHS) const
Definition:VirtualFileSystem.h:210
llvm::vfs::directory_iterator::directory_iterator
directory_iterator()=default
Construct an 'end' iterator.
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:229
llvm::vfs::recursive_directory_iterator::operator*
const directory_entry & operator*() const
Definition:VirtualFileSystem.h:244
llvm::vfs::recursive_directory_iterator::no_push
void no_push()
Definition:VirtualFileSystem.h:261
llvm::vfs::recursive_directory_iterator::recursive_directory_iterator
recursive_directory_iterator()=default
Construct an 'end' iterator.
llvm::vfs::recursive_directory_iterator::operator!=
bool operator!=(const recursive_directory_iterator &RHS) const
Definition:VirtualFileSystem.h:250
llvm::vfs::recursive_directory_iterator::operator==
bool operator==(const recursive_directory_iterator &Other) const
Definition:VirtualFileSystem.h:247
llvm::vfs::recursive_directory_iterator::level
int level() const
Gets the current level. Starting path is at level 0.
Definition:VirtualFileSystem.h:255
llvm::vfs::recursive_directory_iterator::increment
recursive_directory_iterator & increment(std::error_code &EC)
Equivalent to operator++, with an error code.
Definition:VirtualFileSystem.cpp:2934
llvm::vfs::recursive_directory_iterator::operator->
const directory_entry * operator->() const
Definition:VirtualFileSystem.h:245
uint32_t
uint64_t
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition:ErrorHandling.h:143
Error.h
detail
Definition:ClauseT.h:112
llvm::sampleprof::Base
@ Base
Definition:Discriminator.h:58
llvm::sys::fs::file_type
file_type
An enumeration for the file system's view of the type.
Definition:FileSystem.h:61
llvm::sys::fs::file_type::status_error
@ status_error
llvm::sys::fs::file_type::type_unknown
@ type_unknown
llvm::sys::fs::perms
perms
Definition:FileSystem.h:81
llvm::sys::path::Style::native
@ native
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::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::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::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:404
llvm::vfs::getNextVirtualUniqueID
llvm::sys::fs::UniqueID getNextVirtualUniqueID()
Get a globally unique ID for a virtual file or directory.
Definition:VirtualFileSystem.cpp:2729
llvm::vfs::getRealFileSystem
IntrusiveRefCntPtr< FileSystem > getRealFileSystem()
Gets an vfs::FileSystem for the 'real' file system, as seen by the operating system.
Definition:VirtualFileSystem.cpp:399
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::errc
errc
Definition:Errc.h:35
llvm::reverse
auto reverse(ContainerTy &&C)
Definition:STLExtras.h:420
llvm::IRMemLocation::Other
@ Other
Any other memory.
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:1873
std
Implement std::hash so that hash_code can be used in STL containers.
Definition:BitVector.h:858
llvm::vfs::RedirectingFileSystem::LookupResult
Represents the result of a path lookup into the RedirectingFileSystem.
Definition:VirtualFileSystem.h:911
llvm::vfs::RedirectingFileSystem::LookupResult::getExternalRedirect
std::optional< StringRef > getExternalRedirect() const
If the found Entry maps the input path to a path in the external file system (i.e.
Definition:VirtualFileSystem.h:931
llvm::vfs::RedirectingFileSystem::LookupResult::E
Entry * E
The entry the looked-up path corresponds to.
Definition:VirtualFileSystem.h:916
llvm::vfs::RedirectingFileSystem::LookupResult::getPath
void getPath(llvm::SmallVectorImpl< char > &Path) const
Get the (canonical) path of the found entry.
Definition:VirtualFileSystem.cpp:2286
llvm::vfs::RedirectingFileSystem::LookupResult::Parents
llvm::SmallVector< Entry *, 32 > Parents
Chain of parent directory entries for E.
Definition:VirtualFileSystem.h:913
llvm::vfs::YAMLVFSEntry
Definition:VirtualFileSystem.h:664
llvm::vfs::YAMLVFSEntry::VPath
std::string VPath
Definition:VirtualFileSystem.h:669
llvm::vfs::YAMLVFSEntry::RPath
std::string RPath
Definition:VirtualFileSystem.h:670
llvm::vfs::YAMLVFSEntry::YAMLVFSEntry
YAMLVFSEntry(T1 &&VPath, T2 &&RPath, bool IsDirectory=false)
Definition:VirtualFileSystem.h:666
llvm::vfs::YAMLVFSEntry::IsDirectory
bool IsDirectory
Definition:VirtualFileSystem.h:671
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:165
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::detail::DirIterImpl::~DirIterImpl
virtual ~DirIterImpl()
llvm::vfs::detail::DirIterImpl::CurrentEntry
directory_entry CurrentEntry
Definition:VirtualFileSystem.h:172
llvm::vfs::detail::NewInMemoryNodeInfo
Definition:VirtualFileSystem.h:502
llvm::vfs::detail::NewInMemoryNodeInfo::User
uint32_t User
Definition:VirtualFileSystem.h:508
llvm::vfs::detail::NewInMemoryNodeInfo::makeStatus
Status makeStatus() const
Definition:VirtualFileSystem.cpp:828
llvm::vfs::detail::NewInMemoryNodeInfo::Type
llvm::sys::fs::file_type Type
Definition:VirtualFileSystem.h:510
llvm::vfs::detail::NewInMemoryNodeInfo::ModificationTime
time_t ModificationTime
Definition:VirtualFileSystem.h:506
llvm::vfs::detail::NewInMemoryNodeInfo::Buffer
std::unique_ptr< llvm::MemoryBuffer > Buffer
Definition:VirtualFileSystem.h:507
llvm::vfs::detail::NewInMemoryNodeInfo::Perms
llvm::sys::fs::perms Perms
Definition:VirtualFileSystem.h:511
llvm::vfs::detail::NewInMemoryNodeInfo::Name
StringRef Name
Definition:VirtualFileSystem.h:505
llvm::vfs::detail::NewInMemoryNodeInfo::DirUID
llvm::sys::fs::UniqueID DirUID
Definition:VirtualFileSystem.h:503
llvm::vfs::detail::NewInMemoryNodeInfo::Group
uint32_t Group
Definition:VirtualFileSystem.h:509
llvm::vfs::detail::NewInMemoryNodeInfo::Path
StringRef Path
Definition:VirtualFileSystem.h:504
llvm::vfs::detail::RecDirIterState
Keeps state for the recursive_directory_iterator.
Definition:VirtualFileSystem.h:220
llvm::vfs::detail::RecDirIterState::HasNoPushRequest
bool HasNoPushRequest
Definition:VirtualFileSystem.h:222
llvm::vfs::detail::RecDirIterState::Stack
std::vector< directory_iterator > Stack
Definition:VirtualFileSystem.h:221

Generated on Fri Jul 18 2025 09:41:41 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp