Skip to main content

Module ir

Module ir 

Source
Expand description

What a compiler knows, in the shape both sides agree on.

This is the payload the whole process boundary exists to carry: resolved symbols and types, a control-flow graph, what each call actually calls, and where a generic body was instantiated from. A helper produces it with one compiler; the analysis crates consume it without knowing which.

§Anchoring, and why expansion is the side that anchors

Every node carries an Anchor rather than a single range, because code that came from a macro or a template has two places and they answer different questions. The expansion site is where the code physically sits in the file someone reads, which is the only place a syntax fragment can be cut from — so that is what a node anchors to. The definition site is where the text was actually written, and it is kept because it is what tells repetition apart from duplication.

The distinction is not academic. A macro invoked twenty times produces twenty identical bodies, and a detector that anchors only at the expansion site reports twenty clones of something nobody wrote twice and nobody can remove — the labelled corpora call that shape something other than duplication, consistently. Keeping the definition site lets a group say “one definition, twenty expansions” instead.

§Auxiliary semantic evidence

EffectSummary reports only closed, compiler-confirmed resource interactions. Its empty list is never a purity claim. DataFlowSummary records only bounded compiler-confirmed operation flows; absent evidence never changes which semantic findings exist.

Structs§

Anchor
Where a node is, and where it was written.
BasicBlock
One straight-line run of a control-flow graph.
CallSite
One call, and what it was found to call.
CompilerIr
Everything one helper found in one unit.
ControlFlowGraph
A control-flow graph, as the compiler built it.
DataFlowSummary
How values move through a unit.
Edge
A transfer of control between two blocks.
EffectSummary
What a unit does beyond computing a value.
Instantiation
Where an instantiated body came from.
ResolvedExpression
The type the compiler resolved for an expression with no physical source token of its own, such as the body a declarative macro generated.
ResolvedSymbol
A name the compiler resolved to a definition.
ResolvedType
A type as the compiler resolved it.
SemanticConstruct
One compiler-confirmed construct that a restricted semantic rule may normalize without reconstructing syntax in the analysis process.
SourceRange
A half-open byte range in one file, with the line its start falls on.
UnexpandedMacro
A macro invocation the helper deliberately did not expand.
UnitRef
Which piece of a project an analysis is about.

Enums§

CallTarget
What a call resolves to.
DirectPropagation
A compiler-confirmed direct spelling of a fallible propagation operation.
EdgeKind
Why control moves along an edge.
FallibleKind
A standard library fallible container established by the compiler.
SemanticConstructKind
Closed semantic constructs that compiler helpers may report.
SymbolKind
What kind of definition a symbol names.
TypeCategory
The normalized kind of a type.
Unavailability
Why a unit has no compiler IR.
UnexpandedMacroReason
Why an individual macro invocation was not expanded.

Constants§

COMPILER_IR_SCHEMA_VERSION
The compiler-IR schema identifier.

Functions§

spell
How a path is spelled against root.