Describing the calling convention
Before explaining how to describe a calling convention, let us define what this is.
A calling convention is a set of rules that describe how calls are lowered. They represent a subset of the specification of an ABI. Complete ABIs also define how names are mangled, among other things.
It is likely that a given backend must support several calling conventions. For instance, running on different operation systems (OSs) may require different lowering rules and it’s the same for different input languages (such as Swift or C++.) The bottom line is, when you describe your calling convention, it will be related to a name – for instance, if you look at the specifications of the ABIs of the ARM architecture, called the ARM architecture procedure call standard (AAPCS), you will see that there are different variants for the 32-bit architecture, called aapcs32, and the 64-bit architecture, called aapcs64. The point is we recommend that you...