[llvm] 1ab69d7 - [CMake] Suppress -Wpass-failed warning (#160472)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 8 01:34:14 PDT 2025
Author: Nikita Popov
Date: 2025-10-08T10:34:10+02:00
New Revision: 1ab69d7004fe8b404c1f83d306838442f549e1ee
URL: https://github.com/llvm/llvm-project/commit/1ab69d7004fe8b404c1f83d306838442f549e1ee
DIFF: https://github.com/llvm/llvm-project/commit/1ab69d7004fe8b404c1f83d306838442f549e1ee.diff
LOG: [CMake] Suppress -Wpass-failed warning (#160472)
libstdc++15 makes use of an unroll pragma inside std::find_if(). This
produces a warning if clang fails to unroll the loop. As this pragma is
outside of our control, suppress the warning. Missed transforms are not
something we care about in this context.
Related to https://github.com/llvm/llvm-project/issues/157666.
Added:
Modified:
llvm/cmake/modules/HandleLLVMOptions.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index d4195db6368d7..c84e2ccab8094 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -962,6 +962,13 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
# Enable -Wctad-maybe-unsupported to catch unintended use of CTAD.
add_flag_if_supported("-Wctad-maybe-unsupported" CTAD_MAYBE_UNSPPORTED_FLAG)
+
+ # Disable -Wno-pass-failed flag, which reports failure to perform
+ # optimizations suggested by pragmas. This warning is not relevant for LLVM
+ # projects and may be injected by pragmas in libstdc++.
+ # FIXME: Reconsider this choice if warnings from STL headers can be reliably
+ # avoided (https://github.com/llvm/llvm-project/issues/157666).
+ add_flag_if_supported("-Wno-pass-failed" NO_PASS_FAILED_FLAG)
endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)
More information about the llvm-commits
mailing list