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

Samuel Benzaquen sbenza at google.com
Thu Apr 17 14:30:29 PDT 2014



================
Comment at: clang-query/Query.h:34
@@ -34,1 +33,3 @@
+  QK_SetOutputKind,
+  QK_Let,
 };
----------------
Peter Collingbourne wrote:
> Sorry, missed this one -- alphabetical order, please.
Done.

================
Comment at: clang-query/QueryParser.cpp:71
@@ -70,3 +70,3 @@
       Switch.Case(S, Value);
     else if (N != 1 && IsCompletion && WordCompletionPos <= CaseStr.size() &&
              CaseStr.substr(0, WordCompletionPos) ==
----------------
Peter Collingbourne wrote:
> You could factor this code out into a completeWord function.
How would it help with this change?

================
Comment at: clang-query/QueryParser.cpp:264
@@ -216,1 +263,3 @@
 
+  case PQK_Unlet: {
+    StringRef Name = lexWord();
----------------
Peter Collingbourne wrote:
> It would be nice to support completion for value names here.
Yes.
When I added the named values in dynamic::Parser I added a TODO for completion.
The Sema should provide completion for named values, which will allow for completion here and when building matchers.
My next change will add that to dynamic::Parser.

================
Comment at: clang-query/QueryParser.cpp:270
@@ +269,3 @@
+
+    return new LetQuery(Name, {});
+  }
----------------
Peter Collingbourne wrote:
> Can you please use 'endQuery' here so that extra input causes an error?
Done.


http://reviews.llvm.org/D3383






More information about the cfe-commits mailing list