From 8618078b90189fb49e9c0a76ac01d471b51f1e93 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 3 May 2019 13:23:33 +0200 Subject: Rename [config.]cxx.header_units to importable_headers --- build2/c/init.cxx | 4 ++-- build2/cc/common.hxx | 8 ++++---- build2/cc/compile-rule.cxx | 10 +++++----- build2/cc/module.cxx | 16 ++++++++-------- build2/cc/types.hxx | 7 ++++++- build2/cxx/init.cxx | 10 +++++----- 6 files changed, 30 insertions(+), 25 deletions(-) (limited to 'build2') diff --git a/build2/c/init.cxx b/build2/c/init.cxx index 6944680..dbaff78 100644 --- a/build2/c/init.cxx +++ b/build2/c/init.cxx @@ -168,7 +168,7 @@ namespace build2 v.insert ("config.c.coptions", true), v.insert ("config.c.loptions", true), v.insert ("config.c.libs", true), - nullptr /* config.c.header_units */, + nullptr /* config.c.importable_headers */, v.insert ("c.path"), v.insert ("c.sys_lib_dirs"), @@ -178,7 +178,7 @@ namespace build2 v.insert ("c.coptions"), v.insert ("c.loptions"), v.insert ("c.libs"), - nullptr /* c.header_units */, + nullptr /* c.importable_headers */, v["cc.poptions"], v["cc.coptions"], diff --git a/build2/cc/common.hxx b/build2/cc/common.hxx index f9f13c1..dec71ed 100644 --- a/build2/cc/common.hxx +++ b/build2/cc/common.hxx @@ -47,7 +47,7 @@ namespace build2 const variable& config_x_coptions; const variable& config_x_loptions; const variable& config_x_libs; - const variable* config_x_header_units; + const variable* config_x_importable_headers; const variable& x_path; // Compiler process path. const variable& x_sys_lib_dirs; // System library search directories. @@ -57,7 +57,7 @@ namespace build2 const variable& x_coptions; const variable& x_loptions; const variable& x_libs; - const variable* x_header_units; + const variable* x_importable_headers; const variable& c_poptions; // cc.* const variable& c_coptions; @@ -140,7 +140,7 @@ namespace build2 bool modules; // x.features.modules bool symexport; // x.features.symexport - const strings* hdr_units; // x.header_units (NULL if unused/empty) + const strings* import_hdr; // x.importable_headers (NULL if unused/empty). const dir_paths& sys_lib_dirs; // x.sys_lib_dirs const dir_paths& sys_inc_dirs; // x.sys_inc_dirs @@ -210,7 +210,7 @@ namespace build2 tstd (std), modules (fm), symexport (fs), - hdr_units (nullptr), + import_hdr (nullptr), sys_lib_dirs (sld), sys_inc_dirs (sid), sys_lib_dirs_extra (sle), sys_inc_dirs_extra (sie), x_src (src), x_mod (mod), x_hdr (hdr), x_inc (inc) {} diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx index 07677a9..dd38945 100644 --- a/build2/cc/compile-rule.cxx +++ b/build2/cc/compile-rule.cxx @@ -877,8 +877,8 @@ namespace build2 if (ut == unit_type::module_iface) cs.append (&md.symexport, sizeof (md.symexport)); - if (hdr_units != nullptr) - hash_options (cs, *hdr_units); + if (import_hdr != nullptr) + hash_options (cs, *import_hdr); if (md.pp != preprocessed::all) { @@ -2003,11 +2003,11 @@ namespace build2 { // See if we need to translate this include to import. // - if (hdr_units != nullptr) + if (const strings* ih = import_hdr) { - auto i (lower_bound (hdr_units->begin (), hdr_units->end (), hp)); + auto i (lower_bound (ih->begin (), ih->end (), hp)); - if (i != hdr_units->end () && *i == hp) + if (i != ih->end () && *i == hp) { // Doesn't seem there is much use in trying to correlate the // followup in this case; what else can the compiler import? diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx index a8f25c6..20e39a8 100644 --- a/build2/cc/module.cxx +++ b/build2/cc/module.cxx @@ -463,20 +463,20 @@ namespace build2 rs.assign (x_libs) += cast_null ( config::optional (rs, config_x_libs)); - // config.x.header_units + // config.x.importable_header // // It's still fuzzy whether specifying (or maybe tweaking) this list in // the configuration will be a common thing to do so for now we use // omitted. It's also probably too early to think whether we should have // the cc.* version and what the semantics should be. // - if (x_header_units != nullptr) + if (x_importable_headers != nullptr) { - lookup l (config::omitted (rs, *config_x_header_units).first); + lookup l (config::omitted (rs, *config_x_importable_headers).first); // @@ MODHDR: if(modules) ? // - rs.assign (x_header_units) += cast_null (l); + rs.assign (x_importable_headers) += cast_null (l); } // Load cc.core.config. @@ -503,20 +503,20 @@ namespace build2 if (!cast_false (rs["cc.core.loaded"])) load_module (rs, rs, "cc.core", loc); - // Process, sort, and cache (in this->hdr_units) the header units list. + // Process, sort, and cache (in this->import_hdr) importable headers. // Keep the cache NULL if unused or empty. // // @@ MODHDR TODO: translate <> to absolute paths. // @@ MODHDR TODO: support exclusions entries (e.g., -)? // - if (modules && x_header_units != nullptr) + if (modules && x_importable_headers != nullptr) { - strings* v (cast_null (rs.assign (x_header_units))); + strings* v (cast_null (rs.assign (x_importable_headers))); if (v != nullptr && !v->empty ()) { sort (v->begin (), v->end ()); - hdr_units = v; + import_hdr = v; } } diff --git a/build2/cc/types.hxx b/build2/cc/types.hxx index 4403e4c..60c9a34 100644 --- a/build2/cc/types.hxx +++ b/build2/cc/types.hxx @@ -21,7 +21,12 @@ namespace build2 // // Note that our terminology doesn't exactly align with the (current) // standard where a header unit is not a module (that is, you either - // import a module unit or a header unit). + // import a "module [interface translation unit]" or a "[synthesized] + // header [translation] unit"). On the other hand, lots of the underlying + // mechanics suggest that a header unit is module-like; they end up having + // BMIs (which stand for "binary module interface"), etc. In a sense, a + // header unit is an "interface unit" for (a part of) the global module + // (maybe a partition). // enum class unit_type { diff --git a/build2/cxx/init.cxx b/build2/cxx/init.cxx index 3fb636f..a04a30a 100644 --- a/build2/cxx/init.cxx +++ b/build2/cxx/init.cxx @@ -394,16 +394,16 @@ namespace build2 v.insert ("config.cxx.loptions", true), v.insert ("config.cxx.libs", true), - // List of modular headers. Inclusion of such headers is translated to - // the corresponding header unit imports. + // List of importable headers. Inclusion of such headers is translated + // to the corresponding header unit imports. // // A header can be specified either as an absolute and normalized path // or as a <>-style include name. The latter kind is automatically // translated to the absolute form based on the include search paths // extracted from the compiler. Note also that all entries must be - // specified before loading the module. + // specified before loading the cxx module. // - &v.insert ("config.cxx.header_units", true), + &v.insert ("config.cxx.importable_headers", true), v.insert ("cxx.path"), v.insert ("cxx.sys_lib_dirs"), @@ -413,7 +413,7 @@ namespace build2 v.insert ("cxx.coptions"), v.insert ("cxx.loptions"), v.insert ("cxx.libs"), - &v.insert ("cxx.header_units"), + &v.insert ("cxx.importable_headers"), v["cc.poptions"], v["cc.coptions"], -- cgit v1.1