[all-commits] [llvm/llvm-project] 93c011: [OpenMP] Fix detecting warning options for GCC

Martin Storsjö via All-commits all-commits at lists.llvm.org
Wed Dec 14 04:20:37 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 93c011eebbbb03ea5b7aa18b02870595d079fc8a
      https://github.com/llvm/llvm-project/commit/93c011eebbbb03ea5b7aa18b02870595d079fc8a
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M openmp/cmake/HandleOpenMPOptions.cmake
    M openmp/cmake/config-ix.cmake
    M openmp/runtime/cmake/LibompHandleFlags.cmake
    M openmp/runtime/cmake/config-ix.cmake

  Log Message:
  -----------
  [OpenMP] Fix detecting warning options for GCC

If testing for a warning option like -Wno-<foo> with GCC, GCC won't
print any diagnostic at all, leading to the options being accepted
incorrectly. However later, if compiling a file that actually prints
another warning, GCC will also print warnings about these -Wno-<foo>
options being unrecognized.

This avoids warning spam like this, for every OpenMP source file that
produces build warnings with GCC:

    cc1plus: warning: unrecognized command line option ‘-Wno-int-to-void-pointer-cast’
    cc1plus: warning: unrecognized command line option ‘-Wno-return-type-c-linkage’
    cc1plus: warning: unrecognized command line option ‘-Wno-covered-switch-default’
    cc1plus: warning: unrecognized command line option ‘-Wno-enum-constexpr-conversion’

This matches how such warning options are detected and added in
llvm/cmake/modules/HandleLLVMOptions.cmake, e.g. like this:

    check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG)
    append_if(CXX_SUPPORTS_CLASS_MEMACCESS_FLAG "-Wno-class-memaccess" CMAKE_CXX_FLAGS)

This also matches how LLDB warning options were restructured for
GCC compatibility in e546bbfda0ab91cf78c096d8c035851cc7c3b9f3.

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


  Commit: 15151315f76b0840423bd3bd62c5f9fc647d31c6
      https://github.com/llvm/llvm-project/commit/15151315f76b0840423bd3bd62c5f9fc647d31c6
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M openmp/runtime/src/dllexports

  Log Message:
  -----------
  [OpenMP] Add a missing dllexport for the new function __kmpc_fork_call_if

This new function was added in b72f1ec9fbb14cd7d2f5112d2c52ef5cdd1aa94a,
but wasn't exported from the DLL on Windows.

This fixes the parallel/omp_parallel_if.c OpenMP testcase on
Windows.


Compare: https://github.com/llvm/llvm-project/compare/10d34f5538e0...15151315f76b


More information about the All-commits mailing list