aboutsummaryrefslogtreecommitdiff
path: root/build2/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-01 09:49:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-01 09:49:18 +0200
commit26146d391f179dd9e4e5e1f70a52ba99d6a0847d (patch)
treec79762ff1fd15bfa25fdeacf9f9e6efe338354bf /build2/context.cxx
parent7253ffee27f6cae34e63a72b2d3d10db10571ecc (diff)
Get part of variable override implementation
Diffstat (limited to 'build2/context.cxx')
-rw-r--r--build2/context.cxx17
1 files changed, 3 insertions, 14 deletions
diff --git a/build2/context.cxx b/build2/context.cxx
index dbfffdb..21d683b 100644
--- a/build2/context.cxx
+++ b/build2/context.cxx
@@ -47,6 +47,8 @@ namespace build2
variable_overrides vos;
+ variable_override_cache.clear ();
+
targets.clear ();
scopes.clear ();
var_pool.clear ();
@@ -108,13 +110,6 @@ namespace build2
const variable& var (var_pool.find (t.value));
const string& n (var.name);
- // The first variable in the override list is always the cache. Note
- // that we might already be overridden by an earlier cmd line var.
- //
- if (var.override == nullptr)
- var.override.reset (new variable {
- n + ".__cache", nullptr, nullptr, variable_visibility::normal});
-
// Calculate visibility and kind.
//
variable_visibility v (c == '%'
@@ -125,7 +120,7 @@ namespace build2
// We might already have a variable for this kind of override.
//
- const variable* o (var.override.get ());
+ const variable* o (&var); // Step behind.
for (; o->override != nullptr; o = o->override.get ())
{
if (o->override->visibility == v &&
@@ -159,12 +154,6 @@ namespace build2
value& v (p.first);
v.assign (move (val), var); // Original var for diagnostics.
-
- // Also make sure the original variable itself is set (to at least
- // NULL) so that lookup finds something if nobody actually sets it
- // down the line.
- //
- gs.vars.assign (var);
}
else
vos.emplace_back (variable_override {var, *o, move (val)});