From 19af3f6b0873a92582e4787a87a6f14df53ff6ae Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 10 Oct 2022 18:22:31 +0200 Subject: Preparatory work for public/private variable distinction We still always use the public var_pool from context but where required, all access now goes through scope::var_pool(). --- libbuild2/context.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libbuild2/context.cxx') diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx index a7df959..e44d79f 100644 --- a/libbuild2/context.cxx +++ b/libbuild2/context.cxx @@ -52,7 +52,10 @@ namespace build2 variable_override_cache global_override_cache; strings global_var_overrides; - data (context& c): scopes (c), targets (c), var_pool (&c /* global */) {} + data (context& c) + : scopes (c), + targets (c), + var_pool (&c /* shared */, nullptr /* outer */) {} }; context:: @@ -479,6 +482,7 @@ namespace build2 unique_ptr p ( new variable { n + '.' + to_string (i + 1) + '.' + k, + &vp /* owner */, nullptr /* aliases */, nullptr /* type */, nullptr /* overrides */, @@ -708,7 +712,7 @@ namespace build2 auto find_ovar = [this] (const char* n) { - const variable* v (var_pool.find (n)); + const variable* v (var_pool.find (n)); // @@ TMP: pub/prv vars // The operation variable should have prerequisite or target visibility. // -- cgit v1.1