functions.c
// Lookup corresponding location for preg_class/register
Lookup corresponding location for preg_class/register
Lookup corresponding location for preg_class / register
static FunctionParamLocation *lookup_location(int preg_class, int register_index, FunctionParamLocations *pl) {
    for (int loc = 0; loc < pl->count; loc++) {
        FunctionParamLocation *location = &(pl->locations[loc]);
        int function_call_register_arg_index = preg_class == PC_INT
            ? location->int_register
            : location->sse_register;
        if (function_call_register_arg_index == register_index) return location;
    }
    panic("Unhandled struct/union arg move into a register");
}
static FunctionParamLocation * lookup_location ( int preg_class , int register_index , FunctionParamLocations * pl ) { for ( int loc = 0 ; loc < pl -> count ; loc ++ ) { FunctionParamLocation * location = & ( pl -> locations [ loc ] ) ; int function_call_register_arg_index = preg_class == PC_INT ? location -> int_register : location -> sse_register ; if ( function_call_register_arg_index == register_index ) return location ; } panic ( " " ) ; }
Lookup corresponding location for preg_class/register
Lookup corresponding location for preg_class / register
// For the location that matches register_index