aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-16 08:57:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-17 07:47:17 +0200
commit962f83b1e551cc683f1052d32cb79b969e65af5f (patch)
tree8e3d1936db8be9b07baffac289bb3b4e06010cf8 /libbuild2/target.cxx
parent9f71deeeb0f8e6fe2c29f209fc96f466fc2831b6 (diff)
Rename all find*(variable) to lookup*(variable)
Now we consistently use term "lookup" for variable value lookup. At some point we should also rename type lookup to binding and get rid of all the lookup_type aliases.
Diffstat (limited to 'libbuild2/target.cxx')
-rw-r--r--libbuild2/target.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/libbuild2/target.cxx b/libbuild2/target.cxx
index 45d0eb2..b49071a 100644
--- a/libbuild2/target.cxx
+++ b/libbuild2/target.cxx
@@ -130,15 +130,15 @@ namespace build2
}
pair<lookup, size_t> target::
- find_original (const variable& var, bool target_only) const
+ lookup_original (const variable& var, bool target_only) const
{
- pair<lookup, size_t> r (lookup (), 0);
+ pair<lookup_type, size_t> r (lookup_type (), 0);
++r.second;
{
- auto p (vars.find (var));
+ auto p (vars.lookup (var));
if (p.first != nullptr)
- r.first = lookup (*p.first, p.second, vars);
+ r.first = lookup_type (*p.first, p.second, vars);
}
const target* g (nullptr);
@@ -154,9 +154,9 @@ namespace build2
? nullptr
: group->adhoc_group () ? group->group : group))
{
- auto p (g->vars.find (var));
+ auto p (g->vars.lookup (var));
if (p.first != nullptr)
- r.first = lookup (*p.first, p.second, g->vars);
+ r.first = lookup_type (*p.first, p.second, g->vars);
}
}
@@ -166,7 +166,7 @@ namespace build2
{
if (!target_only)
{
- auto p (base_scope ().find_original (
+ auto p (base_scope ().lookup_original (
var,
&type (),
&name,
@@ -191,7 +191,7 @@ namespace build2
// Note that here we want the original value without any overrides
// applied.
//
- lookup l (find_original (var).first);
+ auto l (lookup_original (var).first);
if (l.defined () && l.belongs (*this)) // Existing var in this target.
return vars.modify (l); // Ok since this is original.
@@ -205,22 +205,22 @@ namespace build2
}
pair<lookup, size_t> target::opstate::
- find_original (const variable& var, bool target_only) const
+ lookup_original (const variable& var, bool target_only) const
{
- pair<lookup, size_t> r (lookup (), 0);
+ pair<lookup_type, size_t> r (lookup_type (), 0);
++r.second;
{
- auto p (vars.find (var));
+ auto p (vars.lookup (var));
if (p.first != nullptr)
- r.first = lookup (*p.first, p.second, vars);
+ r.first = lookup_type (*p.first, p.second, vars);
}
// Delegate to target's find_original().
//
if (!r.first)
{
- auto p (target_->find_original (var, target_only));
+ auto p (target_->lookup_original (var, target_only));
r.first = move (p.first);
r.second = r.first ? r.second + p.second : p.second;