aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2020-09-08 13:56:01 +0200
committerXavier Leroy <xavier.leroy@college-de-france.fr>2020-12-25 18:34:24 +0100
commit9ab3738ae87a554fb742420b8c81ced4cd3c66c7 (patch)
treecc17ce961dfc2f8dd13f4428b0814c8fe66be254 /common
parenta138b43ccb391be63bed2fea26cd36dab96b091f (diff)
downloadcompcert-kvx-9ab3738ae87a554fb742420b8c81ced4cd3c66c7.tar.gz
compcert-kvx-9ab3738ae87a554fb742420b8c81ced4cd3c66c7.zip
Changed cc_varargs to an option type
Instead of being a simple boolean we now use an option type to record the number of fixed (non-vararg) arguments. Hence, `None` means not vararg, and `Some n` means `n` fixed arguments followed with varargs.
Diffstat (limited to 'common')
-rw-r--r--common/AST.v10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/AST.v b/common/AST.v
index ddd10ede..4f954c5c 100644
--- a/common/AST.v
+++ b/common/AST.v
@@ -122,17 +122,17 @@ These signatures are used in particular to determine appropriate
calling conventions for the function. *)
Record calling_convention : Type := mkcallconv {
- cc_vararg: bool; (**r variable-arity function *)
- cc_unproto: bool; (**r old-style unprototyped function *)
- cc_structret: bool (**r function returning a struct *)
+ cc_vararg: option Z; (**r variable-arity function (+ number of fixed args) *)
+ cc_unproto: bool; (**r old-style unprototyped function *)
+ cc_structret: bool (**r function returning a struct *)
}.
Definition cc_default :=
- {| cc_vararg := false; cc_unproto := false; cc_structret := false |}.
+ {| cc_vararg := None; cc_unproto := false; cc_structret := false |}.
Definition calling_convention_eq (x y: calling_convention) : {x=y} + {x<>y}.
Proof.
- decide equality; apply bool_dec.
+ decide equality; try (apply bool_dec). decide equality; apply Z.eq_dec.
Defined.
Global Opaque calling_convention_eq.