aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/scope.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-19 09:27:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-19 09:27:22 +0200
commitcbcb0b03501ce346ca3778624dcf908e851e6e2e (patch)
treeec7cf219ea6772ed5ea03de35eefd5e781d7906a /libbuild2/scope.cxx
parent14b34a239fa23e1a28519ab87f450c0a440d4f85 (diff)
Tweak lookup_config() semantics some more
Diffstat (limited to 'libbuild2/scope.cxx')
-rw-r--r--libbuild2/scope.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/libbuild2/scope.cxx b/libbuild2/scope.cxx
index 51704fb..d18c4eb 100644
--- a/libbuild2/scope.cxx
+++ b/libbuild2/scope.cxx
@@ -175,11 +175,11 @@ namespace build2
return make_pair (lookup_type (), size_t (~0));
}
- pair<lookup, size_t> scope::
- lookup_override (const variable& var,
- pair<lookup_type, size_t> original,
- bool target,
- bool rule) const
+ auto scope::
+ lookup_override_info (const variable& var,
+ const pair<lookup_type, size_t> original,
+ bool target,
+ bool rule) const -> override_info
{
assert (!rule || target); // Rule-specific is target-specific.
@@ -346,7 +346,7 @@ namespace build2
}
if (!apply)
- return original;
+ return override_info {original, orig.defined ()};
assert (inner_vars != nullptr);
@@ -567,7 +567,9 @@ namespace build2
// Use the location of the innermost value that contributed as the
// location of the result.
//
- return make_pair (lookup_type (&cv, &var, vars), depth);
+ return override_info {
+ make_pair (lookup_type (&cv, &var, vars), depth),
+ orig.defined () && stem == orig};
}
value& scope::