Implement serde and equality traits for SecondaryMap

This commit is contained in:
Artur Jamro
2019-08-22 10:11:41 -07:00
committed by Dan Gohman
parent e736367b8c
commit d3815a0399
5 changed files with 112 additions and 17 deletions

View File

@@ -33,7 +33,7 @@ pub type CodeOffset = u32;
pub type Addend = i64;
/// Relocation kinds for every ISA
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub enum Reloc {
/// absolute 4-byte

View File

@@ -101,7 +101,7 @@ impl fmt::Display for StackSlotKind {
}
/// Contents of a stack slot.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub struct StackSlotData {
/// The kind of stack slot.
@@ -154,7 +154,7 @@ impl fmt::Display for StackSlotData {
/// Stack frame manager.
///
/// Keep track of all the stack slots used by a function.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub struct StackSlots {
/// All allocated stack slots.

View File

@@ -12,7 +12,7 @@ use std::vec::Vec;
use serde::{Deserialize, Serialize};
/// Value location range.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub struct ValueLocRange {
/// The ValueLoc containing a ValueLabel during this range.