summaryrefslogtreecommitdiffstats
path: root/lldb/source/Utility/ModuleCache.h
diff options
context:
space:
mode:
authorOleksiy Vyalov <ovyalov@google.com>2015-04-15 14:35:10 +0000
committerOleksiy Vyalov <ovyalov@google.com>2015-04-15 14:35:10 +0000
commit280d8dc9f06989dea6b304d780f43e522146a6eb (patch)
treee917ca474ce2678be6b6ee4ec0b7d7d3f23c72fb /lldb/source/Utility/ModuleCache.h
parent3c886e6efcd3de03a2851f59d062176fe5c39e96 (diff)
downloadbcm5719-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.h11
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);
OpenPOWER on IntegriCloud