vyre-foundation 0.4.1

Foundation layer: IR, type system, memory model, wire format. Zero application semantics. Part of the vyre GPU compiler.
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::ir::Node;

#[inline]
pub(crate) fn reachable_prefix(nodes: &[Node]) -> &[Node] {
    let end = nodes
        .iter()
        .position(|node| matches!(node, Node::Return))
        .map_or(nodes.len(), |index| index + 1);
    &nodes[..end]
}