luaur-code-gen 0.1.1

Native (A64/X64) code generation for Luau (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::functions::add_use::add_use;
use crate::functions::remove_use::remove_use;
use crate::records::ir_function::IrFunction;
use crate::records::ir_op::IrOp;

pub fn replace_ir_function_ir_op_ir_op(
    function: &mut IrFunction,
    original: &mut IrOp,
    replacement: IrOp,
) {
    // Add use before removing new one if that's the last one keeping target operand alive
    add_use(function, replacement);
    remove_use(function, *original);

    *original = replacement;
}