Avoid reading call_used_regs for ABI-specific information
x86 now explicitly queries ABIs instead of using the legacy `call_used_regs` interface.
This commit replaces the use of the legacy call_used_regs interface with explicit ABI querying in several i386 functions. This change ensures that functions like ix86_emit_tls_call and x86_order_regs_for_local_alloc correctly query the system ABI or the current function’s ABI, rather than relying on a potentially ambiguous global default. This sets the stage for more robust handling of multiple ABIs.
In Details
This patch refactors i386 code to use explicit ABI querying instead of the legacy call_used_regs interface. ix86_emit_tls_call now uses default_function_abi (representing the system ABI) instead of call_used_regs. Similarly, x86_order_regs_for_local_alloc also uses default_function_abi. For functions querying the current function's ABI, crtl->abi is now used instead of call_used_regs. This change is a prerequisite for upcoming function_abi related patches.
- ABI
- Application Binary Interface. Defines how low-level code constructs (like function calls, data structures, and system calls) are represented and interact at the binary level.
- call_used_regs
- A legacy interface used by targets to inform
init_reg_sets_1about default ABI register usage. It is being replaced by more explicit ABI querying. - TLS
- Thread-Local Storage. A mechanism that allows variables to have unique instances for each thread of execution.