aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/init.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-01-29 09:19:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-01-29 09:19:06 +0200
commitc4fcbad1cb603756dc4dac65392feb86be1a722d (patch)
treeda9c9c2278c63d20237a7178fde450d7472a59c9 /libbuild2/cc/init.cxx
parentccb417a7c1456427b76914e8a11ca87b4926eeb3 (diff)
Rename module_base to module, redo module boot/init argument passing
Diffstat (limited to 'libbuild2/cc/init.cxx')
-rw-r--r--libbuild2/cc/init.cxx28
1 files changed, 12 insertions, 16 deletions
diff --git a/libbuild2/cc/init.cxx b/libbuild2/cc/init.cxx
index 0536e0f..436de3b 100644
--- a/libbuild2/cc/init.cxx
+++ b/libbuild2/cc/init.cxx
@@ -62,10 +62,9 @@ namespace build2
core_vars_init (scope& rs,
scope&,
const location& loc,
- unique_ptr<module_base>&,
bool first,
bool,
- const variable_map&)
+ module_init_extra&)
{
tracer trace ("cc::core_vars_init");
l5 ([&]{trace << "for " << rs;});
@@ -159,16 +158,17 @@ namespace build2
core_guess_init (scope& rs,
scope&,
const location& loc,
- unique_ptr<module_base>&,
bool first,
bool,
- const variable_map& h)
+ module_init_extra& extra)
{
tracer trace ("cc::core_guess_init");
l5 ([&]{trace << "for " << rs;});
assert (first);
+ auto& h (extra.hints);
+
// Load cc.core.vars.
//
load_module (rs, rs, "cc.core.vars", loc);
@@ -232,10 +232,9 @@ namespace build2
core_config_init (scope& rs,
scope&,
const location& loc,
- unique_ptr<module_base>&,
bool first,
bool,
- const variable_map& hints)
+ module_init_extra& extra)
{
tracer trace ("cc::core_config_init");
l5 ([&]{trace << "for " << rs;});
@@ -296,7 +295,7 @@ namespace build2
h.assign ("config.bin.target") =
cast<target_triplet> (rs["cc.target"]).string ();
- if (auto l = hints["config.bin.pattern"])
+ if (auto l = extra.hints["config.bin.pattern"])
h.assign ("config.bin.pattern") = cast<string> (l);
}
@@ -342,10 +341,9 @@ namespace build2
core_init (scope& rs,
scope&,
const location& loc,
- unique_ptr<module_base>&,
bool first,
bool,
- const variable_map& hints)
+ module_init_extra& extra)
{
tracer trace ("cc::core_init");
l5 ([&]{trace << "for " << rs;});
@@ -356,7 +354,7 @@ namespace build2
// Load cc.core.config.
//
- load_module (rs, rs, "cc.core.config", loc, hints);
+ load_module (rs, rs, "cc.core.config", loc, extra.hints);
// Load the bin module.
//
@@ -433,34 +431,32 @@ namespace build2
config_init (scope& rs,
scope& bs,
const location& loc,
- unique_ptr<module_base>&,
bool,
bool,
- const variable_map& hints)
+ module_init_extra& extra)
{
tracer trace ("cc::config_init");
return init_alias (trace, rs, bs,
"cc.config",
"c.config", "c.config.loaded",
"cxx.config", "cxx.config.loaded",
- loc, hints);
+ loc, extra.hints);
}
bool
init (scope& rs,
scope& bs,
const location& loc,
- unique_ptr<module_base>&,
bool,
bool,
- const variable_map& hints)
+ module_init_extra& extra)
{
tracer trace ("cc::init");
return init_alias (trace, rs, bs,
"cc",
"c", "c.loaded",
"cxx", "cxx.loaded",
- loc, hints);
+ loc, extra.hints);
}
static const module_functions mod_functions[] =