Path: blob/main/cranelift/codegen/src/value_label.rs
1693 views
use crate::HashMap;1use crate::ir::ValueLabel;2use crate::machinst::Reg;3use alloc::vec::Vec;45#[cfg(feature = "enable-serde")]6use serde_derive::{Deserialize, Serialize};78/// Value location range.9#[derive(Debug, Clone, Copy, PartialEq, Eq)]10#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]11pub struct ValueLocRange {12/// The ValueLoc containing a ValueLabel during this range.13pub loc: LabelValueLoc,14/// The start of the range. It is an offset in the generated code.15pub start: u32,16/// The end of the range. It is an offset in the generated code.17pub end: u32,18}1920/// The particular location for a value.21#[derive(Debug, Clone, Copy, PartialEq, Eq)]22#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]23pub enum LabelValueLoc {24/// Register.25Reg(Reg),26/// Offset from the Canonical Frame Address (aka CFA).27CFAOffset(i64),28}2930/// Resulting map of Value labels and their ranges/locations.31pub type ValueLabelsRanges = HashMap<ValueLabel, Vec<ValueLocRange>>;323334