From cbcb0b03501ce346ca3778624dcf908e851e6e2e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 Mar 2020 09:27:22 +0200 Subject: Tweak lookup_config() semantics some more --- libbuild2/scope.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'libbuild2/scope.cxx') 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 scope:: - lookup_override (const variable& var, - pair original, - bool target, - bool rule) const + auto scope:: + lookup_override_info (const variable& var, + const pair 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:: -- cgit v1.1