Go to file
Thomas Preud'homme 4cd9b853b5 FileCheck [8/12]: Define numeric var from expr
Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch lift the restriction for a
numeric expression to either be a variable definition or a numeric
expression to try to match.

This commit allows a numeric variable to be set to the result of the
evaluation of a numeric expression after it has been matched
successfully. When it happens, the variable is allowed to be used on
the same line since its value is known at match time.

It also makes use of this possibility to reuse the parsing code to
parse a command-line definition by crafting a mirror string of the
-D option with the equal sign replaced by a colon sign, e.g. for option
'-D#NUMVAL=10' it creates the string
'-D#NUMVAL=10 (parsed as [[#NUMVAL:10]])' where the numeric expression
is parsed to define NUMVAL. This result in a few tests needing updating
for the location diagnostics on top of the tests for the new feature.

It also enables empty numeric expression which match any number without
defining a variable. This is done here rather than in commit #5 of the
patch series because it requires to dissociate automatic regex insertion
in RegExStr from variable definition which would make commit #5 even
bigger than it already is.

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/D60388

> llvm-svn: 366860

llvm-svn: 366897
2019-07-24 12:38:22 +00:00
clang [CrossTU] Add a function to retrieve original source location. 2019-07-24 10:16:37 +00:00
clang-tools-extra [clangd] SelectionTree treats TranslationUnitDecl (mostly) consistently with other containers. 2019-07-24 12:14:56 +00:00
compiler-rt [libFuzzer] Fix __sanitizer_print_memory_profile return type in ExtFunctions.def 2019-07-23 18:26:53 +00:00
debuginfo-tests Make nrvo-string test more robust. 2019-06-27 20:38:37 +00:00
libclc travis: Add LLVM-8 build 2019-03-27 21:28:31 +00:00
libcxx [RISCV] Implement benchmark::cycleclock::Now 2019-07-24 05:33:46 +00:00
libcxxabi [runtimes] Don't depend on libpthread on Android 2019-07-22 20:41:03 +00:00
libunwind [runtimes] Don't depend on libpthread on Android 2019-07-22 20:41:03 +00:00
lld [mips] Assign R_TLS type to the R_MIPS_TLS_TPREL_XXX relocations. NFC 2019-07-24 11:37:13 +00:00
lldb [lldb] Fix build errors from tablegenify platform commit 2019-07-24 12:08:08 +00:00
llgo IR: Support parsing numeric block ids, and emit them in textual output. 2019-03-22 18:27:13 +00:00
llvm FileCheck [8/12]: Define numeric var from expr 2019-07-24 12:38:22 +00:00
openmp [libomptarget] Handle offload policy in push_tripcount 2019-07-23 14:20:48 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly [Polly] Clang complains about missing virtual destructor 2019-07-22 15:34:27 +00:00
pstl Revert "[libc++] Integrate the PSTL into libc++" 2019-07-19 18:52:46 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
.gitignore Add a reduced copy of the llvm .gitignore 2019-04-09 00:52:49 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.