diff options
author | Oleksiy Vyalov <ovyalov@google.com> | 2015-04-15 14:35:10 +0000 |
---|---|---|
committer | Oleksiy Vyalov <ovyalov@google.com> | 2015-04-15 14:35:10 +0000 |
commit | 280d8dc9f06989dea6b304d780f43e522146a6eb (patch) | |
tree | e917ca474ce2678be6b6ee4ec0b7d7d3f23c72fb /lldb/source/Utility/ModuleCache.h | |
parent | 3c886e6efcd3de03a2851f59d062176fe5c39e96 (diff) | |
download | bcm5719-llvm-280d8dc9f06989dea6b304d780f43e522146a6eb.tar.gz bcm5719-llvm-280d8dc9f06989dea6b304d780f43e522146a6eb.zip |
Add Modulecache::GetAndPut method which wraps sequence of Get and Put (if module wasn't found in cache) calls.
http://reviews.llvm.org/D9013
llvm-svn: 235011
Diffstat (limited to 'lldb/source/Utility/ModuleCache.h')
-rw-r--r-- | lldb/source/Utility/ModuleCache.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/Utility/ModuleCache.h b/lldb/source/Utility/ModuleCache.h index edab6cbb29d..5b484aae523 100644 --- a/lldb/source/Utility/ModuleCache.h +++ b/lldb/source/Utility/ModuleCache.h @@ -16,6 +16,7 @@ #include "lldb/Core/Error.h" #include "lldb/Host/FileSpec.h" +#include <functional> #include <string> #include <unordered_map> @@ -44,6 +45,8 @@ class UUID; class ModuleCache { public: + using Downloader = std::function<Error (const ModuleSpec&, FileSpec&)>; + Error Put (const FileSpec &root_dir_spec, const char *hostname, @@ -57,6 +60,14 @@ public: lldb::ModuleSP &cached_module_sp, bool *did_create_ptr); + Error + GetAndPut(const FileSpec &root_dir_spec, + const char *hostname, + const ModuleSpec &module_spec, + const Downloader &downloader, + lldb::ModuleSP &cached_module_sp, + bool *did_create_ptr); + private: static FileSpec GetModuleDirectory (const FileSpec &root_dir_spec, const UUID &uuid); |