aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-03-10 10:17:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-03-10 10:17:48 +0200
commita05ddaa95a8f7f65fe01e2c1613a354876e69839 (patch)
tree19d5b080c0ea87277b2768fba949945687230df9 /libbuild2/algorithm.hxx
parent7534c67799ba839593edd0ffa6339c86ce38e18f (diff)
Add reverse_execute_prerequisites() variant
Diffstat (limited to 'libbuild2/algorithm.hxx')
-rw-r--r--libbuild2/algorithm.hxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/libbuild2/algorithm.hxx b/libbuild2/algorithm.hxx
index b472603..00d4fdd 100644
--- a/libbuild2/algorithm.hxx
+++ b/libbuild2/algorithm.hxx
@@ -678,8 +678,8 @@ namespace build2
// case if they are up to something tricky (like recursively linking liba{}
// prerequisites).
//
- // Note that because we use mtime, this function should normally only be
- // used in the perform_update action (which is straight).
+ // Note that because we use mtime, this function can only be used for the
+ // perform_update action.
//
using execute_filter = function<bool (const target&, size_t pos)>;
@@ -689,6 +689,18 @@ namespace build2
const execute_filter& = nullptr,
size_t count = 0);
+ // As above, but execute prerequisites in reverse.
+ //
+ // Sometime it may be advantageous to execute prerequisites in reverse, for
+ // example, to have more immediate incremental compilation or more accurate
+ // progress. See cc::link_rule for background.
+ //
+ optional<target_state>
+ reverse_execute_prerequisites (action, const target&,
+ const timestamp&,
+ const execute_filter& = nullptr,
+ size_t count = 0);
+
// Another version of the above that does two extra things for the caller:
// it determines whether the action needs to be executed on the target based
// on the passed timestamp and finds a prerequisite of the specified type