[PATCH] D50876: Clean up newly created <bit> header

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 16 16:49:44 PDT 2018


mclow.lists created this revision.
mclow.lists added reviewers: ldionne, EricWF.

Still NFC here.

1. Take the 9 functions that each had an `#ifndef _LIBCPP_COMPILER_MSVC` .. `#else` .. `endif` block in them and make just two blocks, each with 9 functions. Much easier to read, but makes for a terrible diff.

2. Change the return type of `__ctz` and `__clz` from the same type as the parameter to `int`.  I would have preferred `unsigned`, but that's not what P0553 gave us. I reviewed all the call sites for these functions, and for `__ctz` it was always immediately static_cast-ed to another type, and `__clz` it made no difference either.

3. Change the name `__pop_count` to `__popcount` to match the name that we're going to add from P0553.

4. Rename the local variable in the windows code from `where` to `__where`. Shame on someone ;-)


https://reviews.llvm.org/D50876

Files:
  include/__bit_reference
  include/bit

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50876.161143.patch
Type: text/x-patch
Size: 8784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180816/43cf4643/attachment.bin>


More information about the cfe-commits mailing list