pub enum OptimizeCommandKind {
Show 13 variants Delete, DiscardResult, InlineBranch(bool), UpdateBranch { branch: bool, new_node: Node, }, UpdateBranchCondition(Condition), InlineFunction, RemoveAliasFunction(BlockId), ChangeWrite(ItemId), ChangeReads(ItemId, ScoreboardValue), SetCondition(Condition, Vec<usize>), Replace(Node), InsertAfter(Node), UpdateExecuteRaw(usize, ExecuteRawUpdate),
}
Expand description

Optimizing functions output commands that tell the optimizer what to do, this is done so that there are no troubles with mutability

Variants§

§

Delete

Deletes a single node

§

DiscardResult

Converts the FastStoreFromResult node into its command, discarding the result

§

InlineBranch(bool)

Discards the node and only keeps the branch that matches the bool. (true => pos_branch, false => neg_branch)

§

UpdateBranch

Fields

§branch: bool
§new_node: Node

Updates the specified branch with the new node

§

UpdateBranchCondition(Condition)

Updates the condition of a branch

§

InlineFunction

Inlines the function of this function call.

§

RemoveAliasFunction(BlockId)

Removes all aliases to a function which only redirects to another function The argument specifies the aliased function.

§

ChangeWrite(ItemId)

Changes the variable this node writes to

§

ChangeReads(ItemId, ScoreboardValue)

Replaces all variables .0 with .1

§

SetCondition(Condition, Vec<usize>)

Changes the condition of this branch to a new condition Vec usize contains the exact index of the condition to replace (Vec since conditions can be nested)

§

Replace(Node)

Replaces the old node completely

§

InsertAfter(Node)

Inserts this node after

§

UpdateExecuteRaw(usize, ExecuteRawUpdate)

Modifies a Node::Execute IMPORTANT: Right now the indices don’t get normalized after a component is deleted This means that this command should not get used anywhere else other than in the one branch in redundancy_optimizer

Trait Implementations§

source§

impl Debug for OptimizeCommandKind

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.