[libcxx-commits] [libcxx] Replace uses of `__libcpp_ctz` by `__countr_zero` (PR #132639)

Peng Liu via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 24 11:37:56 PDT 2025


winner245 wrote:

>> Hi @mordante, thank you for the update on the current status of removing Clang 18 support, which is currently blocked by some CI runners. I understand that the changes in this patch will need to be put on hold until Clang 18 support is officially dropped (@PaulXiCao).
>
>Looking at the status of the CI this works in Clang-18; the ARM runners are still on Clang-18. 

The primary goal of #131179 (based on my discussion with @ldionne in https://github.com/llvm/llvm-project/pull/122641#discussion_r1972052176 ) was to eliminate all usages of `__libcpp_ctz` in favor of the built-in implementation available since Clang 19. Ultimately, this allows us to remove functions like `__libcpp_ctz`, but only when we officially drop support for Clang 18. 

That being said, the current patch doesn't fully address issue #131179. Most of the changes are applied to frozen header files, which I believe should stay unchanged unless there is a strong reason. That's why I didn't make these changes in my earlier patch.

https://github.com/llvm/llvm-project/pull/132639


More information about the libcxx-commits mailing list