pub struct PhaseCIndirectDrain {
pub address_taken_names: Vec<DeferredAddressTakenEntry>,
pub struct_field_signatures: Vec<(String, String, String)>,
pub bindings: Vec<(FileId, PendingBinding)>,
pub indirect_callsites: Vec<(FileId, PendingIndirectCallsite)>,
pub local_scope_indices: Vec<(FileId, LocalScopeIndex)>,
}Expand description
Drained C indirect-call staging payload, resolved to owned Strings.
The per-file
super::staging::CIndirectStagingPayload contains:
pending_address_taken_names: Vec<StringId>— staging-local string ids that we resolve to ownedStrings viastaging.resolve_local_stringhere so the post-4c-prime applier can re-intern through the canonical interner without holding any staging-graph reference;pending_struct_field_signatures: Vec<(String, String, String)>— already owned;pending_bindings: Vec<PendingBinding>— already owned;pending_indirect_callsites: Vec<PendingIndirectCallsite>— already owned (carrier-side stamping ofFileIdhappens here so the applier does not need per-file context);local_scope_index: Option<LocalScopeIndex>— moved verbatim.
The applier ([apply_c_indirect_drain]) interns the owned strings into
the post-Phase-4a-dedup graph interner, resolves names to canonical
NodeIds via crate::graph::unified::storage::indices::AuxiliaryIndices::by_qualified_name
(with a by_name fallback for languages whose canonical qualified name
equals the semantic name and therefore leaves
NodeEntry::qualified_name unset — e.g. C, where cb_alpha is its
own qualified name), and writes them into
[CodeGraph::c_indirect_tables_mut].
Per DESIGN §8.2, this drain bridges the parallel-parse-and-commit boundary (Phase 3) to the post-unification application step (Phase 4 finalisation, just after Phase 4c-prime returns).
Fields§
§address_taken_names: Vec<DeferredAddressTakenEntry>Address-taken function qualified-name entries to mark post-unification.
Each entry pairs the bare/qualified function name the C plugin
captured in helper.mark_function_address_taken_by_name(...) with
the source FileId (always a C-language file by construction —
only the C plugin populates CIndirectStagingPayload).
Per DESIGN §8.2 lines 1239-1241: “A pending list of
(function_qualified_name, file_id) for address-taken marks”. The
file_id is the origin file (where the address-take site lives),
not the file of the resolved callable target. It is carried so the
applier can constrain the workspace-global by_name fallback in
[crate::graph::unified::build::entrypoint::apply_deferred_address_taken_marks]
to candidate nodes whose own owning file’s language is C — a
non-C namesake (e.g. a Rust fn cb_alpha) must NOT be marked by
the C-scoped contract of SPEC §3.1.2.
Duplicates on function_qualified_name are tolerated —
crate::graph::unified::storage::metadata::NodeMetadataStore::mark_address_taken
is idempotent.
struct_field_signatures: Vec<(String, String, String)>(struct_tag, field_name, signature) triples — DESIGN §3.2.2.
Drained verbatim from the staging payload. The applier interns each
leg via graph.strings_mut().intern(...) and inserts into
CIndirectSideTables::struct_field_fnptr.
bindings: Vec<(FileId, PendingBinding)>Binding-plane entries (DESIGN §7.1) paired with their origin FileId.
The applier resolves instance_name and target_fn_name to
canonical NodeIds and inserts a [BindingEntry] under the
interned (struct_tag, field_name) key in
CIndirectSideTables::bindings_by_field. The FileId is the
origin file (the C TU that staged the binding), retained for the
same C-language-scoped fallback rationale as
Self::address_taken_names.
indirect_callsites: Vec<(FileId, PendingIndirectCallsite)>Indirect callsites paired with their owning FileId. The applier
resolves caller_qualified_name to a NodeId and pushes an
[IndirectCallsite] onto CIndirectSideTables::pending_callsites.
FileId is stamped here from the per-file FilePlan so the applier
does not need per-file context.
local_scope_indices: Vec<(FileId, LocalScopeIndex)>Per-file block-scope arenas (DESIGN §4.1). Moved verbatim into
CIndirectSideTables::local_scope_indices keyed by FileId.
Implementations§
Source§impl PhaseCIndirectDrain
impl PhaseCIndirectDrain
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true when every drained vec/map is empty.
Used by the chunk-accumulator in entrypoint.rs to skip Phase 4
application entirely for non-C workspaces, keeping the
CodeGraph.c_indirect_tables slot at its default None.
Sourcepub fn merge(&mut self, other: PhaseCIndirectDrain)
pub fn merge(&mut self, other: PhaseCIndirectDrain)
Merge another drain into this one, taking ownership of its contents.
Used by the chunk-loop in entrypoint.rs to accumulate per-chunk
drains into a single workspace-global drain before invoking
[apply_c_indirect_drain].
Trait Implementations§
Source§impl Debug for PhaseCIndirectDrain
impl Debug for PhaseCIndirectDrain
Source§impl Default for PhaseCIndirectDrain
impl Default for PhaseCIndirectDrain
Source§fn default() -> PhaseCIndirectDrain
fn default() -> PhaseCIndirectDrain
Auto Trait Implementations§
impl Freeze for PhaseCIndirectDrain
impl RefUnwindSafe for PhaseCIndirectDrain
impl Send for PhaseCIndirectDrain
impl Sync for PhaseCIndirectDrain
impl Unpin for PhaseCIndirectDrain
impl UnsafeUnpin for PhaseCIndirectDrain
impl UnwindSafe for PhaseCIndirectDrain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more