diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-09-18 15:57:52 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-09-18 15:57:52 +0200 |
commit | 8c30c59de2d304a416dfd4fcb821e0b227e5db96 (patch) | |
tree | f249eabbe955b38c5516e68f7577bbb4b5dbc705 | |
parent | 04bfd3bf7a71197bdf5f697e323c70e98b857571 (diff) |
Rename importable_headers variable to translatable_headers
This name aligns better with the post-Cologne importable/translatable
semantics.
-rw-r--r-- | libbuild2/c/init.cxx | 4 | ||||
-rw-r--r-- | libbuild2/cc/common.hxx | 9 | ||||
-rw-r--r-- | libbuild2/cc/compile-rule.cxx | 24 | ||||
-rw-r--r-- | libbuild2/cc/module.cxx | 16 | ||||
-rw-r--r-- | libbuild2/cxx/init.cxx | 14 | ||||
-rw-r--r-- | tests/cc/modules/headers.testscript | 8 |
6 files changed, 37 insertions, 38 deletions
diff --git a/libbuild2/c/init.cxx b/libbuild2/c/init.cxx index 43d647f..337df09 100644 --- a/libbuild2/c/init.cxx +++ b/libbuild2/c/init.cxx @@ -169,7 +169,7 @@ namespace build2 v.insert<strings> ("config.c.loptions", true), v.insert<strings> ("config.c.aoptions", true), v.insert<strings> ("config.c.libs", true), - nullptr /* config.c.importable_headers */, + nullptr /* config.c.translatable_headers */, v.insert<process_path> ("c.path"), v.insert<dir_paths> ("c.sys_lib_dirs"), @@ -183,7 +183,7 @@ namespace build2 v.insert<strings> ("c.aoptions"), v.insert<strings> ("c.libs"), - nullptr /* c.importable_headers */, + nullptr /* c.translatable_headers */, v["cc.poptions"], v["cc.coptions"], diff --git a/libbuild2/cc/common.hxx b/libbuild2/cc/common.hxx index 31219a3..d32d945 100644 --- a/libbuild2/cc/common.hxx +++ b/libbuild2/cc/common.hxx @@ -53,7 +53,7 @@ namespace build2 const variable& config_x_loptions; const variable& config_x_aoptions; const variable& config_x_libs; - const variable* config_x_importable_headers; + const variable* config_x_translatable_headers; const variable& x_path; // Compiler process path. const variable& x_sys_lib_dirs; // System library search directories. @@ -65,7 +65,7 @@ namespace build2 const variable& x_loptions; const variable& x_aoptions; const variable& x_libs; - const variable* x_importable_headers; + const variable* x_translatable_headers; const variable& c_poptions; // cc.* const variable& c_coptions; @@ -147,7 +147,8 @@ namespace build2 bool modules; // x.features.modules bool symexport; // x.features.symexport - const strings* import_hdr; // x.importable_headers (NULL if unused/empty). + const strings* xlate_hdr; // x.translatable_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 @@ -217,7 +218,7 @@ namespace build2 tstd (std), modules (fm), symexport (fs), - import_hdr (nullptr), + xlate_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/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx index 450fbe9..d6adfd3 100644 --- a/libbuild2/cc/compile-rule.cxx +++ b/libbuild2/cc/compile-rule.cxx @@ -876,8 +876,8 @@ namespace build2 if (ut == unit_type::module_iface) cs.append (&md.symexport, sizeof (md.symexport)); - if (import_hdr != nullptr) - hash_options (cs, *import_hdr); + if (xlate_hdr != nullptr) + hash_options (cs, *xlate_hdr); if (md.pp != preprocessed::all) { @@ -2027,19 +2027,17 @@ namespace build2 // Reduce include translation to the import case. // - if (!imp && import_hdr != nullptr) + if (!imp && xlate_hdr != nullptr) { - const strings& ih (*import_hdr); - - auto i (lower_bound (ih.begin (), - ih.end (), - hp, - [] (const string& x, const string& y) - { - return path::traits_type::compare (x, y) < 0; - })); + auto i (lower_bound ( + xlate_hdr->begin (), xlate_hdr->end (), + hp, + [] (const string& x, const string& y) + { + return path::traits_type::compare (x, y) < 0; + })); - imp = (i != ih.end () && *i == hp); + imp = (i != xlate_hdr->end () && *i == hp); } if (imp) diff --git a/libbuild2/cc/module.cxx b/libbuild2/cc/module.cxx index 3113b5c..64ae874 100644 --- a/libbuild2/cc/module.cxx +++ b/libbuild2/cc/module.cxx @@ -527,20 +527,20 @@ namespace build2 rs.assign (x_libs) += cast_null<strings> ( config::optional (rs, config_x_libs)); - // config.x.importable_header + // config.x.translatable_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_importable_headers != nullptr) + if (x_translatable_headers != nullptr) { - lookup l (config::omitted (rs, *config_x_importable_headers).first); + lookup l (config::omitted (rs, *config_x_translatable_headers).first); // @@ MODHDR: if(modules) ? // - rs.assign (x_importable_headers) += cast_null<strings> (l); + rs.assign (x_translatable_headers) += cast_null<strings> (l); } // Load cc.core.config. @@ -567,14 +567,14 @@ namespace build2 if (!cast_false<bool> (rs["cc.core.loaded"])) load_module (rs, rs, "cc.core", loc); - // Process, sort, and cache (in this->import_hdr) importable headers. + // Process, sort, and cache (in this->xlate_hdr) translatable headers. // Keep the cache NULL if unused or empty. // // @@ MODHDR TODO: support exclusions entries (e.g., -<stdio.h>)? // - if (modules && x_importable_headers != nullptr) + if (modules && x_translatable_headers != nullptr) { - strings* ih (cast_null<strings> (rs.assign (x_importable_headers))); + strings* ih (cast_null<strings> (rs.assign (x_translatable_headers))); if (ih != nullptr && !ih->empty ()) { @@ -631,7 +631,7 @@ namespace build2 } sort (ih->begin (), ih->end ()); - import_hdr = ih; + xlate_hdr = ih; } } diff --git a/libbuild2/cxx/init.cxx b/libbuild2/cxx/init.cxx index 5619397..6a449c7 100644 --- a/libbuild2/cxx/init.cxx +++ b/libbuild2/cxx/init.cxx @@ -400,16 +400,16 @@ namespace build2 v.insert<strings> ("config.cxx.aoptions", true), v.insert<strings> ("config.cxx.libs", true), - // List of importable headers. Inclusion of such headers is translated - // to the corresponding header unit imports. + // List of translatable headers. Inclusions of such headers are + // 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 compiler's system - // header search paths (as opposed to -I). Note also that all entries - // must be specified before loading the cxx module. + // translated to the absolute form based on the compiler's system (as + // opposed to -I) header search paths. Note also that all entries must + // be specified before loading the cxx module. // - &v.insert<strings> ("config.cxx.importable_headers", true), + &v.insert<strings> ("config.cxx.translatable_headers", true), v.insert<process_path> ("cxx.path"), v.insert<dir_paths> ("cxx.sys_lib_dirs"), @@ -423,7 +423,7 @@ namespace build2 v.insert<strings> ("cxx.aoptions"), v.insert<strings> ("cxx.libs"), - &v.insert<strings> ("cxx.importable_headers"), + &v.insert<strings> ("cxx.translatable_headers"), v["cc.poptions"], v["cc.coptions"], diff --git a/tests/cc/modules/headers.testscript b/tests/cc/modules/headers.testscript index 8eeb81a..835c599 100644 --- a/tests/cc/modules/headers.testscript +++ b/tests/cc/modules/headers.testscript @@ -70,7 +70,7 @@ cat <<EOI >=driver-inc.cxx; #endif int main () {return f () - CORE_OUT;} EOI -$* test clean config.cxx.importable_headers="$~/core.hxx" <<EOI +$* test clean config.cxx.translatable_headers="$~/core.hxx" <<EOI ./: exe{test-imp}: cxx{driver-imp} hxx{core} ./: exe{test-inc}: cxx{driver-inc} hxx{core} EOI @@ -105,7 +105,7 @@ $* test clean config.cxx.importable_headers="$~/core.hxx" <<EOI int main () {return g ();} EOI $* test clean config.cxx.poptions=-DBASE_INCLUDE \ - config.cxx.importable_headers="$~/core.hxx" <<EOI + config.cxx.translatable_headers="$~/core.hxx" <<EOI exe{test}: cxx{driver} hxx{core} mxx{base} EOI #\ @@ -133,7 +133,7 @@ cat <<EOI >=driver-inc.cxx; #include <generated/core.hxx> int main () {return f ();} EOI -$* test clean config.cxx.importable_headers="$~/core.hxx" <<EOI +$* test clean config.cxx.translatable_headers="$~/core.hxx" <<EOI ./: exe{test-imp}: cxx{driver-imp} hxx{core} ./: exe{test-inc}: cxx{driver-inc} hxx{core} hxx{core}: in{core} @@ -159,7 +159,7 @@ cat <<EOI >=driver-inc.cxx; # out = ../../headers-remapped-out; $* 'test:' ./@$out/remapped/ \ - config.cxx.importable_headers=$out/remapped/core.hxx <<EOI; + config.cxx.translatable_headers=$out/remapped/core.hxx <<EOI; ./: exe{test-imp}: cxx{driver-imp} hxx{core} ./: exe{test-inc}: cxx{driver-inc} hxx{core} hxx{core}: in{core} |