Add serde support for exposed types. (#40)
This adds derived `Serialize` and `Deserialize` implementations for exposed types that describe registers, operands, and related program inputs; entity indices; and regalloc output types. This allows serialization of any of the embedder's IR data types that may embed or build upon regalloc2 types. These implementations (and the dependency on the `serde` crate itself) are enabled only when the non-default `enable-serde` feature is specified.
This commit is contained in:
@@ -584,6 +584,7 @@ impl PosWithPrio {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
#[cfg_attr(feature = "enable-serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct Stats {
|
||||
pub livein_blocks: usize,
|
||||
pub livein_iterations: usize,
|
||||
|
||||
Reference in New Issue
Block a user