From: Pavel Labath Date: Wed, 6 Mar 2019 14:09:02 +0000 (+0000) Subject: Expose template parameters of endian specific types as class members X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c00c9f3c84398fb6c98432b99075aa25cf796a0c;p=llvm Expose template parameters of endian specific types as class members Summary: This allows generic code to query these parameters, and is a common practice in a lot of other template classes. Reviewers: zturner, Bigcheese Subscribers: kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58969 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355504 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/Endian.h b/include/llvm/Support/Endian.h index a0632bbc4b5..5c1e89ae793 100644 --- a/include/llvm/Support/Endian.h +++ b/include/llvm/Support/Endian.h @@ -203,10 +203,14 @@ inline void writeAtBitAlignment(void *memory, value_type value, namespace detail { -template +template struct packed_endian_specific_integral { + using value_type = ValueType; + static constexpr endianness endian = Endian; + static constexpr std::size_t alignment = Alignment; + packed_endian_specific_integral() = default; explicit packed_endian_specific_integral(value_type val) { *this = val; }