5#include <unordered_map>
16 std::optional<std::vector<std::string>>
19 auto it = possible_class_types_cache_.find(
key);
20 if (it == possible_class_types_cache_.end())
26 const std::string &
key,
27 const std::vector<std::string> &types)
29 possible_class_types_cache_[
key] = types;
36 auto it = method_exists_cache_.find(
key);
37 if (it != method_exists_cache_.end())
44 method_exists_cache_[
key] = exists;
52 auto it = math_dispatch_cache_.find(
key);
53 if (it != math_dispatch_cache_.end())
60 math_dispatch_cache_[
key] = matches;
67 possible_class_types_cache_.clear();
68 method_exists_cache_.clear();
69 math_dispatch_cache_.clear();
73 std::unordered_map<std::string, std::vector<std::string>>
74 possible_class_types_cache_;
75 std::unordered_map<std::string, bool> method_exists_cache_;
76 std::unordered_map<std::string, bool> math_dispatch_cache_;
Dedicated cache for function-call resolution data.
Definition cache.h:12
std::optional< bool > get_math_dispatch_classification(const std::string &key) const
Definition cache.h:50
std::optional< bool > get_method_exists(const std::string &key) const
Definition cache.h:34
void set_method_exists(const std::string &key, bool exists)
Definition cache.h:42
std::optional< std::vector< std::string > > get_possible_class_types(const std::string &key) const
Definition cache.h:17
void set_math_dispatch_classification(const std::string &key, bool matches)
Definition cache.h:58
void set_possible_class_types(const std::string &key, const std::vector< std::string > &types)
Definition cache.h:25
void clear()
Definition cache.h:65
uint256_t key
Definition solidity_mapping.c:1