Skip to main content

SegTerminator

Enum SegTerminator 

Source
pub enum SegTerminator<'d> {
    Goto(SegId),
    CondGoto {
        cond: Expression<'d>,
        t: SegId,
        f: SegId,
    },
    Suspend {
        point: SuspendPoint<'d>,
        resume: SegId,
        live_out: Vec<u32>,
    },
    End {
        loop_back: Option<SegId>,
    },
    SwitchGoto {
        on: SwitchOn<'d>,
        arms: Vec<SegId>,
        default: SegId,
        report: Option<SourceLoc>,
    },
    CondGotoCounter {
        counter: RepeatCounterId,
        t: SegId,
        f: SegId,
    },
    ForkJoin {
        kind: StatementBlockKind,
        branches: Vec<ProcessCfg<'d>>,
        join_blk: SegId,
        live_out: Vec<u32>,
    },
    AssertGoto {
        stmt: Statement<'d>,
        pass: SegId,
        fail: SegId,
        done: SegId,
    },
    CaseGoto {
        stmt: Statement<'d>,
        arms: Vec<SegId>,
        default: SegId,
    },
}
Expand description

PR-043: covers every Terminator variant with no lossy fallback (see lower_to_segments’s 1:1 mapping).

Variants§

§

Goto(SegId)

§

CondGoto

Fields

§cond: Expression<'d>
§

Suspend

Fields

§point: SuspendPoint<'d>
§resume: SegId
§live_out: Vec<u32>
§

End

Fields

§loop_back: Option<SegId>
§

SwitchGoto

The lowering of Terminator::Switch.

Fields

§on: SwitchOn<'d>
§arms: Vec<SegId>
§default: SegId
§

CondGotoCounter

R-run Task 8: the lossless lowering of Terminator::RepeatCheck – see that variant’s own doc comment for why a repeat(N) loop’s per-iteration decision cannot be represented as an ordinary CondGoto (no cond: Expression exists for “compiler-synthesized counter != 0”). Deviation from this file’s own module doc comment (Task 1’s “frozen, codegen-exhausted SegTerminator” policy): that policy was written to rule out ForkJoin specifically (which has no honest SegTerminator shape at all, ever, this wave); a suspend nested inside a repeat body is a genuinely new kind of branch condition this crate had no way to construct before this task, not a reachability gap in the pre-existing four variants – recorded in this task’s own deviations.

Fields

§

ForkJoin

R-run Task 17 (PR-047/PR-061): the lossless lowering of Terminator::ForkJoin – a real, new SegTerminator shape, added for the identical reason CondGotoCounter above already documents a deviation from this file’s own “frozen SegTerminator” policy note: that note was written to rule out ForkJoin specifically because NOTHING had implemented fork/join scheduling yet; this task is that implementation for StatementBlockKind::JoinAll (codegen enforces the JoinAll-only scope with a named LoweringError for JoinAny/ JoinNone – this type carries kind through losslessly so codegen has it to check, rather than this crate silently narrowing what it represents). branches is exactly Terminator::ForkJoin’s own field, carried through unchanged (each branch is still a full, independently suspend-capable nested ProcessCfg – codegen recursively lowers each one into its own real compiled kernel). join_blk/live_out mirror Suspend’s own resume/live_out fields exactly: a fork/join site suspends the calling process (until every spawned child completes, for JoinAll) just as surely as a Suspend terminator does, so the same permanent-frame-slot liveness/writeback discipline applies – see lower_to_segments’s own fill rule.

Fields

§branches: Vec<ProcessCfg<'d>>
§join_blk: SegId
§live_out: Vec<u32>
§

AssertGoto

The lowering of Terminator::Assertion.

Fields

§stmt: Statement<'d>
§pass: SegId
§fail: SegId
§done: SegId
§

CaseGoto

The lowering of Terminator::Case: goes to arms[i] for the first item of stmt whose labels match its selector, else default.

Fields

§stmt: Statement<'d>
§arms: Vec<SegId>
§default: SegId

Trait Implementations§

Source§

impl<'d> Clone for SegTerminator<'d>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'d> Debug for SegTerminator<'d>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'d> !RefUnwindSafe for SegTerminator<'d>

§

impl<'d> !UnwindSafe for SegTerminator<'d>

§

impl<'d> Freeze for SegTerminator<'d>

§

impl<'d> Send for SegTerminator<'d>

§

impl<'d> Sync for SegTerminator<'d>

§

impl<'d> Unpin for SegTerminator<'d>

§

impl<'d> UnsafeUnpin for SegTerminator<'d>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V