From 9400ddfc949025abddb04344624fba3945562d33 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Mar 2019 14:30:28 +0200 Subject: Move bunch of root scope-only data members to root_extra --- build2/dist/init.cxx | 4 ++-- build2/dist/operation.cxx | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'build2/dist') diff --git a/build2/dist/init.cxx b/build2/dist/init.cxx index b51930b..dabaf45 100644 --- a/build2/dist/init.cxx +++ b/build2/dist/init.cxx @@ -30,9 +30,9 @@ namespace build2 l5 ([&]{trace << "for " << rs.out_path ();}); - // Register meta-operation. + // Register the meta-operation. // - rs.meta_operations.insert (dist_id, mo_dist); + rs.insert_meta_operation (dist_id, mo_dist); // Enter module variables. Do it during boot in case they get assigned // in bootstrap.build (which is customary for, e.g., dist.package). diff --git a/build2/dist/operation.cxx b/build2/dist/operation.cxx index b227bbd..5d46b6e 100644 --- a/build2/dist/operation.cxx +++ b/build2/dist/operation.cxx @@ -143,11 +143,13 @@ namespace build2 const path locf (""); const location loc (&locf); // Dummy location. - for (operations::size_type id (default_id + 1); - id < rs->operations.size (); + const operations& ops (rs->root_extra->operations); + + for (operations::size_type id (default_id + 1); // Skip default_id. + id < ops.size (); ++id) { - if (const operation_info* oif = rs->operations[id]) + if (const operation_info* oif = ops[id]) { // Skip aliases (e.g., update-for-install). In fact, one can argue // the default update should be sufficient since it is assumed to @@ -164,7 +166,7 @@ namespace build2 { if (operation_id pid = oif->pre (params, dist_id, loc)) { - const operation_info* poif (rs->operations[pid]); + const operation_info* poif (ops[pid]); set_current_oif (*poif, oif, false /* diag_noise */); action a (dist_id, poif->id, oif->id); match (params, a, ts, @@ -183,7 +185,7 @@ namespace build2 { if (operation_id pid = oif->post (params, dist_id)) { - const operation_info* poif (rs->operations[pid]); + const operation_info* poif (ops[pid]); set_current_oif (*poif, oif, false /* diag_noise */); action a (dist_id, poif->id, oif->id); match (params, a, ts, @@ -340,7 +342,7 @@ namespace build2 // Copy over all the files. Apply post-processing callbacks. // - module& mod (*rs->modules.lookup (module::name)); + module& mod (*rs->lookup_module (module::name)); prog = prog && show_progress (1 /* max_verb */); size_t prog_percent (0); @@ -374,7 +376,7 @@ namespace build2 { srs = &scopes.find (out_root / pd); - if (auto* m = srs->modules.lookup (module::name)) + if (auto* m = srs->lookup_module (module::name)) cbs = &m->callbacks_; else fail << "dist module not loaded in subproject " << pd; -- cgit v1.1