aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java
diff options
context:
space:
mode:
authorGravatar Nathan Harmata <nharmata@google.com>2016-03-02 01:16:14 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-03-02 17:54:51 +0000
commited93560c70d2a43463fb6364152e8a40b67ca7ec (patch)
tree7b42b4985eecc8646279bf91eb4b648d40f9dcfa /src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java
parent985ed7072fe3d94a78895a61760313be02df79d8 (diff)
In SkyQueryEnvironment, rewrite queries using the semantics-preserving transformation 'rdeps(<sky_query_environment_universe_scope>, T, depth)' -> 'allrdeps(T, depth)'.
SkyQueryEnvironment can evaluate such allrdeps queries much more efficiently since it doesn't need to bother filtering out targets outside of universe, meaning it doesn't need to have all targets in the universe in memory at the same time. -- MOS_MIGRATED_REVID=116075008
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java b/src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java
index 46d4b94b17..434c56fce6 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java
@@ -68,6 +68,9 @@ final class QueryParser {
}
private QueryParser(List<Lexer.Token> tokens, QueryEnvironment<?> env) {
+ // TODO(bazel-team): We only need QueryEnvironment#getFunctions, consider refactoring users of
+ // QueryParser#parse to instead just pass in the set of functions to make testing, among other
+ // things, simpler.
this.functions = new HashMap<>();
for (QueryFunction queryFunction : env.getFunctions()) {
this.functions.put(queryFunction.getName(), queryFunction);