aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-15 10:03:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-15 10:03:36 +0200
commit65fadc6003259719161be650d2ede16c30e0bb3b (patch)
treeb47730c4ec8988829a0255da2aca759a697b0aa5 /libbuild2/target.ixx
parentaa29434a2feebc8925307372c27a5f56021620fc (diff)
Get rid of target::dynamic_type() virtual function
Instead of overriding this function, derived targets must now set the dynamic_type variable to their static_type in their constructor body.
Diffstat (limited to 'libbuild2/target.ixx')
-rw-r--r--libbuild2/target.ixx15
1 files changed, 5 insertions, 10 deletions
diff --git a/libbuild2/target.ixx b/libbuild2/target.ixx
index ecc16c4..79cc07c 100644
--- a/libbuild2/target.ixx
+++ b/libbuild2/target.ixx
@@ -99,7 +99,7 @@ namespace build2
{
using flag = target_type::flag;
- const target_type* tt (nullptr); // Resolve lazily.
+ const target_type& tt (type ());
// First check the target itself.
//
@@ -108,10 +108,9 @@ namespace build2
// If this is a group that "gave" its untyped hints to the members, then
// ignore untyped entries.
//
- tt = &type ();
- bool ut ((tt->flags & flag::member_hint) != flag::member_hint);
+ bool ut ((tt.flags & flag::member_hint) != flag::member_hint);
- const string& r (rule_hints.find (*tt, o, ut));
+ const string& r (rule_hints.find (tt, o, ut));
if (!r.empty ())
return r;
}
@@ -125,13 +124,9 @@ namespace build2
// If the group "gave" its untyped hints to the members, then don't
// ignore untyped entries.
//
- const target_type& gt (g->type ());
- bool ut ((gt.flags & flag::member_hint) == flag::member_hint);
+ bool ut ((g->type ().flags & flag::member_hint) == flag::member_hint);
- if (tt == nullptr)
- tt = &type ();
-
- return g->rule_hints.find (*tt, o, ut);
+ return g->rule_hints.find (tt, o, ut);
}
}