[PATCH] D22403: FileCheck Enhancement - pattern templates.

Elena Lepilkina via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 06:03:50 PDT 2016


eklepilkina marked 5 inline comments as done.

================
Comment at: docs/CommandGuide/FileCheck.rst:529
@@ +528,3 @@
+
+    // CHECK :  INC  \#( reg_hex_num)\:(regName)\=(reg)
+
----------------
eklepilkina wrote:
> 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. 
There was extra space. Without it, test is equivalen.

================
Comment at: test/FileCheck/check-pattern-prefixes.txt:3
@@ +2,3 @@
+// RUN: FileCheck -input-file %s %s -check-prefix=BAR
+
+// FOO-PATTERN thing: foo-thing
----------------
vsk wrote:
> Check for conflicting parameter definitions:
> 
> `// RUN: not FileCheck -input-file %s %s -check-prefixes=FOO,BAR`
Why should it fail? There will be warning that template with same name exists. And pattern will be assosiated with foo-thing.

================
Comment at: utils/FileCheck/FileCheck.cpp:315
@@ +314,3 @@
+  static TemplatesCollection &Instance() {
+    static TemplatesCollection singleton;
+    return singleton;
----------------
vsk wrote:
> Can you find a way to instantiate a TemplatesCollection earlier, and to then pass it by reference into methods/classes which need it? I don't think a singleton approach is much better than having a global.
If I do so a lot of functions will get one more parameter although many functions will only pass this parameter further. Most of these functions get quite big number of parameters now. 


https://reviews.llvm.org/D22403





More information about the llvm-commits mailing list