[llvm] [llvm] Add serialization to uint32_t for FixedPointSemantics (PR #110288)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 14:10:15 PDT 2024


================
@@ -29,6 +29,18 @@ void FixedPointSemantics::print(llvm::raw_ostream &OS) const {
   OS << "IsSaturated=" << IsSaturated;
 }
 
+uint32_t FixedPointSemantics::toOpaqueInt() const {
+  uint32_t Result;
+  std::memcpy(&Result, this, sizeof(uint32_t));
----------------
Ralender wrote:

nit: `return bit_cast<uint32_t>(*this);`

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


More information about the llvm-commits mailing list