Skip to content
Snippets Groups Projects
Commit 2a2e67b1 authored by Yaelle Vincont's avatar Yaelle Vincont Committed by Julien Signoles
Browse files

[obfuscator] obfuscate logic types and constructors

parent 208929ae
No related branches found
No related tags found
No related merge requests found
......@@ -1487,7 +1487,7 @@ and logic_body =
(** Description of a logic type.
@plugin development guide *)
and logic_type_info = {
lt_name: string;
mutable lt_name: string;
lt_params : string list; (** type parameters*)
mutable lt_def: logic_type_def option;
(** definition of the type. None for abstract types. *)
......@@ -1528,7 +1528,7 @@ and logic_var = {
(** Description of a constructor of a logic sum-type.
@plugin development guide *)
and logic_ctor_info =
{ ctor_name: string; (** name of the constructor. *)
{ mutable ctor_name: string; (** name of the constructor. *)
ctor_type: logic_type_info; (** type to which the constructor belongs. *)
ctor_params: logic_type list
(** types of the parameters of the constructor. *)
......
......@@ -161,11 +161,11 @@ class visitor = object
Cil.DoChildren
method! vlogic_type_info_decl lti =
warn "logic type" lti.lt_name;
lti.lt_name <- Dictionary.fresh Obfuscator_kind.Logic_type lti.lt_name ;
Cil.DoChildren
method! vlogic_ctor_info_decl lci =
warn "logic constructor" lci.ctor_name;
lci.ctor_name <- Dictionary.fresh Obfuscator_kind.Logic_constructor lci.ctor_name ;
Cil.DoChildren
method! vattr = function
......
......@@ -33,7 +33,9 @@ type k =
| Logic_var
| Predicate
| Type
| Logic_type
| Logic_constructor
let name_of_kind = function
| Behavior -> "behavior"
| Enum -> "enum"
......@@ -47,6 +49,8 @@ let name_of_kind = function
| Logic_var -> "logic variable"
| Predicate -> "predicate"
| Type -> "type"
| Logic_type -> "logic type"
| Logic_constructor -> "logic constructor"
let prefix = function
| Behavior -> "B"
......@@ -61,6 +65,8 @@ let prefix = function
| Logic_var -> "LV"
| Predicate -> "P"
| Type -> "T"
| Logic_type -> "LT"
| Logic_constructor -> "LC"
include Datatype.Make_with_collections
(struct
......
......@@ -33,6 +33,8 @@ type k =
| Logic_var
| Predicate
| Type
| Logic_type
| Logic_constructor
include Datatype.S_with_collections with type t = k
val prefix: t -> string
......
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