[all-commits] [llvm/llvm-project] f2d957: [libc++] Allow specifying conditional compile flag...

Louis Dionne via All-commits all-commits at lists.llvm.org
Thu Aug 25 14:34:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f2d957f03634c4e90c9847b92f197dff6e5aa315
      https://github.com/llvm/llvm-project/commit/f2d957f03634c4e90c9847b92f197dff6e5aa315
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2022-08-25 (Thu, 25 Aug 2022)

  Changed paths:
    A libcxx/test/libcxx/selftest/additional_compile_flags/conditional-compile-flags.sh.cpp
    A libcxx/test/libcxx/selftest/additional_compile_flags/lit.local.cfg
    M libcxx/utils/libcxx/test/format.py

  Log Message:
  -----------
  [libc++] Allow specifying conditional compile flags dependent on basic Lit features

This patch adds support for passing basic Lit features to the
ADDITIONAL_COMPILE_FLAGS keyword by enclosing them in parentheses.
This is done to support https://llvm.org/D131836.

In the future, we should instead add proper support for conditional
keywords in Lit, so that we can evaluate arbitrary Lit boolean
expressions such as `ADDITIONAL_COMPILE_FLAGS(x && !y): -flag`.

Note that I can see this being exceptionally useful when combined
with RUN commands, which would allow using different commands on
different systems. For example:

     RUN(!buildhost=windows): something
     RUN(buildhost=windows): something-else

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




More information about the All-commits mailing list