Skip to content
Snippets Groups Projects
Commit 8187d478 authored by Basile Desloges's avatar Basile Desloges
Browse files

[eacsl:tests] Update `print.ml` script to output E-ACSL generated globals

parent 4f76d084
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,20 @@ ...@@ -20,6 +20,20 @@
(* *) (* *)
(**************************************************************************) (**************************************************************************)
(* return true if the global g has been generated by E-ACSL *)
let is_generated (g: Cil_datatype.Global.t) =
let name =
match g with
| GType (ti, _) -> ti.tname
| GCompTagDecl (ci, _) | GCompTag(ci, _) -> ci.cname
| GEnumTagDecl (ei, _) | GEnumTag (ei, _) -> ei.ename
| GVarDecl (vi, _) | GVar(vi, _, _) -> vi.vname
| GFun (fundec, _) -> fundec.svar.vname
| GFunDecl (_, vi, _) -> vi.vname
| _ -> ""
in
E_ACSL.Functions.RTL.is_generated_name name
module Printer_extension(X: Printer.PrinterClass) = struct module Printer_extension(X: Printer.PrinterClass) = struct
class printer = object class printer = object
...@@ -29,7 +43,8 @@ module Printer_extension(X: Printer.PrinterClass) = struct ...@@ -29,7 +43,8 @@ module Printer_extension(X: Printer.PrinterClass) = struct
let loc, _ = Cil_datatype.Global.loc g in let loc, _ = Cil_datatype.Global.loc g in
let file = loc.Filepath.pos_path in let file = loc.Filepath.pos_path in
if file = Datatype.Filepath.dummy || if file = Datatype.Filepath.dummy ||
List.exists (fun s -> s = file) (Kernel.Files.get ()) List.exists (fun s -> s = file) (Kernel.Files.get ()) ||
is_generated g
then super#global fmt g then super#global fmt g
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment