diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2020-08-22 00:36:32 -0700 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2020-08-22 10:04:27 -0700 |
| commit | bb894b97821a1c970ce0c3243aaebbfa94add15c (patch) | |
| tree | d338e9899a661377cbb97b0dd1284626d12902bb /lldb/source/Utility/Reproducer.cpp | |
| parent | 8e06bf6b3a2e8d25e56cd52dca0cf3ff1b37b5d1 (diff) | |
| download | llvm-bb894b97821a1c970ce0c3243aaebbfa94add15c.tar.gz llvm-bb894b97821a1c970ce0c3243aaebbfa94add15c.tar.bz2 llvm-bb894b97821a1c970ce0c3243aaebbfa94add15c.zip | |
[lldb] Extract reproducer providers & co into their own header.
Extract all the provider related logic from Reproducer.h and move it
into its own header ReproducerProvider.h. These classes are seeing most
of the development these days and this reorganization reduces
incremental compilation from ~520 to ~110 files when making changes to
the new header.
Diffstat (limited to 'lldb/source/Utility/Reproducer.cpp')
| -rw-r--r-- | lldb/source/Utility/Reproducer.cpp | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/lldb/source/Utility/Reproducer.cpp b/lldb/source/Utility/Reproducer.cpp index 35d145e4d61b..9276c7449d7b 100644 --- a/lldb/source/Utility/Reproducer.cpp +++ b/lldb/source/Utility/Reproducer.cpp @@ -8,6 +8,7 @@ #include "lldb/Utility/Reproducer.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/ReproducerProvider.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Threading.h" @@ -263,58 +264,3 @@ bool Loader::HasFile(StringRef file) { auto it = std::lower_bound(m_files.begin(), m_files.end(), file.str()); return (it != m_files.end()) && (*it == file); } - -llvm::Expected<std::unique_ptr<DataRecorder>> -DataRecorder::Create(const FileSpec &filename) { - std::error_code ec; - auto recorder = std::make_unique<DataRecorder>(std::move(filename), ec); - if (ec) - return llvm::errorCodeToError(ec); - return std::move(recorder); -} - -llvm::Expected<std::unique_ptr<YamlRecorder>> -YamlRecorder::Create(const FileSpec &filename) { - std::error_code ec; - auto recorder = std::make_unique<YamlRecorder>(std::move(filename), ec); - if (ec) - return llvm::errorCodeToError(ec); - return std::move(recorder); -} - -void VersionProvider::Keep() { - FileSpec file = GetRoot().CopyByAppendingPathComponent(Info::file); - std::error_code ec; - llvm::raw_fd_ostream os(file.GetPath(), ec, llvm::sys::fs::OF_Text); - if (ec) - return; - os << m_version << "\n"; -} - -void FileProvider::RecordInterestingDirectory(const llvm::Twine &dir) { - if (m_collector) - m_collector->addFile(dir); -} - -void FileProvider::RecordInterestingDirectoryRecursive(const llvm::Twine &dir) { - if (m_collector) - m_collector->addDirectory(dir); -} - -void ProviderBase::anchor() {} -char CommandProvider::ID = 0; -char FileProvider::ID = 0; -char ProviderBase::ID = 0; -char VersionProvider::ID = 0; -char WorkingDirectoryProvider::ID = 0; -char HomeDirectoryProvider::ID = 0; -const char *CommandProvider::Info::file = "command-interpreter.yaml"; -const char *CommandProvider::Info::name = "command-interpreter"; -const char *FileProvider::Info::file = "files.yaml"; -const char *FileProvider::Info::name = "files"; -const char *VersionProvider::Info::file = "version.txt"; -const char *VersionProvider::Info::name = "version"; -const char *WorkingDirectoryProvider::Info::file = "cwd.txt"; -const char *WorkingDirectoryProvider::Info::name = "cwd"; -const char *HomeDirectoryProvider::Info::file = "home.txt"; -const char *HomeDirectoryProvider::Info::name = "home"; |
