[PATCH] D22403: FileCheck Enhancement - pattern templates.

Elena Lepilkina via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 01:28:41 PDT 2016


eklepilkina marked 9 inline comments as done.

================
Comment at: docs/CommandGuide/FileCheck.rst:529
@@ +528,3 @@
+
+    // CHECK :  INC  \#( reg_hex_num)\:(regName)\=(reg)
+
----------------
aprantl wrote:
> vsk wrote:
> > vsk wrote:
> > > Is the extra space in `\#( reg_hex_num)` necessary? I don't want to be too picky / focused on minutiae, but I think this could legitimately be a point of confusion.
> > Have you considered changing the syntax for parameter substitution? IMO `\:(regName)\=(reg)` has two problems: (1) it uses two separate syntactic constructs to do one thing, and (2) it overloads `\:`, making its meaning context-dependent. I suggest something like this: `\=(regName:reg)`.
> I don't understand this example. Is it really equivalent to the next example as claimed in the text, or does it have side-effects? If so, what are the side-effects?
Ok. I'll change syntax when there is one decision, because there are more suggestions about changing it. 

================
Comment at: utils/FileCheck/FileCheck.cpp:203
@@ +202,3 @@
+  /// Template parameters.
+  std::map<size_t, StringRef> Parameters;
+
----------------
vsk wrote:
> Use `llvm/ADT/IndexedMap.h`.
"The index map template takes two types. The first is the mapped type and the second is a functor that maps its argument to a size_t.".
I need to remember variable position in string. As I uderstood functor should have constructor without parameters, but if I write functor it should have field with position. I can't define position using only parameter name.


https://reviews.llvm.org/D22403





More information about the llvm-commits mailing list