[clang] [Clang] Add a builtin for efficient type deduplication (PR #139730)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Tue May 13 06:54:49 PDT 2025


ilya-biryukov wrote:

This is a simple initial version of a builtin in #106730 that does **not** introduce new kind of packs that can be produced by builtins rather than variadic template parameters and instead relies on features already available in C++.

This makes the implementation much simpler and it would allow us to rip the compile-time benefits while #106730 cooks. After it's done, the builting provided here can be either removed or replaced with a version wrapping the more efficient one, i.e. the equivalent of:

```cpp
template <class <class...> class Templ, class ...Ts>
using __builtin_dedup_types = Templ<__builtin_dedup_pack<Ts...>...>;
```

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


More information about the cfe-commits mailing list