module Visitor_behavior: sig
.. end
Operations on visitor behaviors.
Since 20.0-Calcium.
type
t
How the visitor should behave in front of mutable fields: in
place modification or copy of the structure. This type is abstract.
Use one of the two values below in your classes.
Consult the Plugin Development Guide for additional details.
val inplace : unit -> t
In-place modification. Behavior of the original cil visitor.
Consult the Plugin Development Guide for additional details.
val copy : Project.t -> t
Makes fresh copies of the mutable structures.
- preserves sharing for varinfo.
- makes fresh copy of varinfo only for declarations. Variables that are
only used in the visited AST are thus still shared with the original
AST. This allows for instance to copy a function with its
formals and local variables, and to keep the references to other
globals in the function's body.
Consult the Plugin Development Guide for additional details.
val refresh : Project.t -> t
Makes fresh copies of the mutable structures and provides fresh id
for the structures that have ids. Note that as for copy_visit
, only
varinfo that are declared in the scope of the visit will be copied and
provided with a new id.
val is_fresh : t -> bool
true iff the behavior provides fresh id for copied structs with id.
Always false
for an inplace visitor.
val is_copy : t -> bool
true iff the behavior is a copy behavior.
val get_project : t -> Project.t option
module Reset: sig
.. end
Reset operations on behaviors, allows to reset the tables associated to a given
kind of AST elements.
module type Get = sig
.. end
module Get: Get
Get operations on behaviors, allows to get the representative of an
AST element in the current state of the visitor.
module Get_orig: Get
Get operations on behaviors, allows to get the original representative of
an element of the new AST in the curent state of the visitor.
module Memo: Get
Memo operations on behaviors, allows to get a binding in the new project
for the given AST element, creating one if it does not already exists.
module type Set = sig
.. end
module Set: Set
Set operations on behaviors, allows to change the representative of a
given AST element in the current state of the visitor.
module Set_orig: Set
Set operations on behaviors related to original representatives, allows to
change the reference of an element of the new AST in the current state
of the visitor.
module type Unset = sig
.. end
module Unset: Unset
Operations to remove the entry associated to a given AST element in the
current state of the visitor.
module Unset_orig: Unset
Operations to remove the entry associated to a given element of the new
AST in the current state of the visitor.
module Iter: sig
.. end
Iter operations on the table of a given type of AST elements.
module Fold: sig
.. end
Fold operations on table of a given type of AST elements.