aboutsummaryrefslogtreecommitdiff
path: root/eval.h
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2017-11-21 13:22:26 -0800
committerDan Willemsen <dwillemsen@google.com>2017-11-21 15:15:55 -0800
commitff90ea321443ef949e993aa554a4836054cefbf5 (patch)
tree94deaf03d34b53927dd39c7b578a49b0beeebf8a /eval.h
parenteaab22d4d5f73bb5a8bd120e9cde3283c4ab61f8 (diff)
downloadkati-ff90ea321443ef949e993aa554a4836054cefbf5.tar.gz
Fix list of used environment variables
With the introduction of deprecated / obsolete variable support, we started calling LookupVarInLocalScope on the variable we were setting with = or :=. This was fine, except it also marked those variables as used environment variables (whether they were set in the environment or not). So changing one of these environment variables would cause kati to regenerate the ninja file even though nothing would change. To fix this, add new Peek* functions that don't record the variables as used, but can still be used to check to see if the variable has been deprecated or is obsolete.
Diffstat (limited to 'eval.h')
-rw-r--r--eval.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.h b/eval.h
index 2b62892..1dff4b7 100644
--- a/eval.h
+++ b/eval.h
@@ -105,6 +105,9 @@ class Evaluator {
Var* LookupVarGlobal(Symbol name);
+ // Equivalent to LookupVarInCurrentScope, but doesn't mark as used.
+ Var* PeekVarInCurrentScope(Symbol name);
+
unordered_map<Symbol, Vars*> rule_vars_;
vector<const Rule*> rules_;
unordered_map<Symbol, bool> exports_;