functions.c
// Nuke all IR_ARG instructions that have had code added that moves the value into a register
Nuke all IR_ARG instructions that have had code added that moves the value into a register
Nuke all IR_ARG instructions that have had code added that moves the value into a register
static void remove_IR_ARG_instructions_that_have_been_handled(Function *function) {
    for (Tac *ir = function->ir; ir; ir = ir->next) {
        if (ir->operation == IR_ARG) {
            FunctionParamLocations *pl = ir->src1->function_call_arg_locations;
            for (int loc = 0; loc < pl->count; loc++) {
                if (pl->locations[loc].int_register != -1 || pl->locations[loc].sse_register != -1) {
                    ir->operation = IR_NOP;
                    ir->dst = 0;
                    ir->src1 = 0;
                    ir->src2 = 0;
                    break;
                }
            }
        }
    }
}
static void remove_IR_ARG_instructions_that_have_been_handled ( Function * function ) { for ( Tac * ir = function -> ir ; ir ; ir = ir -> next ) { if ( ir -> operation == IR_ARG ) { FunctionParamLocations * pl = ir -> src1 -> function_call_arg_locations ; for ( int loc = 0 ; loc < pl -> count ; loc ++ ) { if ( pl -> locations [ loc ] . int_register != -1 || pl -> locations [ loc ] . sse_register != -1 ) { ir -> operation = IR_NOP ; ir -> dst = 0 ; ir -> src1 = 0 ; ir -> src2 = 0 ; break ; } } } } }
Nuke all IR_ARG instructions that have had code added that moves the value into a register
Nuke all IR_ARG instructions that have had code added that moves the value into a register