diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-09 11:38:42 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-09 11:38:42 +0200 |
commit | 5f7c3f923de106f9d204a8f3500274731ae84fd9 (patch) | |
tree | a4993277c75e61b73bb6f984e2ad0c329a514f9a /build2/variable | |
parent | 7a7b8ba432977282a90567c77822a72645d2a5c8 (diff) |
Tweak override logic WRT location of overridden value
Diffstat (limited to 'build2/variable')
-rw-r--r-- | build2/variable | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/build2/variable b/build2/variable index 5a33037..77e9db2 100644 --- a/build2/variable +++ b/build2/variable @@ -277,11 +277,15 @@ namespace build2 belongs (const T& x) const {return vars == &x.vars;} lookup (): value (nullptr), vars (nullptr) {} - lookup (const value_type* v, const variable_map* vs) - : value (v), vars (v != nullptr ? vs : nullptr) {} template <typename T> lookup (const value_type& v, const T& x): lookup (&v, &x.vars) {} + + lookup (const value_type& v, const variable_map& vs) + : value (&v), vars (&vs) {} + + lookup (const value_type* v, const variable_map* vs) + : value (v), vars (v != nullptr ? vs : nullptr) {} }; // Two lookups are equal if they point to the same variable. @@ -735,7 +739,7 @@ namespace build2 const variable_map* stem_vars = nullptr; // NULL means there is no stem. }; - extern std::map<const variable_map*, + extern std::map<pair<const variable_map*, const variable*>, variable_override_value> variable_override_cache; } |