Changeset 818 for Deliverables/D2.2/8051/src/clight/clightFold.ml
 Timestamp:
 May 19, 2011, 4:03:04 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Deliverables/D2.2/8051/src/clight/clightFold.ml
r624 r818 75 75  _ > assert false (* wrong arguments, do not use on these values *) 76 76 77 let expr_fill_exprs (Clight.Expr (ed, t)) exprs = 78 let (sub_ctypes, _) = expr_descr_subs ed in 79 let ed = expr_descr_fill_subs ed sub_ctypes exprs in 80 Clight.Expr (ed, t) 81 77 82 let rec expr f_ctype f_expr f_expr_descr e = 78 83 let (sub_ctypes, sub_expr_descrs) = expr_subs e in … … 88 93 let sub_ctypes_res = List.map (ctype f_ctype) sub_ctypes in 89 94 f_expr_descr e sub_ctypes_res sub_exprs_res 95 96 97 let expr_subs2 e = 98 let (_, expr_descrs) = expr_subs e in 99 let l = List.map expr_descr_subs expr_descrs in 100 List.flatten (List.map snd l) 101 102 let rec expr2 f e = f e (List.map (expr2 f) (expr_subs2 e)) 90 103 91 104 … … 108 121  Clight.Sswitch (e, lbl_stmts) > ([e], labeled_statements_subs lbl_stmts) 109 122  Clight.Slabel (_, stmt)  Clight.Scost (_, stmt) > ([], [stmt]) 123 124 let statement_sub_exprs stmt = fst (statement_subs stmt) 110 125 111 126 let rec labeled_statements_fill_subs lbl_stmts sub_statements = … … 149 164 List.map (statement f_ctype f_expr f_expr_descr f_statement) sub_stmts in 150 165 f_statement stmt sub_exprs_res sub_stmts_res 166 167 let rec statement2 f_expr f_statement stmt = 168 let (sub_exprs, sub_stmts) = statement_subs stmt in 169 let sub_exprs_res = List.map (expr2 f_expr) sub_exprs in 170 let sub_stmts_res = List.map (statement2 f_expr f_statement) sub_stmts in 171 f_statement stmt sub_exprs_res sub_stmts_res
Note: See TracChangeset
for help on using the changeset viewer.