Skip to main content

Crate rcc_cfg

Crate rcc_cfg 

Source
Expand description

rcc_cfg: MIR-style control-flow graph for the rcc C compiler.

Roughly analogous to rustc_middle::mir. The CFG is intentionally non-SSA; SSA construction is delegated to LLVM’s mem2reg pass, which promotes the alloca + load/store pattern we emit.

Re-exports§

pub use build::build_bodies;
pub use build::BodyBuilder;
pub use build::BreakCtx;
pub use build::LoopCtx;
pub use lower::lower_as_place;
pub use lower::lower_as_rvalue;
pub use lower::lower_stmt;
pub use lower::LocalMap;
pub use lower::LowerCx;

Modules§

build
HIR -> CFG lowering. Produces one Body per function.
lower
HIR expression -> CFG (Operand / Place) lowering.
pretty
Stable textual MIR/CFG dump.
verify
Release-profile CFG verifier.

Structs§

BasicBlock
A single basic block.
BasicBlockId
Basic-block id within a Body.
Body
Per-function CFG.
Const
Constant operand.
InlineAsm
GNU inline assembly statement lowered to CFG operands and places.
InlineAsmInput
One inline assembly input operand.
InlineAsmOutput
One inline assembly output operand.
LocalDecl
Metadata for one local slot.
Place
A memory location addressable by the IR.
Statement
One straight-line statement.
Terminator
Terminator for a basic block.

Enums§

BinOp
Binary op for the CFG (post type-checking; concrete semantics known).
CastKind
Cast kinds recognised by the backend.
ConstKind
Constant kinds.
InlineAsmArg
Operand payload passed to LLVM inline asm.
Operand
Operand: value used in an rvalue or terminator.
Projection
One step of a place projection.
Rvalue
Right-hand side of an assignment.
StatementKind
Statement discriminant.
TerminatorKind
Terminator discriminant.
UnOp
Unary op.