Go to the documentation of this file.
9 #ifndef LLVM_SUPPORT_FILECOLLECTOR_H
10 #define LLVM_SUPPORT_FILECOLLECTOR_H
19 class FileCollectorFileSystem;
42 std::error_code &EC) = 0;
105 std::error_code
copyFiles(
bool StopOnError =
true);
111 std::shared_ptr<FileCollector>
Collector);
129 std::error_code &EC)
override;
146 #endif // LLVM_SUPPORT_FILECOLLECTOR_H
This is an optimization pass for GlobalISel generic memory operations.
const std::string Root
The directory where collected files are copied to in copyFiles().
bool markAsSeen(StringRef Path)
const std::string OverlayRoot
The root directory where the VFS overlay lives.
void addFileImpl(StringRef SrcPath) override
static IntrusiveRefCntPtr< vfs::FileSystem > createCollectorVFS(IntrusiveRefCntPtr< vfs::FileSystem > BaseFS, std::shared_ptr< FileCollector > Collector)
Create a VFS that uses Collector to collect files accessed via BaseFS.
An input iterator over the entries in a virtual path, similar to llvm::sys::fs::directory_iterator.
std::pair< typename Base::iterator, bool > insert(StringRef key)
Register Usage Information Collector
virtual void addFileImpl(StringRef SrcPath)=0
std::error_code writeMapping(StringRef MappingFile)
Write the yaml mapping (for the VFS) to the given file.
llvm::vfs::directory_iterator addDirectoryImpl(const llvm::Twine &Dir, IntrusiveRefCntPtr< vfs::FileSystem > FS, std::error_code &EC) override
PathCanonicalizer Canonicalizer
Helper utility for canonicalizing paths.
virtual ~FileCollectorBase()
std::error_code copyFiles(bool StopOnError=true)
Copy the files into the root directory.
dot regions Print regions of function to dot file(with no function bodies)"
StringSet Seen
Tracks already seen files so they can be skipped.
void addFile(const Twine &file)
StringSet - A wrapper for StringMap that provides set-like functionality.
StringRef - Represent a constant reference to a string, i.e.
std::mutex Mutex
Synchronizes access to internal data structures.
SmallString< 256 > VirtualPath
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void addFileMapping(StringRef VirtualPath, StringRef RealPath)
bool is_directory(const basic_file_status &status)
Does status represent a directory?
virtual llvm::vfs::directory_iterator addDirectoryImpl(const llvm::Twine &Dir, IntrusiveRefCntPtr< vfs::FileSystem > FS, std::error_code &EC)=0
SmallString< 256 > CopyFrom
PathStorage canonicalize(StringRef SrcPath)
Canonicalize a pair of virtual and real paths.
Helper utility that encapsulates the logic for canonicalizing a virtual path and a path to copy from.
void addDirectoryMapping(StringRef VirtualPath, StringRef RealPath)
FileCollector(std::string Root, std::string OverlayRoot)
Root is the directory where collected files are will be stored.
Captures file system interaction and generates data to be later replayed with the RedirectingFileSyst...
void addDirectory(const Twine &Dir)
vfs::YAMLVFSWriter VFSWriter
The yaml mapping writer.
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...