Timm =?utf-8?q?Bäder?= <[email protected]>,
Timm =?utf-8?q?Bäder?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
================
@@ -154,6 +154,18 @@ template <unsigned Bits, bool Signed> class Integral final
{
return Compare(V, RHS.V);
}
+ void bitcastToMemory(std::byte *Dest) const {
+ std::memcpy(Dest, &V, sizeof(V));
+ }
+
+ static Integral bitcastFromMemory(const std::byte *Src, unsigned BitWidth) {
+ assert(BitWidth == sizeof(ReprT) * 8);
+ ReprT V;
+
+ std::memcpy(&V, Src, sizeof(ReprT));
----------------
AaronBallman wrote:
Can we add an assert somewhere that `ReprT` will always be trivially copyable?
https://github.com/llvm/llvm-project/pull/112126
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits