From ccb417a7c1456427b76914e8a11ca87b4926eeb3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Jan 2020 08:41:57 +0200 Subject: Use scope::var_pool() --- libbuild2/cxx/init.cxx | 143 ++++++++++++++++++++++++------------------------- 1 file changed, 71 insertions(+), 72 deletions(-) (limited to 'libbuild2/cxx') diff --git a/libbuild2/cxx/init.cxx b/libbuild2/cxx/init.cxx index d2601c4..cf27aaa 100644 --- a/libbuild2/cxx/init.cxx +++ b/libbuild2/cxx/init.cxx @@ -91,8 +91,7 @@ namespace build2 // auto enter = [&rs] (const char* v) -> const variable& { - return rs.ctx.var_pool.rw (rs).insert ( - v, variable_visibility::project); + return rs.var_pool ().insert (v, variable_visibility::project); }; //bool concepts (false); auto& v_c (enter ("cxx.features.concepts")); @@ -373,7 +372,7 @@ namespace build2 // Enter all the variables and initialize the module data. // - auto& v (rs.ctx.var_pool.rw (rs)); + auto& vp (rs.var_pool ()); cc::config_data d { cc::lang::cxx, @@ -389,16 +388,16 @@ namespace build2 // // NOTE: remember to update documentation if changing anything here. // - v.insert ("config.cxx", true), - v.insert ("config.cxx.id", true), - v.insert ("config.cxx.version", true), - v.insert ("config.cxx.target", true), - v.insert ("config.cxx.std", true), - v.insert ("config.cxx.poptions", true), - v.insert ("config.cxx.coptions", true), - v.insert ("config.cxx.loptions", true), - v.insert ("config.cxx.aoptions", true), - v.insert ("config.cxx.libs", true), + vp.insert ("config.cxx", true), + vp.insert ("config.cxx.id", true), + vp.insert ("config.cxx.version", true), + vp.insert ("config.cxx.target", true), + vp.insert ("config.cxx.std", true), + vp.insert ("config.cxx.poptions", true), + vp.insert ("config.cxx.coptions", true), + vp.insert ("config.cxx.loptions", true), + vp.insert ("config.cxx.aoptions", true), + vp.insert ("config.cxx.libs", true), // List of translatable headers. Inclusions of such headers are // translated to the corresponding header unit imports. @@ -409,48 +408,48 @@ namespace build2 // opposed to -I) header search paths. Note also that all entries must // be specified before loading the cxx module. // - &v.insert ("config.cxx.translatable_headers", true), + &vp.insert ("config.cxx.translatable_headers", true), - v.insert ("cxx.path"), - v.insert ("cxx.mode"), - v.insert ("cxx.sys_lib_dirs"), - v.insert ("cxx.sys_inc_dirs"), + vp.insert ("cxx.path"), + vp.insert ("cxx.mode"), + vp.insert ("cxx.sys_lib_dirs"), + vp.insert ("cxx.sys_inc_dirs"), - v.insert ("cxx.std", variable_visibility::project), + vp.insert ("cxx.std", variable_visibility::project), - v.insert ("cxx.poptions"), - v.insert ("cxx.coptions"), - v.insert ("cxx.loptions"), - v.insert ("cxx.aoptions"), - v.insert ("cxx.libs"), + vp.insert ("cxx.poptions"), + vp.insert ("cxx.coptions"), + vp.insert ("cxx.loptions"), + vp.insert ("cxx.aoptions"), + vp.insert ("cxx.libs"), - &v.insert ("cxx.translatable_headers"), + &vp.insert ("cxx.translatable_headers"), - v["cc.poptions"], - v["cc.coptions"], - v["cc.loptions"], - v["cc.aoptions"], - v["cc.libs"], + vp["cc.poptions"], + vp["cc.coptions"], + vp["cc.loptions"], + vp["cc.aoptions"], + vp["cc.libs"], - v.insert ("cxx.export.poptions"), - v.insert ("cxx.export.coptions"), - v.insert ("cxx.export.loptions"), - v.insert> ("cxx.export.libs"), + vp.insert ("cxx.export.poptions"), + vp.insert ("cxx.export.coptions"), + vp.insert ("cxx.export.loptions"), + vp.insert> ("cxx.export.libs"), - v["cc.export.poptions"], - v["cc.export.coptions"], - v["cc.export.loptions"], - v["cc.export.libs"], + vp["cc.export.poptions"], + vp["cc.export.coptions"], + vp["cc.export.loptions"], + vp["cc.export.libs"], - v.insert ("cxx.stdlib"), + vp.insert ("cxx.stdlib"), - v["cc.runtime"], - v["cc.stdlib"], + vp["cc.runtime"], + vp["cc.stdlib"], - v["cc.type"], - v["cc.system"], - v["cc.module_name"], - v["cc.reprocess"], + vp["cc.type"], + vp["cc.system"], + vp["cc.module_name"], + vp["cc.reprocess"], // Ability to signal that source is already (partially) preprocessed. // Valid values are 'none' (not preprocessed), 'includes' (no #include @@ -464,46 +463,46 @@ namespace build2 // What about header unit imports? Well, they are in a sense // standardized precompiled headers so we treat them as includes. // - v.insert ("cxx.preprocessed"), + vp.insert ("cxx.preprocessed"), nullptr, // cxx.features.symexport (set in init() below). - v.insert ("cxx.id"), - v.insert ("cxx.id.type"), - v.insert ("cxx.id.variant"), + vp.insert ("cxx.id"), + vp.insert ("cxx.id.type"), + vp.insert ("cxx.id.variant"), - v.insert ("cxx.class"), + vp.insert ("cxx.class"), - &v.insert ("cxx.version"), - &v.insert ("cxx.version.major"), - &v.insert ("cxx.version.minor"), - &v.insert ("cxx.version.patch"), - &v.insert ("cxx.version.build"), + &vp.insert ("cxx.version"), + &vp.insert ("cxx.version.major"), + &vp.insert ("cxx.version.minor"), + &vp.insert ("cxx.version.patch"), + &vp.insert ("cxx.version.build"), - &v.insert ("cxx.variant_version"), - &v.insert ("cxx.variant_version.major"), - &v.insert ("cxx.variant_version.minor"), - &v.insert ("cxx.variant_version.patch"), - &v.insert ("cxx.variant_version.build"), + &vp.insert ("cxx.variant_version"), + &vp.insert ("cxx.variant_version.major"), + &vp.insert ("cxx.variant_version.minor"), + &vp.insert ("cxx.variant_version.patch"), + &vp.insert ("cxx.variant_version.build"), - v.insert ("cxx.signature"), - v.insert ("cxx.checksum"), + vp.insert ("cxx.signature"), + vp.insert ("cxx.checksum"), - v.insert ("cxx.pattern"), + vp.insert ("cxx.pattern"), - v.insert ("cxx.target"), + vp.insert ("cxx.target"), - v.insert ("cxx.target.cpu"), - v.insert ("cxx.target.vendor"), - v.insert ("cxx.target.system"), - v.insert ("cxx.target.version"), - v.insert ("cxx.target.class") + vp.insert ("cxx.target.cpu"), + vp.insert ("cxx.target.vendor"), + vp.insert ("cxx.target.system"), + vp.insert ("cxx.target.version"), + vp.insert ("cxx.target.class") }; // Alias some cc. variables as cxx. // - v.insert_alias (d.c_runtime, "cxx.runtime"); - v.insert_alias (d.c_module_name, "cxx.module_name"); + vp.insert_alias (d.c_runtime, "cxx.runtime"); + vp.insert_alias (d.c_module_name, "cxx.module_name"); assert (mod == nullptr); config_module* m (new config_module (move (d))); @@ -583,7 +582,7 @@ namespace build2 config_module& cm (*rs.find_module ("cxx.guess")); - auto& vp (rs.ctx.var_pool.rw (rs)); + auto& vp (rs.var_pool ()); bool modules (cast (rs["cxx.features.modules"])); -- cgit v1.1