Skip to main content

luaur_code_gen/functions/
get_op_ir_data.rs

1use crate::records::ir_inst::IrInst;
2use crate::records::ir_op::IrOp;
3use luaur_common::macros::luau_unlikely::LUAU_UNLIKELY;
4
5#[inline]
6pub fn get_op_mut(inst: &mut IrInst, idx: u32) -> &mut IrOp {
7    if LUAU_UNLIKELY!(idx >= inst.ops.size()) {
8        inst.ops.resize(idx + 1);
9    }
10    &mut inst.ops[idx as usize]
11}