Go to file
Thomas Preud'homme fe7ac170a7 [FileCheck] Don't diagnose undef vars at parse time
Summary:
Diagnosing use of undefined variables takes place in
parseNumericVariableUse() and printSubstitutions() for numeric variables
but only takes place in printSubstitutions() for string variables. The
reason for the split location of diagnostics is that parsing is not
aware of the clearing of variables due to --enable-var-scope and thus
use of variables cleared in this way can only be catched by
printSubstitutions().

Beyond the code level inconsistency, there is also a user facing
inconsistency since diagnostics look different between the two
functions. While the diagnostic in printSubstitutions is more verbose,
doing the diagnostic there allows to diagnose all undefined variables
rather than just the first one and error out.

This patch create dummy variable definition when encountering a use of
undefined variable so that parsing can proceed and be diagnosed by
printSubstitutions() later. Tests that were testing whether parsing
fails in such case are thus modified accordingly.

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

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

Tags: #llvm

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

llvm-svn: 365219
2019-07-05 16:25:33 +00:00
clang Add a comment explaining why a function exists 2019-07-05 15:12:31 +00:00
clang-tools-extra [clangd] Added highlighting for variable references (declrefs) 2019-07-05 13:06:03 +00:00
compiler-rt [scudo][standalone] Link tests against libatomic 2019-07-03 16:32:01 +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 docs: add documentation for `LIBCXX_INCLUDE_TESTS` 2019-07-04 19:08:16 +00:00
libcxxabi [demangle] Support for C++2a char8_t 2019-06-28 19:54:19 +00:00
libunwind [libunwind][AArch64] Fix libunwind::Registers_arm64::jumpto 2019-06-17 11:00:21 +00:00
lld lld, llvm-dlltool, llvm-lib: Use getAsString() instead of getSpelling() for printing unknown args 2019-07-05 12:31:32 +00:00
lldb Add assert for 'bad' code path in GetUniqueNamespaceDeclaration 2019-07-04 19:49:31 +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] Don't diagnose undef vars at parse time 2019-07-05 16:25:33 +00:00
openmp Create a runtime option to disable task throttling. 2019-07-02 15:10:20 +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 [test] Add wrap flags after D61934. 2019-06-17 19:17:07 +00:00
pstl [pstl] Add missing includes 2019-07-05 16:05:26 +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.