Skip to content
Commit 42a9c181 authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

[ADT] Add llvm::popcount to <bit> helper wrapper

This patch proposes to move the llvm::detail::PopulationCounter internal helpers into ADT/bit.h and provide a llvm::popcount implementation.

I've left the countPopulation implementation in place in MathExtras.h for now, but updated it to use llvm::popcount.

Hopefully I've got the type_traits correct - I don't use them very often.

Someday we'll move to C++20 with an actual <bit> std header, and we already have this header in place to simplify matters. We'd probably benefit from moving the other <bit> helpers here at some point, but this is a first step.

Differential Revision: https://reviews.llvm.org/D132407
parent d1fd791e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment