The legalize_signature() function will return ArgumentLoc::Reg arguments that contain a register unit. However, the register also needs to be able to associate a register class with the argument values to fully track the used registers. When values are defined by instructions, the register class is part for the operand constraints for the instruction. For values defined on ABI boundaries like function arguments and return values from a call, the register class is provided by the new regclass_for_abi_type() function. Provide implementations of this function in abi modules of all the targets, even those that don't have a legalize_signature() implementation yet. Since we're adding abi modules to all targets, move the legalize_signature() stubs in there and make the function mandatory in TargetIsa. All targets will eventually need this function.
19 lines
494 B
Rust
19 lines
494 B
Rust
//! Intel ABI implementation.
|
|
|
|
use ir;
|
|
use isa::RegClass;
|
|
use settings as shared_settings;
|
|
use super::registers::{GPR, FPR};
|
|
|
|
/// Legalize `sig`.
|
|
pub fn legalize_signature(_sig: &mut ir::Signature,
|
|
_flags: &shared_settings::Flags,
|
|
_current: bool) {
|
|
unimplemented!()
|
|
}
|
|
|
|
/// Get register class for a type appearing in a legalized signature.
|
|
pub fn regclass_for_abi_type(ty: ir::Type) -> RegClass {
|
|
if ty.is_int() { GPR } else { FPR }
|
|
}
|