Skip to main content

luaur_code_gen/methods/
const_prop_state_try_get_value.rs

1use crate::enums::ir_op_kind::IrOpKind;
2use crate::records::const_prop_state::ConstPropState;
3use crate::records::ir_op::IrOp;
4
5impl ConstPropState {
6    pub fn try_get_value(&mut self, op: IrOp) -> IrOp {
7        if let Some(info) = self.try_get_register_info(op) {
8            return unsafe { (*info).value };
9        }
10
11        IrOp::ir_op_kind_u32(IrOpKind::None, 0)
12    }
13}