[PATCH] D32988: [libc++] Refactor Windows support headers.

David Majnemer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 9 16:49:49 PDT 2017

majnemer added inline comments.

Comment at: include/support/win32/msvc_builtin_support.h:33
+_LIBCPP_ALWAYS_INLINE int __builtin_popcount(unsigned int x)
compnerd wrote:
> I think I prefer the following implementation:
>     _LIBCPP_ALWAYS_INLINE int __builtin_popcount(unsigned int value) {
>       return __popcnt(value);
>     }
I think it'd be better not to call it `__builtin_anything`. MSVC uses the __builtin_ namespace too, see https://godbolt.org/g/HwMskX

Maybe create a wrapper called `__libcpp_popcount`?


More information about the cfe-commits mailing list