Skip to main content

Crate ud_ir

Crate ud_ir 

Source
Expand description

Shared IR types for univdreams.

Per the architecture sketch, the IR is arch-tagged: each architecture brings its own instruction vocabulary. This crate hosts only the concepts that genuinely span architectures — function and basic-block structure, control-flow terminators, and the ArchInsn trait that lets per-arch instruction types plug in.

The byte-identity contract for the IR layer:

For any Function built from real bytes by an arch’s lifter, Function::emit_bytes returns exactly the input bytes.

This is true by construction: emit_bytes concatenates each instruction’s preserved original bytes in address order. The CFG structure is a view over a flat byte stream, not a transformation of it.

Modules§

ssa
Arch-agnostic SSA (Static Single Assignment) construction.

Structs§

BasicBlock
A maximal straight-line sequence of instructions ending in a Terminator.
Function
A function: a name, an entry address, and a sequence of basic blocks in original layout (address) order.

Enums§

Terminator
How control flow leaves a basic block.

Traits§

ArchInsn
An architecture’s per-instruction type, plugged into the shared IR.