[][src]Struct libfirm_rs::nodes::Bad

pub struct Bad(_);

Bad nodes indicate invalid input, which is values which should never be computed.

The typical use case for the Bad node is removing unreachable code. Frontends should set the current_block to Bad when it is clear that following code must be unreachable (i.e. after a goto or return statement). Optimizations also set block predecessors to Bad when it becomes clear, that a control flow edge can never be executed.

The gigo optimizations ensures that nodes with Bad as their block, get replaced by Bad themselves. Nodes with at least 1 Bad input get exchanged with Bad too. Exception to this rule are Block, Phi, Tuple and End node; This is because removing inputs from a Block is hairy operation (requiring, Phis to be shortened too for example). So instead of removing block inputs they are set to Bad, and the actual removal is left to the control flow optimization phase. Block, Phi, Tuple with only Bad inputs however are replaced by Bad right away.

In the future we may use the Bad node to model poison values that arise from undefined behaviour like reading uninitialized local variables in C.

Trait Implementations

impl NodeTrait for Bad
[src]

Important traits for OutNodeIterator

Important traits for OutNodeExIterator

Important traits for InNodeIterator

libifrm irg_walk wrapper Read more

Perform a DFS over all nodes within block starting at self. As soon as a Phi node is reached, that branch of the DFS is canceled. There is no callback for a Phi node. The primary use case for this API is in codegen. Read more

impl NodeDebug for Bad
[src]

impl PartialEq<Bad> for Bad
[src]

impl From<Bad> for Node
[src]

impl Clone for Bad
[src]

Performs copy-assignment from source. Read more

impl Copy for Bad
[src]

impl Eq for Bad
[src]

impl Debug for Bad
[src]

impl Hash for Bad
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl !Send for Bad

impl !Sync for Bad

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]