From 9699e205dc55a9e2de18f56aabad8feb46613b1f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Feb 2022 07:20:32 +0200 Subject: Make match_inc_dependents() part of public API --- libbuild2/algorithm.cxx | 2 +- libbuild2/algorithm.hxx | 5 +++++ libbuild2/algorithm.ixx | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx index 0c8ac6f..b0e8eb0 100644 --- a/libbuild2/algorithm.cxx +++ b/libbuild2/algorithm.cxx @@ -761,7 +761,7 @@ namespace build2 { if (r.second != target_state::failed) { - match_inc_dependens (a, g); + match_inc_dependents (a, g); match_recipe (l, group_recipe); } } diff --git a/libbuild2/algorithm.hxx b/libbuild2/algorithm.hxx index da64b1a..c767f5a 100644 --- a/libbuild2/algorithm.hxx +++ b/libbuild2/algorithm.hxx @@ -395,6 +395,11 @@ namespace build2 recipe match_delegate (action, target&, const rule&, bool try_match = false); + // Incrementing the dependency counts of the specified target. + // + void + match_inc_dependents (action, const target&); + // Match a rule for the inner operation from withing the outer rule's // apply() function. See also the companion execute_inner(). // diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx index 264a162..bdf0815 100644 --- a/libbuild2/algorithm.ixx +++ b/libbuild2/algorithm.ixx @@ -375,7 +375,7 @@ namespace build2 match (action, const target&, size_t, atomic_count*, bool try_match = false); inline void - match_inc_dependens (action a, const target& t) + match_inc_dependents (action a, const target& t) { t.ctx.dependency_count.fetch_add (1, memory_order_relaxed); t[a].dependents.fetch_add (1, memory_order_release); @@ -389,7 +389,7 @@ namespace build2 target_state r (match (a, t, 0, nullptr).second); if (r != target_state::failed) - match_inc_dependens (a, t); + match_inc_dependents (a, t); else if (fail) throw failed (); @@ -407,7 +407,7 @@ namespace build2 if (r.first) { if (r.second != target_state::failed) - match_inc_dependens (a, t); + match_inc_dependents (a, t); else if (fail) throw failed (); } @@ -454,7 +454,7 @@ namespace build2 } } - match_inc_dependens (a, t); + match_inc_dependents (a, t); return make_pair (false, s);; } -- cgit v1.1