FileCheck [4/12]: Introduce @LINE numeric expressions
authorThomas Preud'homme <thomasp@graphcore.ai>
Thu, 2 May 2019 00:04:38 +0000 (00:04 +0000)
committerThomas Preud'homme <thomasp@graphcore.ai>
Thu, 2 May 2019 00:04:38 +0000 (00:04 +0000)
commit288ed91e99d80413f8d1bcab12d75dc9360715f3
treedb65c351241b2794f70196305cefbef3fd756438
parent2efd30571bcc53003376410d4221f7e4dd19f4c3
FileCheck [4/12]: Introduce @LINE numeric expressions

Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch introduces the @LINE numeric
expressions.

This commit introduces a new syntax to express a relation a numeric
value in the input text must have with the line number of a given CHECK
pattern: [[#<@LINE numeric expression>]]. Further commits build on that
to express relations between several numeric values in the input text.
To help with naming, regular variables are renamed into pattern
variables and old @LINE expression syntax is referred to as legacy
numeric expression.

Compared to existing @LINE expressions, this new syntax allow arbitrary
spacing between the component of the expression. It offers otherwise the
same functionality but the commit serves to introduce some of the data
structure needed to support more general numeric expressions.

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60384

llvm-svn: 359741
llvm/docs/CommandGuide/FileCheck.rst
llvm/include/llvm/Support/FileCheck.h
llvm/lib/Support/FileCheck.cpp
llvm/test/FileCheck/line-count.txt
llvm/unittests/Support/FileCheckTest.cpp