From 449f183b9eb4da6ceb97fdb5fda1c767760315c2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Nov 2020 09:05:55 +0200 Subject: Add support for module partitions --- libbuild2/cc/types.hxx | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'libbuild2/cc/types.hxx') diff --git a/libbuild2/cc/types.hxx b/libbuild2/cc/types.hxx index 0a6b6cc..20b67c2 100644 --- a/libbuild2/cc/types.hxx +++ b/libbuild2/cc/types.hxx @@ -36,20 +36,35 @@ namespace build2 // header unit is an "interface unit" for (a part of) the global module // (maybe a partition). // + // Note also that implementation paritions produce BMIs and are, in a + // sense, module-private interfaces. + // enum class unit_type { non_modular, - module_iface, + module_intf, module_impl, + module_intf_part, + module_impl_part, + module_header + }; + + // Note that an interface partition can be imported both as an interface + // (with export) and as implementation (without export). + // + enum class import_type + { + module_intf, + module_part, module_header }; struct module_import { - unit_type type; // Either module_iface or module_header. - string name; - bool exported; // True if re-exported (export import M;). - size_t score; // Match score (see compile::search_modules()). + import_type type; + string name; + bool exported; // True if re-exported (export import M;). + size_t score; // Match score (see compile::search_modules()). }; using module_imports = vector; -- cgit v1.1