aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-22 16:08:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-22 16:16:32 +0200
commit708b092956f10b5c05641f90d55b209e887d52de (patch)
tree418b2ba2b214fc6af857d75301e5301d4fe0322b /build2
parent4f5b6cb7ed4e05e98cce7e692462f49e24b7a39a (diff)
Run phase
Diffstat (limited to 'build2')
-rw-r--r--build2/bin/target.cxx14
-rw-r--r--build2/cc/compile-rule.cxx6
-rw-r--r--build2/cc/link-rule.cxx2
-rw-r--r--build2/cc/utility.cxx2
4 files changed, 12 insertions, 12 deletions
diff --git a/build2/bin/target.cxx b/build2/bin/target.cxx
index 2ef3d87..6ea0988 100644
--- a/build2/bin/target.cxx
+++ b/build2/bin/target.cxx
@@ -264,13 +264,13 @@ namespace build2
{
// Casts are MT-aware (during serial load).
//
- E* e (phase == run_phase::load
+ E* e (ctx.phase == run_phase::load
? const_cast<E*> (ctx.targets.find<E> (dir, out, n))
: nullptr);
- A* a (phase == run_phase::load
+ A* a (ctx.phase == run_phase::load
? const_cast<A*> (ctx.targets.find<A> (dir, out, n))
: nullptr);
- S* s (phase == run_phase::load
+ S* s (ctx.phase == run_phase::load
? const_cast<S*> (ctx.targets.find<S> (dir, out, n))
: nullptr);
@@ -328,10 +328,10 @@ namespace build2
libul_factory (context& ctx,
const target_type&, dir_path dir, dir_path out, string n)
{
- libua* a (phase == run_phase::load
+ libua* a (ctx.phase == run_phase::load
? const_cast<libua*> (ctx.targets.find<libua> (dir, out, n))
: nullptr);
- libus* s (phase == run_phase::load
+ libus* s (ctx.phase == run_phase::load
? const_cast<libus*> (ctx.targets.find<libus> (dir, out, n))
: nullptr);
@@ -411,10 +411,10 @@ namespace build2
{
// Casts are MT-aware (during serial load).
//
- liba* a (phase == run_phase::load
+ liba* a (ctx.phase == run_phase::load
? const_cast<liba*> (ctx.targets.find<liba> (dir, out, n))
: nullptr);
- libs* s (phase == run_phase::load
+ libs* s (ctx.phase == run_phase::load
? const_cast<libs*> (ctx.targets.find<libs> (dir, out, n))
: nullptr);
diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx
index 9dede21..f600f76 100644
--- a/build2/cc/compile-rule.cxx
+++ b/build2/cc/compile-rule.cxx
@@ -559,7 +559,7 @@ namespace build2
// @@ MT perf: so we are going to switch the phase and execute for
// any generated header.
//
- phase_switch ps (run_phase::execute);
+ phase_switch ps (t.ctx, run_phase::execute);
target_state ns (execute_direct (a, t));
if (ns != os && ns != target_state::unchanged)
@@ -698,7 +698,7 @@ namespace build2
// Start asynchronous matching of prerequisites. Wait with unlocked
// phase to allow phase switching.
//
- wait_guard wg (target::count_busy (), t[a].task_count, true);
+ wait_guard wg (t.ctx, target::count_busy (), t[a].task_count, true);
size_t start (pts.size ()); // Index of the first to be added.
for (prerequisite_member p: group_prerequisite_members (a, t))
@@ -5113,7 +5113,7 @@ namespace build2
{
// Switch the phase to load then create and load the subproject.
//
- phase_switch phs (run_phase::load);
+ phase_switch phs (rs.ctx, run_phase::load);
// Re-test again now that we are in exclusive phase (another thread
// could have already created and loaded the subproject).
diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx
index 09109c2..57772a9 100644
--- a/build2/cc/link-rule.cxx
+++ b/build2/cc/link-rule.cxx
@@ -1198,7 +1198,7 @@ namespace build2
// Wait with unlocked phase to allow phase switching.
//
- wait_guard wg (target::count_busy (), t[a].task_count, true);
+ wait_guard wg (t.ctx, target::count_busy (), t[a].task_count, true);
i = start;
for (prerequisite_member p: group_prerequisite_members (a, t))
diff --git a/build2/cc/utility.cxx b/build2/cc/utility.cxx
index ff807c9..e9d4ce3 100644
--- a/build2/cc/utility.cxx
+++ b/build2/cc/utility.cxx
@@ -70,7 +70,7 @@ namespace build2
// Called by the compile rule during execute.
//
- return phase == run_phase::match && !exist
+ return x.ctx.phase == run_phase::match && !exist
? &search (x, tt, x.dir, x.out, x.name)
: search_existing (x.ctx, tt, x.dir, x.out, x.name);
}