9#ifndef LLVM_SUPPORT_FILECOLLECTOR_H
10#define LLVM_SUPPORT_FILECOLLECTOR_H
20class FileCollectorFileSystem;
29 void addDirectory(
const Twine &Dir);
35 return Seen.insert(Path).second;
43 std::error_code &EC) = 0;
99 std::error_code writeMapping(
StringRef MappingFile);
106 std::error_code copyFiles(
bool StopOnError =
true);
112 std::shared_ptr<FileCollector>
Collector);
118 if (sys::fs::is_directory(VirtualPath))
119 VFSWriter.addDirectoryMapping(VirtualPath, RealPath);
121 VFSWriter.addFileMapping(VirtualPath, RealPath);
125 void addFileImpl(
StringRef SrcPath)
override;
130 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.
virtual ~FileCollectorBase()
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.
Captures file system interaction and generates data to be later replayed with the RedirectingFileSyst...
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.
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.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
An input iterator over the entries in a virtual path, similar to llvm::sys::fs::directory_iterator.
This is an optimization pass for GlobalISel generic memory operations.
SmallString< 256 > VirtualPath
SmallString< 256 > CopyFrom