aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-02-07 10:00:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-07 14:05:39 +0200
commit378b2598a305d4e332e52460ca89dd867546a58b (patch)
tree7541771843232bc6d51880d58a57e25737b7ba13 /build2/algorithm.ixx
parentf10be65c39c18668df31c8680569a6417ef3ae06 (diff)
Initial work for default update outer operation
While update still uses the old "all update rules update all their prerequisites" assumption, test and install have been fixed not to rely on this.
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r--build2/algorithm.ixx58
1 files changed, 49 insertions, 9 deletions
diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx
index 7cad7ff..f0330f6 100644
--- a/build2/algorithm.ixx
+++ b/build2/algorithm.ixx
@@ -349,14 +349,14 @@ namespace build2
// In a sense this is like any other dependency.
//
assert (a.outer ());
- return match (action (a.meta_operation (), a.operation ()), t);
+ return match (a.inner_action (), t);
}
inline bool
match_inner (action a, const target& t, unmatch um)
{
assert (a.outer ());
- return match (action (a.meta_operation (), a.operation ()), t, um);
+ return match (a.inner_action (), t, um);
}
group_view
@@ -368,7 +368,7 @@ namespace build2
group_view r;
if (a.outer ())
- a = action (a.meta_operation (), a.operation ());
+ a = a.inner_action ();
// We can be called during execute though everything should have been
// already resolved.
@@ -480,21 +480,28 @@ namespace build2
execute_inner (action a, const target& t)
{
assert (a.outer ());
- return execute_wait (action (a.meta_operation (), a.operation ()), t);
+ return execute_wait (a.inner_action (), t);
}
inline target_state
- straight_execute_prerequisites (action a, const target& t, size_t c)
+ straight_execute_prerequisites (action a, const target& t,
+ size_t c, size_t s)
{
auto& p (t.prerequisite_targets[a]);
- return straight_execute_members (a, t, p.data (), c == 0 ? p.size () : c);
+ return straight_execute_members (a, t,
+ p.data (),
+ c == 0 ? p.size () - s: c,
+ s);
}
inline target_state
reverse_execute_prerequisites (action a, const target& t, size_t c)
{
auto& p (t.prerequisite_targets[a]);
- return reverse_execute_members (a, t, p.data (), c == 0 ? p.size () : c);
+ return reverse_execute_members (a, t,
+ p.data (),
+ c == 0 ? p.size () : c,
+ p.size ());
}
inline target_state
@@ -505,6 +512,39 @@ namespace build2
: reverse_execute_prerequisites (a, t, c);
}
+ inline target_state
+ straight_execute_prerequisites_inner (action a, const target& t,
+ size_t c, size_t s)
+ {
+ assert (a.outer ());
+ auto& p (t.prerequisite_targets[a]);
+ return straight_execute_members (a.inner_action (),
+ t[a].task_count,
+ p.data (),
+ c == 0 ? p.size () - s : c,
+ s);
+ }
+
+ inline target_state
+ reverse_execute_prerequisites_inner (action a, const target& t, size_t c)
+ {
+ assert (a.outer ());
+ auto& p (t.prerequisite_targets[a]);
+ return reverse_execute_members (a.inner_action (),
+ t[a].task_count,
+ p.data (),
+ c == 0 ? p.size () : c,
+ p.size ());
+ }
+
+ inline target_state
+ execute_prerequisites_inner (action a, const target& t, size_t c)
+ {
+ return current_mode == execution_mode::first
+ ? straight_execute_prerequisites_inner (a, t, c)
+ : reverse_execute_prerequisites_inner (a, t, c);
+ }
+
// If the first argument is NULL, then the result is treated as a boolean
// value.
//
@@ -559,7 +599,7 @@ namespace build2
execute_members (action a, const target& t, const target* ts[], size_t n)
{
return current_mode == execution_mode::first
- ? straight_execute_members (a, t, ts, n)
- : reverse_execute_members (a, t, ts, n);
+ ? straight_execute_members (a, t, ts, n, 0)
+ : reverse_execute_members (a, t, ts, n, n);
}
}