This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
Write and parse ABI annotations on function signatures #49
Labels
E-easy
Issues suitable for newcomers to investigate, including Rust newcomers!
In c8be39f I added support for ABI annotations on function signatures. These annotations indicate the location (stack or register) of individual function arguments and return values. We need:
Writing ABI annotations
The new syntax for function signatures is partially implemented:
If a signature has ABI annotations, they appear in brackets after each argument or return value. This is used everywhere function signatures appear:
signature
declaration in the preamble.function
declaration in the preamble.Each argument is annotated as follows:
[%x10]
using thedisplay_regunit()
function provided by theTargetIsa
. Note that the currently committed implementation is incorrect, it just prints the register unit number[%10]
. This is a stopgap until we can provide a&TargetIsa
reference. It is not a syntax we want to support going forward.[24]
, where the number in brackets is the argument's byte offset in the argument array.The
Signature
struct also has anargument_bytes
field now which indicates the needed size of the argument array. This field does not need to appear in the text format since it can be computed from the arguments.Parsing ABI annotations
The parser should accept the annotations above and fill in the
location
field of theArgumentType
structs when present.When parsing a file that doesn't specify exactly one ISA, the ABI annotations should be ignored.
After parsing a signature containing with ABI annotations, call the
Signature::compute_argument_bytes()
method.The text was updated successfully, but these errors were encountered: