Skip to main content

luaur_bytecode/methods/
bc_function_phi.rs

1use crate::enums::bc_op_kind::BcOpKind;
2use crate::records::bc_function::BcFunction;
3use crate::records::bc_op::BcOp;
4use crate::records::bc_phi::BcPhi;
5use crate::records::bc_ref::BcRef;
6use luaur_common::macros::luau_assert::LUAU_ASSERT;
7
8impl BcFunction {
9    pub fn phi<'a>(&'a self, op: BcOp) -> BcRef<'a, BcPhi> {
10        LUAU_ASSERT!(op.kind == BcOpKind::Phi);
11        BcRef {
12            vec: &self.phis,
13            op,
14        }
15    }
16}