From 7ca7e64ab06d0d4deb6b3b48593f4955cf5c3c5f Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 6 Mar 2018 09:59:23 +0100 Subject: Reactivated and improved ais annotations. The ais annotations are now handled in a separate file shared between all architectures. Also two different variants of replacements are supported, %e which expands to ais expressions and %l which also expands to an ais expression but is guaranted to be usable as l-value in the ais annotation. Otherwise the new warning is Wrong_is_parameter is generated. Also an error message is generated if floating point variables are used in ais annotations since a3 does not support them at the moment. Additionally an error message is generated for plain volatile variables used, since they will enforce a volatile load and result in the value being passed to the annotation instead of the address as other global variables. --- riscV/TargetPrinter.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'riscV/TargetPrinter.ml') diff --git a/riscV/TargetPrinter.ml b/riscV/TargetPrinter.ml index 696bc87f..381f4397 100644 --- a/riscV/TargetPrinter.ml +++ b/riscV/TargetPrinter.ml @@ -22,6 +22,7 @@ open Camlcoq open Sections open AST open Asm +open AisAnnot open PrintAsmaux open Fileinfo @@ -566,15 +567,14 @@ module Target : TARGET = | Pbuiltin(ef, args, res) -> begin match ef with | EF_annot(kind,txt, targs) -> - let annot = begin match (P.to_int kind) with - | 1 -> annot_text preg_annot "sp" (camlstring_of_coqstring txt) args + | 1 -> let annot = annot_text preg_annot "sp" (camlstring_of_coqstring txt) args in + fprintf oc "%s annotation: %S\n" comment annot | 2 -> let lbl = new_label () in fprintf oc "%a: " label lbl; - ais_annot_text lbl preg_annot "r1" (camlstring_of_coqstring txt) args + add_ais_annot lbl preg_annot "r1" (camlstring_of_coqstring txt) args | _ -> assert false - end in - fprintf oc "%s annotation: %S\n" comment annot + end | EF_debug(kind, txt, targs) -> print_debug_info comment print_file_line preg_annot "sp" oc (P.to_int kind) (extern_atom txt) args -- cgit