From 9920e41e1372229c52f74151af5f1570f32a489c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Apr 2022 09:33:13 +0200 Subject: Cache "recipe is group_action" information, clear recipes after execution --- libbuild2/target.ixx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'libbuild2/target.ixx') diff --git a/libbuild2/target.ixx b/libbuild2/target.ixx index 79cc07c..bdfa20f 100644 --- a/libbuild2/target.ixx +++ b/libbuild2/target.ixx @@ -268,16 +268,19 @@ namespace build2 // raw state is not group provided the recipe is group_recipe and the // state is unknown (see mtime() for a discussion on why we do it). // + // Note that additionally s.state may not be target_state::group even + // after execution due to deferment (see execute_impl() for details). + // + // @@ Hm, I wonder why not just return s.recipe_group_action now that we + // cache it. + // const opstate& s (state[a]); if (s.state == target_state::group) return true; if (s.state == target_state::unknown && group != nullptr) - { - if (recipe_function* const* f = s.recipe.target ()) - return *f == &group_action; - } + return s.recipe_group_action; return false; } -- cgit v1.1