make variadic args explicit

Some abis, like the riscv one, treat
arguments differently depending on
whether they are variadic or not.
To prepare for the upcomming riscv
target, we change the variadic call
syntax and give meaning to the
location of the '...' marker.

  # new syntax
  %ret =w call $f(w %regular, ..., w %variadic)

By nature of their abis, the change
is backwards compatible for existing
targets.
This commit is contained in:
Quentin Carbonneaux 2021-10-18 21:04:10 +02:00
parent 9858a12730
commit fcdef10dae
13 changed files with 101 additions and 75 deletions

3
all.h
View file

@ -171,12 +171,11 @@ enum {
};
#define INRANGE(x, l, u) ((unsigned)(x) - l <= u - l) /* linear in x */
#define iscall(o) INRANGE(o, Ocall, Ovacall)
#define isstore(o) INRANGE(o, Ostoreb, Ostored)
#define isload(o) INRANGE(o, Oloadsb, Oload)
#define isext(o) INRANGE(o, Oextsb, Oextuw)
#define ispar(o) INRANGE(o, Opar, Opare)
#define isarg(o) INRANGE(o, Oarg, Oarge)
#define isarg(o) INRANGE(o, Oarg, Oargv)
#define isret(j) INRANGE(j, Jret0, Jretc)
enum Class {