From 3a4d255681a623b60e5219b1de3a48ac5274cbef Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 23 Aug 2019 15:41:11 +0200 Subject: meta/operation_table --- libbuild2/context.cxx | 1 - libbuild2/context.hxx | 9 ++++++--- libbuild2/install/operation.cxx | 2 ++ libbuild2/operation.cxx | 10 +++------- libbuild2/operation.hxx | 11 ++++++----- libbuild2/test/operation.cxx | 2 ++ 6 files changed, 19 insertions(+), 16 deletions(-) (limited to 'libbuild2') diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx index f4d8a39..23cef44 100644 --- a/libbuild2/context.cxx +++ b/libbuild2/context.cxx @@ -11,7 +11,6 @@ #include #include #include -#include #include #include // uncaught_exceptions diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx index 31930a1..1d20acb 100644 --- a/libbuild2/context.hxx +++ b/libbuild2/context.hxx @@ -13,6 +13,7 @@ // likely a non-starter. // #include +#include #include #include @@ -32,9 +33,6 @@ namespace build2 class value; using values = small_vector; - struct meta_operation_info; - struct operation_info; - struct opspec; class LIBBUILD2_SYMEXPORT run_phase_mutex @@ -363,6 +361,11 @@ namespace build2 // const variable* var_build_meta_operation; + // Known meta-operation and operation tables. + // + build2::meta_operation_table meta_operation_table; + build2::operation_table operation_table; + // The old/new src_root remapping for subprojects. // dir_path old_src_root; diff --git a/libbuild2/install/operation.cxx b/libbuild2/install/operation.cxx index 1135ad6..a2ad7d0 100644 --- a/libbuild2/install/operation.cxx +++ b/libbuild2/install/operation.cxx @@ -4,6 +4,8 @@ #include +#include + using namespace std; using namespace butl; diff --git a/libbuild2/operation.cxx b/libbuild2/operation.cxx index c07d359..0bf87d5 100644 --- a/libbuild2/operation.cxx +++ b/libbuild2/operation.cxx @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -546,8 +547,8 @@ namespace build2 << "out_root: " << cast (rs[ctx.var_out_root]) << endl << "amalgamation: " << cast_empty (rs[ctx.var_amalgamation]) << endl << "subprojects: " << cast_empty (rs[ctx.var_subprojects]) << endl - << "operations:"; print_ops (rs.root_extra->operations, operation_table); cout << endl - << "meta-operations:"; print_ops (rs.root_extra->meta_operations, meta_operation_table); cout << endl; + << "operations:"; print_ops (rs.root_extra->operations, ctx.operation_table); cout << endl + << "meta-operations:"; print_ops (rs.root_extra->meta_operations, ctx.meta_operation_table); cout << endl; } } @@ -623,9 +624,4 @@ namespace build2 nullptr, nullptr }; - - // Tables. - // - string_table meta_operation_table; - string_table operation_table; } diff --git a/libbuild2/operation.hxx b/libbuild2/operation.hxx index 0d56219..520b37b 100644 --- a/libbuild2/operation.hxx +++ b/libbuild2/operation.hxx @@ -11,7 +11,6 @@ #include #include -#include #include #include @@ -26,6 +25,9 @@ namespace build2 class include_type; struct prerequisite_member; + class value; + using values = small_vector; + struct opspec; // Meta-operation info. @@ -296,11 +298,10 @@ namespace build2 return os << d.name; } - LIBBUILD2_SYMEXPORT extern butl::string_table - meta_operation_table; + using meta_operation_table = butl::string_table; - LIBBUILD2_SYMEXPORT extern butl::string_table operation_table; + using operation_table = butl::string_table; // These are "sparse" in the sense that we may have "holes" that // are represented as NULL pointers. Also, lookup out of bounds diff --git a/libbuild2/test/operation.cxx b/libbuild2/test/operation.cxx index 3ff7702..0ca8da0 100644 --- a/libbuild2/test/operation.cxx +++ b/libbuild2/test/operation.cxx @@ -4,6 +4,8 @@ #include +#include + using namespace std; using namespace butl; -- cgit v1.1