[libc++][Take 2] Create a small DSL for defining Lit features and parameters
authorLouis Dionne <ldionne@apple.com>
Tue, 28 Apr 2020 13:30:24 +0000 (09:30 -0400)
committerLouis Dionne <ldionne@apple.com>
Tue, 28 Apr 2020 14:02:40 +0000 (10:02 -0400)
commite82f0a598f86f952910fd80ad3b3d712479cb90a
tree6c2990cc54a2eb7894a2661eec19d05a84576b10
parentf66c87637a524e237b34479bc8134c9d8ff243c2
[libc++][Take 2] Create a small DSL for defining Lit features and parameters

This allows defining Lit features that can be enabled or disabled based
on compiler support, and parameters that are passed on the command line.

The main benefits are:
- Feature detection is entirely based on the substitutions provided in
  the TestingConfig object, which is simpler and decouples it from the
  complicated compiler emulation infrastructure.
- The syntax is declarative, which makes it easy to see what features
  and parameters are accepted by the test suite. This is significantly
  less entangled than the current config.py logic.
- Since feature detection is based on substitutions, it works really
  well on top of the new format, and custom Lit configurations can be
  created easily without being based on `config.py`.

This commit is a reapplication of 6d58030c8c7d, which was reverted in
8f24c4b72f3e because it broke Python 3 support. This re-application
supports Python 3.

Differential Revision: https://reviews.llvm.org/D78381
libcxx/test/libcxx/selftest/dsl/dsl.sh.py [new file with mode: 0644]
libcxx/test/libcxx/selftest/dsl/lit.local.cfg [new file with mode: 0644]
libcxx/utils/libcxx/test/dsl.py [new file with mode: 0644]