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 /libbuild2/cc | |
parent | 04bfd3bf7a71197bdf5f697e323c70e98b857571 (diff) |
Rename importable_headers variable to translatable_headers
This name aligns better with the post-Cologne importable/translatable
semantics.
Diffstat (limited to 'libbuild2/cc')
-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 |
3 files changed, 24 insertions, 25 deletions
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; } } |