aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-18 09:33:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-19 04:12:34 +0200
commit9920e41e1372229c52f74151af5f1570f32a489c (patch)
tree318f1524a46b753530c2dfa27680a12c9e12920a /libbuild2/target.ixx
parent912ac87012ffc2fd0c6fb21823a0244c787ce5ba (diff)
Cache "recipe is group_action" information, clear recipes after execution
Diffstat (limited to 'libbuild2/target.ixx')
-rw-r--r--libbuild2/target.ixx11
1 files changed, 7 insertions, 4 deletions
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<recipe_function*> ())
- return *f == &group_action;
- }
+ return s.recipe_group_action;
return false;
}