14#ifndef LLVM_SUPPORT_VIRTUALFILESYSTEM_H
15#define LLVM_SUPPORT_VIRTUALFILESYSTEM_H
38#include <system_error>
84 const Twine &NewName);
86 const Twine &NewName);
141 bool RequiresNullTerminator =
true,
bool IsVolatile =
false) = 0;
144 virtual std::error_code
close() = 0;
164 : Path(
std::
move(Path)), Type(Type) {}
189 std::shared_ptr<detail::DirIterImpl> Impl;
194 assert(Impl.get() !=
nullptr &&
"requires non-null implementation");
195 if (Impl->CurrentEntry.path().empty())
204 assert(Impl &&
"attempting to increment past end");
205 EC = Impl->increment();
206 if (Impl->CurrentEntry.path().empty())
215 if (Impl &&
RHS.Impl)
216 return Impl->CurrentEntry.path() ==
RHS.Impl->CurrentEntry.path();
217 return !Impl && !
RHS.Impl;
220 return !(*
this ==
RHS);
228 std::vector<directory_iterator>
Stack;
238 std::shared_ptr<detail::RecDirIterState>
243 std::error_code &EC);
255 return State ==
Other.State;
258 return !(*
this ==
RHS);
263 assert(!State->Stack.empty() &&
264 "Cannot get level without any iteration state");
265 return State->Stack.size() - 1;
268 void no_push() { State->HasNoPushRequest =
true; }
275 static const char ID;
300 getBufferForFile(
const Twine &Name, int64_t FileSize = -1,
301 bool RequiresNullTerminator =
true,
bool IsVolatile =
false,
307 std::error_code &EC) = 0;
334 virtual bool exists(
const Twine &Path);
337 virtual std::error_code isLocal(
const Twine &Path,
bool &Result);
358 unsigned IndentLevel = 0)
const {
369#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
375 unsigned IndentLevel)
const {
377 OS <<
"FileSystem\n";
381 for (
unsigned i = 0; i < IndentLevel; ++i)
411 :
public RTTIExtends<OverlayFileSystem, FileSystem> {
416 FileSystemList FSList;
419 static const char ID;
432 std::error_code
isLocal(
const Twine &Path,
bool &Result)
override;
467 unsigned IndentLevel)
const override;
468 void visitChildFileSystems(VisitCallbackTy Callback)
override;
475 :
public RTTIExtends<ProxyFileSystem, FileSystem> {
477 static const char ID;
482 return FS->status(Path);
484 bool exists(
const Twine &Path)
override {
return FS->exists(Path); }
487 return FS->openFileForRead(Path);
490 return FS->dir_begin(Dir, EC);
493 return FS->getCurrentWorkingDirectory();
496 return FS->setCurrentWorkingDirectory(Path);
500 return FS->getRealPath(Path, Output);
505 return FS->getDirectoryContentRealSources(Dir, Out);
508 return FS->isLocal(Path, Result);
516 FS->visitChildFileSystems(Callback);
523 void anchor()
override;
528class InMemoryDirectory;
536 std::unique_ptr<llvm::MemoryBuffer>
Buffer;
552 : Value(
std::make_pair(Name,
Node)) {}
557 explicit operator bool()
const {
return static_cast<bool>(Value); }
558 operator std::error_code()
const {
return Value.getError(); }
559 std::error_code
getError()
const {
return Value.getError(); }
567 :
public RTTIExtends<InMemoryFileSystem, FileSystem> {
568 std::unique_ptr<detail::InMemoryDirectory> Root;
569 std::string WorkingDirectory;
570 bool UseNormalizedPaths =
true;
573 static const char ID;
580 bool addFile(
const Twine &Path, time_t ModificationTime,
581 std::unique_ptr<llvm::MemoryBuffer> Buffer,
582 std::optional<uint32_t>
User, std::optional<uint32_t> Group,
583 std::optional<llvm::sys::fs::file_type>
Type,
584 std::optional<llvm::sys::fs::perms> Perms, MakeNodeFn MakeNode);
590 size_t SymlinkDepth = 0)
const;
604 bool addFile(
const Twine &Path, time_t ModificationTime,
605 std::unique_ptr<llvm::MemoryBuffer> Buffer,
606 std::optional<uint32_t>
User = std::nullopt,
607 std::optional<uint32_t> Group = std::nullopt,
608 std::optional<llvm::sys::fs::file_type>
Type = std::nullopt,
609 std::optional<llvm::sys::fs::perms> Perms = std::nullopt);
636 time_t ModificationTime,
637 std::optional<uint32_t>
User = std::nullopt,
638 std::optional<uint32_t> Group = std::nullopt,
639 std::optional<llvm::sys::fs::perms> Perms = std::nullopt);
649 std::optional<uint32_t>
User = std::nullopt,
650 std::optional<uint32_t> Group = std::nullopt,
651 std::optional<llvm::sys::fs::file_type>
Type = std::nullopt,
652 std::optional<llvm::sys::fs::perms> Perms = std::nullopt);
661 openFileForRead(
const Twine &Path)
override;
665 return WorkingDirectory;
673 std::error_code getRealPath(
const Twine &Path,
675 std::error_code isLocal(
const Twine &Path,
bool &Result)
override;
676 std::error_code setCurrentWorkingDirectory(
const Twine &Path)
override;
680 unsigned IndentLevel)
const override;
691 StringRef YAMLFilePath,
void *DiagContext =
nullptr,
695 template <
typename T1,
typename T2>
808 :
public RTTIExtends<RedirectingFileSystem, vfs::FileSystem> {
810 static const char ID;
852 std::vector<std::unique_ptr<Entry>> Contents;
869 Contents.push_back(std::move(Content));
885 std::string ExternalContentsPath;
891 :
Entry(
K, Name), ExternalContentsPath(ExternalContentsPath),
899 return UseName ==
NK_NotSet ? GlobalUseExternalName
906 switch (
E->getKind()) {
952 std::optional<std::string> ExternalRedirect;
965 return FE->getExternalContentsPath();
987 const Twine &OriginalPath)
const;
1012 return (lhs ==
"/" && rhs ==
"\\") || (lhs ==
"\\" && rhs ==
"/");
1016 std::vector<std::unique_ptr<Entry>> Roots;
1019 std::string WorkingDirectory;
1028 std::string OverlayFileDir;
1040 bool IsRelativeOverlay =
false;
1044 bool UseExternalNames =
true;
1048 mutable bool HasBeenUsed =
false;
1051 bool UsageTrackingActive =
false;
1055 RedirectKind Redirection = RedirectKind::Fallthrough;
1059 RootRelativeKind RootRelative = RootRelativeKind::CWD;
1079 const LookupResult &Result);
1089 static std::unique_ptr<RedirectingFileSystem>
1090 create(std::unique_ptr<MemoryBuffer> Buffer,
1095 static std::unique_ptr<RedirectingFileSystem>
1096 create(
ArrayRef<std::pair<std::string, std::string>> RemappedFiles,
1100 bool exists(
const Twine &Path)
override;
1103 std::error_code getRealPath(
const Twine &Path,
1107 getDirectoryContentRealSources(
const Twine &Dir,
1112 std::error_code setCurrentWorkingDirectory(
const Twine &Path)
override;
1114 std::error_code isLocal(
const Twine &Path,
bool &Result)
override;
1120 void setOverlayFileDir(
StringRef PrefixDir);
1126 void setFallthrough(
bool Fallthrough);
1130 std::vector<llvm::StringRef> getRoots()
const;
1137 void printEntry(
raw_ostream &OS, Entry *
E,
unsigned IndentLevel = 0)
const;
1141 unsigned IndentLevel)
const override;
1142 void visitChildFileSystems(VisitCallbackTy Callback)
override;
1153 std::vector<YAMLVFSEntry> Mappings;
1154 std::optional<bool> IsCaseSensitive;
1155 std::optional<bool> IsOverlayRelative;
1156 std::optional<bool> UseExternalNames;
1157 std::string OverlayDir;
1168 IsCaseSensitive = CaseSensitive;
1174 IsOverlayRelative =
true;
1175 OverlayDir.assign(OverlayDirectory.
str());
1178 const std::vector<YAMLVFSEntry> &
getMappings()
const {
return Mappings; }
1191template <
typename CounterT>
1196 inline static const char ID = 0;
1242 unsigned IndentLevel)
const override {
1244 OS <<
"TracingFileSystem\n";
1249 OS <<
"NumStatusCalls=" <<
static_cast<std::size_t
>(
NumStatusCalls) <<
"\n";
1251 OS <<
"NumOpenFileForReadCalls="
1257 OS <<
"NumGetRealPathCalls="
1260 OS <<
"NumExistsCalls=" <<
static_cast<std::size_t
>(
NumExistsCalls) <<
"\n";
1267 this->getUnderlyingFS().print(OS,
Type, IndentLevel + 1);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Provides ErrorOr<T> smart pointer.
static void makeAbsolute(vfs::FileSystem &VFS, SmallVectorImpl< char > &Path)
Make Path absolute.
This file defines the RefCountedBase, ThreadSafeRefCountedBase, and IntrusiveRefCntPtr classes.
static const char * toString(MIToken::TokenKind TokenKind)
static void printImpl(const MCAsmInfo &MAI, raw_ostream &OS, const MCSpecifierExpr &Expr)
This file defines the SmallVector class.
static void DiagHandler(const SMDiagnostic &Diag, void *Context)
Contains the forward declaration for vfs::FileSystem, as well as the IntrusiveRefCntPtrInfo specializ...
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Represents either an error or a value T.
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
This interface provides simple read-only access to a block of memory, and provides simple methods for...
Inheritance utility for extensible RTTI.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
std::reverse_iterator< const_iterator > const_reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
void(*)(const SMDiagnostic &, void *Context) DiagHandlerTy
Clients that want to handle their own diagnostics in a custom way can register a function pointer+con...
Represent a constant reference to a string, i.e.
std::string str() const
Get the contents as an std::string.
bool equals_insensitive(StringRef RHS) const
Check for string equality, ignoring case.
Target - Wrapper for Target specific information.
A thread-safe version of RefCountedBase.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
An efficient, type-erasing, non-owning reference to a callable.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
Represents the result of a call to sys::fs::status().
The virtual file system interface.
llvm::function_ref< void(FileSystem &)> VisitCallbackTy
virtual llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const =0
Get the working directory of this file system.
virtual llvm::ErrorOr< std::unique_ptr< File > > openFileForReadBinary(const Twine &Path)
Get a File object for the binary file at Path, if one exists.
virtual std::error_code setCurrentWorkingDirectory(const Twine &Path)=0
Set the working directory.
virtual void printImpl(raw_ostream &OS, PrintType Type, unsigned IndentLevel) const
virtual void getDirectoryContentRealSources(const Twine &Dir, SmallVectorImpl< std::string > &Out)
Collect the paths in the real file system that contribute to a potentially virtual directory when ite...
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.
virtual std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output)
Gets real path of Path e.g.
virtual directory_iterator dir_begin(const Twine &Dir, std::error_code &EC)=0
Get a directory_iterator for Dir.
void printIndent(raw_ostream &OS, unsigned IndentLevel) const
void print(raw_ostream &OS, PrintType Type=PrintType::Contents, unsigned IndentLevel=0) const
virtual void visitChildFileSystems(VisitCallbackTy Callback)
void visit(VisitCallbackTy Callback)
virtual llvm::ErrorOr< Status > status(const Twine &Path)=0
Get the status of the entry at Path, if one exists.
static ErrorOr< std::unique_ptr< File > > getWithPath(ErrorOr< std::unique_ptr< File > > Result, const Twine &P)
virtual llvm::ErrorOr< Status > status()=0
Get the status of the file.
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.
virtual llvm::ErrorOr< std::string > getName()
Get the name of the file.
virtual void setPath(const Twine &Path)
virtual ~File()
Destroy the file after closing it (if open).
virtual std::error_code close()=0
Closes the file.
Adaptor from InMemoryDir::iterator to directory_iterator.
~InMemoryFileSystem() override
static constexpr size_t MaxSymlinkDepth
Arbitrary max depth to search through symlinks.
InMemoryFileSystem(bool UseNormalizedPaths=true)
bool useNormalizedPaths() const
Return true if this file system normalizes . and .. in paths.
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
bool addHardLink(const Twine &NewLink, const Twine &Target)
Add a hard link to a file.
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.
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.
const_iterator overlays_end() const
const_iterator overlays_begin() const
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
reverse_iterator overlays_rbegin()
Get an iterator pointing to the least recently added file system.
const_range overlays_range() const
const_reverse_iterator overlays_rend() const
iterator_range< iterator > range
llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
reverse_iterator overlays_rend()
Get an iterator pointing one-past the most recently added file system.
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) override
std::error_code setCurrentWorkingDirectory(const Twine &Path) override
void pushOverlay(IntrusiveRefCntPtr< FileSystem > FS)
Pushes a file system on top of the stack.
FileSystemList::const_reverse_iterator const_iterator
OverlayFileSystem(IntrusiveRefCntPtr< FileSystem > Base)
FileSystemList::const_iterator const_reverse_iterator
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
void getDirectoryContentRealSources(const Twine &Dir, SmallVectorImpl< std::string > &Out) override
iterator overlays_end()
Get an iterator pointing one-past the least recently added file system.
std::error_code isLocal(const Twine &Path, bool &Result) override
FileSystemList::iterator reverse_iterator
bool exists(const Twine &Path) override
llvm::ErrorOr< Status > status(const Twine &Path) override
iterator overlays_begin()
Get an iterator pointing to the most recently added file system.
iterator_range< const_iterator > const_range
const_reverse_iterator overlays_rbegin() const
FileSystemList::reverse_iterator iterator
By default, this delegates all calls to the underlying file system.
llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
void visitChildFileSystems(VisitCallbackTy Callback) override
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) override
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
llvm::ErrorOr< Status > status(const Twine &Path) override
bool exists(const Twine &Path) override
std::error_code setCurrentWorkingDirectory(const Twine &Path) override
std::error_code isLocal(const Twine &Path, bool &Result) override
ProxyFileSystem(IntrusiveRefCntPtr< FileSystem > FS)
void getDirectoryContentRealSources(const Twine &Dir, SmallVectorImpl< std::string > &Out) override
llvm::ErrorOr< std::string > getCurrentWorkingDirectory() const override
FileSystem & getUnderlyingFS() const
Directory iterator implementation for RedirectingFileSystem's directory entries.
A helper class to hold the common YAML parsing state.
iterator contents_begin()
static bool classof(const Entry *E)
DirectoryEntry(StringRef Name, Status S)
Constructs an empty directory entry.
DirectoryEntry(StringRef Name, std::vector< std::unique_ptr< Entry > > Contents, Status S)
Constructs a directory entry with explicitly specified contents.
decltype(Contents)::iterator iterator
void addContent(std::unique_ptr< Entry > Content)
Entry * getLastContent() const
DirectoryRemapEntry(StringRef Name, StringRef ExternalContentsPath, NameKind UseName)
static bool classof(const Entry *E)
A single file or directory in the VFS.
StringRef getName() const
EntryKind getKind() const
Entry(EntryKind K, StringRef Name)
static bool classof(const Entry *E)
FileEntry(StringRef Name, StringRef ExternalContentsPath, NameKind UseName)
StringRef getExternalContentsPath() const
NameKind getUseName() const
RemapEntry(EntryKind K, StringRef Name, StringRef ExternalContentsPath, NameKind UseName)
bool useExternalName(bool GlobalUseExternalName) const
Whether to use the external path as the name for this file or directory.
static bool classof(const Entry *E)
A virtual file system parsed from a YAML file.
void setUsageTrackingActive(bool Active)
RootRelativeKind
The type of relative path used by Roots.
@ OverlayDir
The roots are relative to the directory where the Overlay YAML file.
@ CWD
The roots are relative to the current working directory.
friend class RedirectingFileSystemParser
RedirectKind
The type of redirection to perform.
@ Fallthrough
Lookup the redirected path first (ie.
@ Fallback
Lookup the provided path first and if that fails, "fallback" to a lookup of the redirected path.
@ RedirectOnly
Only lookup the redirected path, do not lookup the originally provided path.
friend class RedirectingFSDirIterImpl
The result of a status operation.
llvm::sys::fs::perms getPermissions() const
llvm::sys::fs::UniqueID getUniqueID() const
LLVM_ABI bool equivalent(const Status &Other) const
static LLVM_ABI Status copyWithNewName(const Status &In, const Twine &NewName)
Get a copy of a Status with a different name.
LLVM_ABI bool isStatusKnown() const
LLVM_ABI bool exists() const
bool ExposesExternalVFSPath
Whether this entity has an external path different from the virtual path, and the external path is ex...
uint32_t getGroup() const
static LLVM_ABI Status copyWithNewSize(const Status &In, uint64_t NewSize)
Get a copy of a Status with a different size.
LLVM_ABI bool isOther() const
LLVM_ABI bool isSymlink() const
llvm::sys::TimePoint getLastModificationTime() const
llvm::sys::fs::file_type getType() const
LLVM_ABI bool isRegularFile() const
LLVM_ABI bool isExecutable() const
Returns true if any of the owner, group, or others execute permissions is set.
LLVM_ABI bool isDirectory() const
StringRef getName() const
Returns the name that should be used for this file or directory.
File system that tracks the number of calls to the underlying file system.
void printImpl(raw_ostream &OS, FileSystem::PrintType Type, unsigned IndentLevel) const override
TracingFileSystemImpl(llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS)
directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override
std::error_code isLocal(const Twine &Path, bool &Result) override
ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path) override
std::size_t NumDirBeginCalls
std::size_t NumIsLocalCalls
std::size_t NumGetRealPathCalls
std::size_t NumOpenFileForReadCalls
std::size_t NumExistsCalls
std::error_code getRealPath(const Twine &Path, SmallVectorImpl< char > &Output) override
std::size_t NumStatusCalls
bool exists(const Twine &Path) override
ErrorOr< Status > status(const Twine &Path) override
LLVM_ABI void addFileMapping(StringRef VirtualPath, StringRef RealPath)
void setCaseSensitivity(bool CaseSensitive)
void setOverlayDir(StringRef OverlayDirectory)
const std::vector< YAMLVFSEntry > & getMappings() const
LLVM_ABI void write(llvm::raw_ostream &OS)
LLVM_ABI void addDirectoryMapping(StringRef VirtualPath, StringRef RealPath)
void setUseExternalNames(bool UseExtNames)
The in memory file system is a tree of Nodes.
std::error_code getError() const
NamedNodeOrError(std::error_code EC)
const detail::InMemoryNode * operator*() const
StringRef getName() const
NamedNodeOrError(llvm::errc EC)
NamedNodeOrError(llvm::SmallString< 128 > Name, const detail::InMemoryNode *Node)
A member of a directory, yielded by a directory_iterator.
directory_entry()=default
directory_entry(std::string Path, llvm::sys::fs::file_type Type)
llvm::StringRef path() const
llvm::sys::fs::file_type type() const
An input iterator over the entries in a virtual path, similar to llvm::sys::fs::directory_iterator.
directory_iterator(std::shared_ptr< detail::DirIterImpl > I)
bool operator==(const directory_iterator &RHS) const
const directory_entry * operator->() const
const directory_entry & operator*() const
directory_iterator & increment(std::error_code &EC)
Equivalent to operator++, with an error code.
bool operator!=(const directory_iterator &RHS) const
directory_iterator()=default
Construct an 'end' iterator.
const directory_entry & operator*() const
LLVM_ABI recursive_directory_iterator(FileSystem &FS, const Twine &Path, std::error_code &EC)
recursive_directory_iterator()=default
Construct an 'end' iterator.
bool operator!=(const recursive_directory_iterator &RHS) const
bool operator==(const recursive_directory_iterator &Other) const
int level() const
Gets the current level. Starting path is at level 0.
LLVM_ABI recursive_directory_iterator & increment(std::error_code &EC)
Equivalent to operator++, with an error code.
const directory_entry * operator->() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
file_type
An enumeration for the file system's view of the type.
std::chrono::time_point< std::chrono::system_clock, D > TimePoint
A time point on the system clock.
TracingFileSystemImpl< std::atomic< std::size_t > > AtomicTracingFileSystem
Concurrent-safe tracing filesystem.
TracingFileSystemImpl< std::size_t > TracingFileSystem
Single-threaded tracing filesystem.
LLVM_ABI void collectVFSEntries(RedirectingFileSystem &VFS, SmallVectorImpl< YAMLVFSEntry > &CollectedEntries)
Collect all pairs of <virtual path, real path> entries from the VFS.
LLVM_ABI std::unique_ptr< FileSystem > createPhysicalFileSystem()
Create an vfs::FileSystem for the 'real' file system, as seen by the operating system.
LLVM_ABI llvm::sys::fs::UniqueID getNextVirtualUniqueID()
Get a globally unique ID for a virtual file or directory.
LLVM_ABI IntrusiveRefCntPtr< FileSystem > getRealFileSystem()
Gets an vfs::FileSystem for the 'real' file system, as seen by the operating system.
LLVM_ABI 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.
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
auto reverse(ContainerTy &&C)
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
@ End
Run the machine verifier once, at the end of the pipeline.
Implement std::hash so that hash_code can be used in STL containers.
std::optional< StringRef > getExternalRedirect() const
If the found Entry maps the input path to a path in the external file system (i.e.
Entry * E
The entry the looked-up path corresponds to.
LLVM_ABI LookupResult(Entry *E, sys::path::const_iterator Start, sys::path::const_iterator End)
llvm::SmallVector< Entry *, 32 > Parents
Chain of parent directory entries for E.
YAMLVFSEntry(T1 &&VPath, T2 &&RPath, bool IsDirectory=false)
An interface for virtual file systems to provide an iterator over the (non-recursive) contents of a d...
virtual std::error_code increment()=0
Sets CurrentEntry to the next entry in the directory on success, to directory_entry() at end,...
directory_entry CurrentEntry
LLVM_ABI Status makeStatus() const
llvm::sys::fs::file_type Type
std::unique_ptr< llvm::MemoryBuffer > Buffer
llvm::sys::fs::perms Perms
llvm::sys::fs::UniqueID DirUID
Keeps state for the recursive_directory_iterator.
std::vector< directory_iterator > Stack