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

Samuel Benzaquen sbenza at google.com
Thu Apr 17 07:47:38 PDT 2014



================
Comment at: clang-query/QueryParser.cpp:143
@@ -141,1 +142,3 @@
+  PQK_Set,
+  PQK_Let,
 };
----------------
Peter Collingbourne wrote:
> Can you keep these in alphabetical order, please?
Done.
I assumed it wasn't ordered because NoOp is before Help.

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

================
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()) {
----------------
Peter Collingbourne wrote:
> You could pass in a lambda here instead.
My bad. I assumed it needed a function pointer.
Fixed.

================
Comment at: clang-query/Query.cpp:131
@@ +130,3 @@
+  } else {
+    QS.NamedValues.erase(Name);
+  }
----------------
Peter Collingbourne wrote:
> Is this path reachable? If not, we should either remove it or come up with a command syntax for erasing named values.
It was not reachable.
Added the 'unlet' command and updated all the tests for it.


http://reviews.llvm.org/D3383






More information about the cfe-commits mailing list