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