cranelift_codegen/ir/
mod.rs1mod atomic_rmw_op;
4mod builder;
5pub mod condcodes;
6pub mod constant;
7pub mod dfg;
8pub mod dynamic_type;
9pub mod entities;
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 progpoint;
22mod sourceloc;
23pub mod stackslot;
24mod table;
25mod trapcode;
26pub mod types;
27
28#[cfg(feature = "enable-serde")]
29use serde::{Deserialize, Serialize};
30
31pub use crate::ir::atomic_rmw_op::AtomicRmwOp;
32pub use crate::ir::builder::{
33 InsertBuilder, InstBuilder, InstBuilderBase, InstInserterBase, ReplaceBuilder,
34};
35pub use crate::ir::constant::{ConstantData, ConstantPool};
36pub use crate::ir::dfg::{BlockData, DataFlowGraph, ValueDef};
37pub use crate::ir::dynamic_type::{dynamic_to_fixed, DynamicTypeData, DynamicTypes};
38pub use crate::ir::entities::{
39 Block, Constant, DynamicStackSlot, DynamicType, FuncRef, GlobalValue, Immediate, Inst,
40 JumpTable, SigRef, StackSlot, Table, UserExternalNameRef, Value,
41};
42pub use crate::ir::extfunc::{
43 AbiParam, ArgumentExtension, ArgumentPurpose, ExtFuncData, Signature,
44};
45pub use crate::ir::extname::{ExternalName, UserExternalName, UserFuncName};
46pub use crate::ir::function::{DisplayFunctionAnnotations, Function};
47pub use crate::ir::globalvalue::GlobalValueData;
48pub use crate::ir::instructions::{
49 BlockCall, InstructionData, Opcode, ValueList, ValueListPool, VariableArgs,
50};
51pub use crate::ir::jumptable::JumpTableData;
52pub use crate::ir::known_symbol::KnownSymbol;
53pub use crate::ir::layout::Layout;
54pub use crate::ir::libcall::{get_probestack_funcref, LibCall};
55pub use crate::ir::memflags::{Endianness, MemFlags};
56pub use crate::ir::progpoint::ProgramPoint;
57pub use crate::ir::sourceloc::RelSourceLoc;
58pub use crate::ir::sourceloc::SourceLoc;
59pub use crate::ir::stackslot::{
60 DynamicStackSlotData, DynamicStackSlots, StackSlotData, StackSlotKind, StackSlots,
61};
62pub use crate::ir::table::TableData;
63pub use crate::ir::trapcode::TrapCode;
64pub use crate::ir::types::Type;
65pub use crate::value_label::LabelValueLoc;
66
67use crate::entity::{entity_impl, PrimaryMap, SecondaryMap};
68
69pub type JumpTables = PrimaryMap<JumpTable, JumpTableData>;
71
72pub(crate) type SourceLocs = SecondaryMap<Inst, RelSourceLoc>;
74
75#[derive(Copy, Clone, PartialEq, Eq, Hash)]
77#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
78pub struct ValueLabel(u32);
79entity_impl!(ValueLabel, "val");
80
81#[derive(Debug, Clone, PartialEq, Hash)]
83#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
84pub struct ValueLabelStart {
85 pub from: RelSourceLoc,
87
88 pub label: ValueLabel,
90}
91
92#[derive(Debug, Clone, PartialEq, Hash)]
94#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
95pub enum ValueLabelAssignments {
96 Starts(alloc::vec::Vec<ValueLabelStart>),
98
99 Alias {
101 from: RelSourceLoc,
103
104 value: Value,
106 },
107}