[libcxx-commits] [PATCH] D118616: [libc++] Use -I instead of -isystem to include headers in the test suite

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 31 09:33:41 PST 2022


ldionne added a comment.

This is the alternative patch I tried, and it didn't work as one would expect:

  commit 09058c0c732ea895def9f3e08b08672b2d5f1bc9
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   Mon Jan 31 11:14:07 2022 -0500
  
      [libc++] Don't treat libc++ headers as system headers in the test suite
      
      This makes it possible to fish out warnings from our headers inside the
      test suite without having to use `-I` instead of `-isystem` to include
      those headers. This patch should pretty much negate the need for
      _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER, which was only used to enable
      these warnings in the test suite and when building the library.
      
      Differential Revision: https://reviews.llvm.org/D118616
  
  diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
  index 429e2d82c97b..2c5837075f4a 100644
  --- a/libcxx/utils/libcxx/test/features.py
  +++ b/libcxx/utils/libcxx/test/features.py
  @@ -42,6 +42,8 @@ DEFAULT_FEATURES = [
                                                                    sys.platform.lower().strip() == 'darwin'), # TODO: this doesn't handle cross-compiling to Apple platforms.
     Feature(name='objective-c++',                 when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc')),
     Feature(name='verify-support',                when=lambda cfg: hasCompileFlag(cfg, '-Xclang -verify-ignore-unexpected')),
  +  Feature(name='warnings-in-system-headers',    when=lambda cfg: hasCompileFlag(cfg, '--no-system-header-prefix=%{include}'),
  +                                                actions=[AddCompileFlag('--no-system-header-prefix=%{include}')]),
   
     Feature(name='non-lockfree-atomics',
             when=lambda cfg: sourceBuilds(cfg, """
  @@ -89,8 +91,7 @@ DEFAULT_FEATURES = [
     Feature(name=lambda cfg: 'apple-clang-{__clang_major__}.{__clang_minor__}'.format(**compilerMacros(cfg)),                        when=_isAppleClang),
     Feature(name=lambda cfg: 'apple-clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}'.format(**compilerMacros(cfg)), when=_isAppleClang),
   
  -  Feature(name='clang',                                                                                                            when=_isClang,
  -          actions=[AddCompileFlag('-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER')]),
  +  Feature(name='clang',                                                                                                            when=_isClang),
     Feature(name=lambda cfg: 'clang-{__clang_major__}'.format(**compilerMacros(cfg)),                                                when=_isClang),
     Feature(name=lambda cfg: 'clang-{__clang_major__}.{__clang_minor__}'.format(**compilerMacros(cfg)),                              when=_isClang),
     Feature(name=lambda cfg: 'clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}'.format(**compilerMacros(cfg)),       when=_isClang),


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118616/new/

https://reviews.llvm.org/D118616



More information about the libcxx-commits mailing list