diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2018-03-07 13:37:20 +0100 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2018-03-07 13:37:20 +0100 |
commit | 36f52bf433614156a64358dbd71019b8d34865c5 (patch) | |
tree | 3494b9a2e94c420ba378bd2c83de07884d565f76 /backend/AisAnnot.mli | |
parent | c91b33e36d96a51329d53bd9efa1523e567d1812 (diff) | |
download | compcert-kvx-36f52bf433614156a64358dbd71019b8d34865c5.tar.gz compcert-kvx-36f52bf433614156a64358dbd71019b8d34865c5.zip |
Improve and simplify error messages.
The checks on the argument and format arguments are now performed
during C2C translation by calling the validate_ais_annotations
function and result in an error instead of a warning in the
backend to be more consistent with the rest of the builtin
functions.
Diffstat (limited to 'backend/AisAnnot.mli')
-rw-r--r-- | backend/AisAnnot.mli | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/backend/AisAnnot.mli b/backend/AisAnnot.mli index 7219369c..59676b26 100644 --- a/backend/AisAnnot.mli +++ b/backend/AisAnnot.mli @@ -18,10 +18,8 @@ type t = val add_ais_annot : int -> ('a -> string) -> string -> string -> 'a AST.builtin_arg list -> unit (** [add_ais_annot lbl preg spreg txt args] adds the ais annotation [txt] were the format specifiers are replace according to their type: - -a: area definitions -e: general expressions -l: l-value expressions - -p: program location -here: the address of the ais annotation [lbl] and [preg] is used to get the names of the registers, as well as [spreg] the name of the stack pointer and [args] the arguments reference in the replacements @@ -29,3 +27,9 @@ val add_ais_annot : int -> ('a -> string) -> string -> string -> 'a AST.builtin_ val get_ais_annots: unit -> (t list) list (** [get_ais_annots ()] return the list of all ais annotations and reset it *) + +val validate_ais_annot: Env.t -> string * int -> string -> C.exp list -> unit +(** [validate_ais env loc txt args] validates the ais annotation text and arguments, checking + that no volatile variables or float expressions are used as well as that no illegal format + specifier is used in the [txt] +*) |