================ @@ -91,6 +91,31 @@ class FixedPoint final { return ComparisonCategoryResult::Greater; } + size_t bytesToSerialize() const { + return sizeof(uint32_t) + (V.getValue().getBitWidth() / CHAR_BIT); + } + + void serialize(std::byte *Buff) const { + // Semantics followed by APInt. + uint32_t SemI = V.getSemantics().toOpaqueInt(); + std::memcpy(Buff, &SemI, sizeof(SemI)); + + llvm::APInt API = V.getValue(); + llvm::StoreIntToMemory(API, (uint8_t *)(Buff + sizeof(SemI)), ---------------- Endilll wrote:
We should avoid new C-style casts per https://llvm.org/docs/CodingStandards.html#prefer-c-style-casts https://github.com/llvm/llvm-project/pull/123599 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits