Path: blob/main/cranelift/codegen/src/ir/mod.rs
1693 views
//! Representation of Cranelift IR functions.12mod atomic_rmw_op;3mod builder;4pub mod condcodes;5pub mod constant;6pub mod dfg;7pub mod dynamic_type;8pub mod entities;9mod exception_table;10mod extfunc;11mod extname;12pub mod function;13mod globalvalue;14pub mod immediates;15pub mod instructions;16pub mod jumptable;17pub(crate) mod known_symbol;18pub mod layout;19pub(crate) mod libcall;20mod memflags;21mod memtype;22pub mod pcc;23mod progpoint;24mod sourceloc;25pub mod stackslot;26mod trapcode;27pub mod types;28mod user_stack_maps;2930#[cfg(feature = "enable-serde")]31use serde_derive::{Deserialize, Serialize};3233pub use crate::ir::atomic_rmw_op::AtomicRmwOp;34pub use crate::ir::builder::{35InsertBuilder, InstBuilder, InstBuilderBase, InstInserterBase, ReplaceBuilder,36};37pub use crate::ir::constant::{ConstantData, ConstantPool};38pub use crate::ir::dfg::{BlockData, DataFlowGraph, ValueDef};39pub use crate::ir::dynamic_type::{DynamicTypeData, DynamicTypes, dynamic_to_fixed};40pub use crate::ir::entities::{41Block, Constant, DynamicStackSlot, DynamicType, ExceptionTable, ExceptionTag, FuncRef,42GlobalValue, Immediate, Inst, JumpTable, MemoryType, SigRef, StackSlot, UserExternalNameRef,43Value,44};45pub use crate::ir::exception_table::{ExceptionTableData, ExceptionTableItem};46pub use crate::ir::extfunc::{47AbiParam, ArgumentExtension, ArgumentPurpose, ExtFuncData, Signature,48};49pub use crate::ir::extname::{ExternalName, UserExternalName, UserFuncName};50pub use crate::ir::function::Function;51pub use crate::ir::globalvalue::GlobalValueData;52pub use crate::ir::instructions::{53BlockArg, BlockCall, InstructionData, Opcode, ValueList, ValueListPool, VariableArgs,54};55pub use crate::ir::jumptable::JumpTableData;56pub use crate::ir::known_symbol::KnownSymbol;57pub use crate::ir::layout::Layout;58pub use crate::ir::libcall::{LibCall, get_probestack_funcref};59pub use crate::ir::memflags::{AliasRegion, Endianness, MemFlags};60pub use crate::ir::memtype::{MemoryTypeData, MemoryTypeField};61pub use crate::ir::pcc::{BaseExpr, Expr, Fact, FactContext, PccError, PccResult};62pub use crate::ir::progpoint::ProgramPoint;63pub use crate::ir::sourceloc::RelSourceLoc;64pub use crate::ir::sourceloc::SourceLoc;65pub use crate::ir::stackslot::{66DynamicStackSlotData, DynamicStackSlots, StackSlotData, StackSlotKind, StackSlots,67};68pub use crate::ir::trapcode::TrapCode;69pub use crate::ir::types::Type;70pub(crate) use crate::ir::user_stack_maps::UserStackMapEntryVec;71pub use crate::ir::user_stack_maps::{UserStackMap, UserStackMapEntry};7273use crate::entity::{PrimaryMap, SecondaryMap, entity_impl};7475/// Map of jump tables.76pub type JumpTables = PrimaryMap<JumpTable, JumpTableData>;7778/// Map of exception tables.79pub type ExceptionTables = PrimaryMap<ExceptionTable, ExceptionTableData>;8081/// Source locations for instructions.82pub(crate) type SourceLocs = SecondaryMap<Inst, RelSourceLoc>;8384/// Marked with a label value.85#[derive(Copy, Clone, PartialEq, Eq, Hash)]86#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]87pub struct ValueLabel(u32);88entity_impl!(ValueLabel, "VL");8990/// A label of a Value.91#[derive(Debug, Clone, PartialEq, Hash)]92#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]93pub struct ValueLabelStart {94/// Source location when it is in effect95pub from: RelSourceLoc,9697/// The label index.98pub label: ValueLabel,99}100101/// Value label assignments: label starts or value aliases.102#[derive(Debug, Clone, PartialEq, Hash)]103#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]104pub enum ValueLabelAssignments {105/// Original value labels assigned at transform.106Starts(alloc::vec::Vec<ValueLabelStart>),107108/// A value alias to original value.109Alias {110/// Source location when it is in effect111from: RelSourceLoc,112113/// The label index.114value: Value,115},116}117118119