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