aboutsummaryrefslogtreecommitdiff
path: root/build2/cli
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-10-17 15:43:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:25 +0200
commitfc27ec48c9d63879e4b0f049060e943233cb540d (patch)
tree28e062c8674ad194268100bf48475aecaca4c056 /build2/cli
parent8b564b5b8f6d597a9fb76734e759f78c4b1c91da (diff)
Cleanup match_result mess
Diffstat (limited to 'build2/cli')
-rw-r--r--build2/cli/rule4
-rw-r--r--build2/cli/rule.cxx14
2 files changed, 9 insertions, 9 deletions
diff --git a/build2/cli/rule b/build2/cli/rule
index 4f8ebc2..41ff8bf 100644
--- a/build2/cli/rule
+++ b/build2/cli/rule
@@ -18,10 +18,10 @@ namespace build2
{
public:
virtual match_result
- match (action, target&, const string& hint) const;
+ match (action, target&, const string& hint) const override;
virtual recipe
- apply (action, target&, const match_result&) const;
+ apply (action, target&) const override;
static target_state
perform_update (action, target&);
diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx
index cec8a60..bcc3a9f 100644
--- a/build2/cli/rule.cxx
+++ b/build2/cli/rule.cxx
@@ -56,7 +56,7 @@ namespace build2
// See if we have a .cli source file.
//
- match_result r;
+ bool r (false);
for (prerequisite_member p: group_prerequisite_members (a, t))
{
if (p.is_a<cli> ())
@@ -67,10 +67,10 @@ namespace build2
{
l4 ([&]{trace << ".cli file stem '" << p.name () << "' "
<< "doesn't match target " << t;});
- return r;
+ return false;
}
- r = p;
+ r = true;
break;
}
}
@@ -113,7 +113,7 @@ namespace build2
// it is some other group, then we are definitely not a match.
//
if (t.group != nullptr)
- return t.group->is_a<cli_cxx> ();
+ return t.group->is_a<cli_cxx> () != nullptr;
// Check if there is a corresponding cli.cxx{} group.
//
@@ -164,12 +164,12 @@ namespace build2
}
assert (t.group == g);
- return g;
+ return g != nullptr;
}
}
recipe compile::
- apply (action a, target& xt, const match_result& mr) const
+ apply (action a, target& xt) const
{
if (cli_cxx* pt = xt.is_a<cli_cxx> ())
{
@@ -199,7 +199,7 @@ namespace build2
}
else
{
- cli_cxx& g (*static_cast<cli_cxx*> (mr.target));
+ cli_cxx& g (*static_cast<cli_cxx*> (xt.group));
build2::match (a, g);
return group_recipe; // Execute the group's recipe.
}