summaryrefslogtreecommitdiff
path: root/cparser/Transform.mli
diff options
context:
space:
mode:
Diffstat (limited to 'cparser/Transform.mli')
-rw-r--r--cparser/Transform.mli20
1 files changed, 18 insertions, 2 deletions
diff --git a/cparser/Transform.mli b/cparser/Transform.mli
index 8f2c5f8..8215997 100644
--- a/cparser/Transform.mli
+++ b/cparser/Transform.mli
@@ -13,13 +13,29 @@
(* *)
(* *********************************************************************)
-(* Generic program transformation *)
-
+(** Creation of fresh temporary variables. *)
val reset_temps : unit -> unit
val new_temp_var : ?name:string -> C.typ -> C.ident
val new_temp : ?name:string -> C.typ -> C.exp
val get_temps : unit -> C.decl list
+(** Avoiding repeated evaluation of a l-value *)
+
+val bind_lvalue: Env.t -> C.exp -> (C.exp -> C.exp) -> C.exp
+
+(** Generic transformation of a statement *)
+
+type context = Val | Effects
+
+val stmt : (C.location -> Env.t -> context -> C.exp -> C.exp) ->
+ Env.t -> C.stmt -> C.stmt
+
+(** Generic transformation of a function definition *)
+
+val fundef : (Env.t -> C.stmt -> C.stmt) -> Env.t -> C.fundef -> C.fundef
+
+(** Generic transformation of a program *)
+
val program :
?decl:(Env.t -> C.decl -> C.decl) ->
?fundef:(Env.t -> C.fundef -> C.fundef) ->