[PATCH] Add new 'let' command to bind arbitrary values into constants.

Peter Collingbourne peter at pcc.me.uk
Wed Apr 16 18:44:49 PDT 2014



================
Comment at: clang-query/tool/ClangQuery.cpp:129
@@ -121,3 +128,3 @@
     LineEditor LE("clang-query");
-    LE.setListCompleter(QueryParser::complete);
+    LE.setListCompleter(complete);
     while (llvm::Optional<std::string> Line = LE.readLine()) {
----------------
You could pass in a lambda here instead.

================
Comment at: clang-query/QueryParser.cpp:143
@@ -141,1 +142,3 @@
+  PQK_Set,
+  PQK_Let,
 };
----------------
Can you keep these in alphabetical order, please?

================
Comment at: clang-query/QueryParser.cpp:192
@@ -156,2 +191,3 @@
                               .Case("set", PQK_Set)
+                              .Case("let", PQK_Let)
                               .Default(PQK_Invalid);
----------------
Ditto.

================
Comment at: clang-query/Query.cpp:131
@@ +130,3 @@
+  } else {
+    QS.NamedValues.erase(Name);
+  }
----------------
Is this path reachable? If not, we should either remove it or come up with a command syntax for erasing named values.


http://reviews.llvm.org/D3383






More information about the cfe-commits mailing list