Changeset 1392 for Deliverables/D2.2
- Timestamp:
- Oct 17, 2011, 2:08:27 PM (9 years ago)
- Location:
- Deliverables/D2.2/8051-indexed-labels-branch/src
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Deliverables/D2.2/8051-indexed-labels-branch/src/LIN/LINPrinter.ml
r1349 r1392 3 3 4 4 5 let n_spaces n = String.make n ' ' 5 let n_spaces ?stmt n = 6 let n = match stmt with 7 | Some (LIN.St_label _) | Some (LIN.St_cost _) -> n - 2 8 | _ -> n in 9 String.make n ' ' 6 10 7 11 … … 66 70 let print_code n c = 67 71 let f s stmt = 68 Printf.sprintf "%s\n%s%s" s (n_spaces n) (print_statement stmt) in72 Printf.sprintf "%s\n%s%s" s (n_spaces ~stmt:stmt n) (print_statement stmt) in 69 73 List.fold_left f "" c 70 74 -
Deliverables/D2.2/8051-indexed-labels-branch/src/clight/clightFold.ml
r1305 r1392 170 170 let sub_stmts_res = List.map (statement2 f_expr f_statement) sub_stmts in 171 171 f_statement stmt sub_exprs_res sub_stmts_res 172 -
Deliverables/D2.2/8051-indexed-labels-branch/src/clight/clightPrinter.ml
r1328 r1392 248 248 print_stmt s2 249 249 | Swhile(i, e, s) -> 250 fprintf p "@[<v 2>%a@ while (%a) {@ %a@;<0 -2>}@]"250 fprintf p "@[<v 0>%a@[<v 2>while (%a) {@ %a@;<0 -2>}@]@]" 251 251 print_loop_depth i 252 252 print_expr e 253 253 print_stmt s 254 254 | Sdowhile(i, e, s) -> 255 fprintf p "@[<v 2>%a@ do {@ %a@;<0 -2>} while(%a);@]"255 fprintf p "@[<v 0>%a@[<v 2>do {@ %a@;<0 -2>} while(%a);@]@]" 256 256 print_loop_depth i 257 257 print_stmt s -
Deliverables/D2.2/8051-indexed-labels-branch/src/clight/clightToCminor.ml
r1334 r1392 492 492 let ind_inc i stmt = match i with 493 493 | None -> stmt 494 | Some x -> Cminor.St_ind_inc(stmt, x) 495 496 let f_stmt fresh var_locs stmt sub_exprs_res sub_stmts_res = 497 let (tmps, sub_stmts_res) = List.split sub_stmts_res in 498 let tmps = List.flatten tmps in 499 500 let (added_tmps, stmt) = match stmt, sub_exprs_res, sub_stmts_res with 501 502 | Clight.Sskip, _, _ -> ([], Cminor.St_skip) 503 504 | Clight.Sassign (e1, _), _ :: e2 :: _, _ -> 494 | Some x -> Cminor.St_ind_inc(x, stmt) 495 496 let trans_for = 497 let f_expr e _ = e in 498 let f_stmt stmt expr_res stmt_res = match expr_res, stmt_res, stmt with 499 | e::_, s1::s2::s3::_, Clight.Sfor(i,_,_,_,_) -> 500 Clight.Ssequence(s1,Clight.Swhile(i,e, 501 Clight.Ssequence(s3, s2))) 502 | exprs, sub_sts, stm -> ClightFold.statement_fill_subs stm exprs sub_sts in 503 ClightFold.statement2 f_expr f_stmt 504 505 let rec translate_stmt fresh var_locs cnt_lbl br_lbl = function 506 507 | Clight.Sskip -> ([], Cminor.St_skip) 508 509 | Clight.Sassign (e1, e2) -> 510 let e2 = translate_expr var_locs e2 in 505 511 ([], assign var_locs e1 e2) 506 512 507 | Clight.Scall (None, _, _), f :: args, _ -> 513 | Clight.Scall (None, f, args) -> 514 let f = translate_expr var_locs f in 515 let args = List.map (translate_expr var_locs) args in 508 516 ([], Cminor.St_call (None, f, args, call_sig AST.Type_void args)) 509 517 510 | Clight.Scall (Some e, _, _), _ :: f :: args, _ -> 518 | Clight.Scall (Some e, f, args) -> 519 let f = translate_expr var_locs f in 520 let args = List.map (translate_expr var_locs) args in 511 521 let t = sig_type_of_ctype (clight_type_of e) in 512 522 let tmp = fresh () in … … 517 527 ([(tmp, t)], Cminor.St_seq (stmt_call, stmt_assign)) 518 528 519 | Clight.Swhile (i,_,_), e :: _, stmt :: _ -> 529 | Clight.Swhile (i,e,stmt) -> 530 let loop_lbl = fresh () in 531 let llbl_opt = Some loop_lbl in 532 let exit_lbl = fresh () in 533 let elbl_opt = Some exit_lbl in 534 let (tmps, stmt) = translate_stmt fresh var_locs llbl_opt elbl_opt stmt in 535 let e = translate_expr var_locs e in 536 let jmp lbl = Cminor.St_goto lbl in 520 537 let econd = 521 538 Cminor.Expr (Cminor.Op1 (AST.Op_notbool, e), cminor_type_of e) in 522 539 let scond = 523 Cminor.St_ifthenelse (econd, Cminor.St_exit 0, Cminor.St_skip) in 524 let loop_body = Cminor.St_seq (scond, ind_inc i (Cminor.St_block stmt)) in 525 let loop = ind_0 i (Cminor.St_loop loop_body) in 526 ([], Cminor.St_block loop) 540 Cminor.St_ifthenelse (econd, jmp exit_lbl, Cminor.St_skip) in 541 let loop = 542 Cminor.St_seq(scond,Cminor.St_seq (stmt, ind_inc i (jmp loop_lbl))) in 543 let loop = ind_0 i (Cminor.St_label(loop_lbl,loop)) in 544 (tmps, Cminor.St_seq (loop, Cminor.St_label(exit_lbl,Cminor.St_skip))) 527 545 528 | Clight.Sdowhile (i,_,_), e :: _, stmt :: _ -> 529 let econd = 530 Cminor.Expr (Cminor.Op1 (AST.Op_notbool, e), cminor_type_of e) in 546 | Clight.Sdowhile (i,e,stmt) -> 547 let loop_lbl = fresh () in 548 let llbl_opt = Some loop_lbl in 549 let exit_lbl = fresh () in 550 let elbl_opt = Some exit_lbl in 551 let (tmps, stmt) = translate_stmt fresh var_locs llbl_opt elbl_opt stmt in 552 let e = translate_expr var_locs e in 553 let jmp lbl = Cminor.St_goto lbl in 531 554 let scond = 532 Cminor.St_ifthenelse (econd, Cminor.St_exit 0, Cminor.St_skip) in 533 let loop_body = ind_inc i (Cminor.St_seq (Cminor.St_block stmt, scond)) in 534 let loop = ind_0 i (Cminor.St_loop loop_body) in 535 ([], Cminor.St_block loop) 536 537 | Clight.Sfor (i,_,_,_,_), e :: _, stmt1 :: stmt2 :: stmt3 :: _ -> 538 let econd = 539 Cminor.Expr (Cminor.Op1 (AST.Op_notbool, e), cminor_type_of e) in 540 let scond = 541 Cminor.St_ifthenelse (econd, Cminor.St_exit 0, Cminor.St_skip) in 542 let body = Cminor.St_seq (ind_inc i (Cminor.St_block stmt3), stmt2) in 543 let body = Cminor.St_seq (scond, body) in 544 let block = Cminor.St_block (ind_0 i (Cminor.St_loop body)) in 545 ([], Cminor.St_seq (stmt1, block)) 546 547 | Clight.Sifthenelse _, e :: _, stmt1 :: stmt2 :: _ -> 548 ([], Cminor.St_ifthenelse (e, stmt1, stmt2)) 549 550 | Clight.Ssequence _, _, stmt1 :: stmt2 :: _ -> 551 ([], Cminor.St_seq (stmt1, stmt2)) 552 553 | Clight.Sbreak, _, _ -> ([], Cminor.St_exit 1) 554 555 | Clight.Scontinue, _, _ -> ([], Cminor.St_exit 0) 556 557 | Clight.Sswitch _, _, _ -> 555 Cminor.St_ifthenelse (e, ind_inc i (jmp loop_lbl), Cminor.St_skip) in 556 let loop = 557 Cminor.St_seq (stmt, scond) in 558 let loop = ind_0 i (Cminor.St_label(loop_lbl,loop)) in 559 (tmps, Cminor.St_seq (loop, Cminor.St_label(exit_lbl,Cminor.St_skip))) 560 561 | Clight.Sfor _ -> assert false (* transformed *) 562 563 | Clight.Sifthenelse (e, stmt1, stmt2) -> 564 let (tmps1, stmt1) = translate_stmt fresh var_locs cnt_lbl br_lbl stmt1 in 565 let (tmps2, stmt2) = translate_stmt fresh var_locs cnt_lbl br_lbl stmt2 in 566 let e = translate_expr var_locs e in 567 (tmps1 @ tmps2, Cminor.St_ifthenelse (e, stmt1, stmt2)) 568 569 | Clight.Ssequence(stmt1,stmt2) -> 570 let (tmps1, stmt1) = translate_stmt fresh var_locs cnt_lbl br_lbl stmt1 in 571 let (tmps2, stmt2) = translate_stmt fresh var_locs cnt_lbl br_lbl stmt2 in 572 (tmps1 @ tmps2, Cminor.St_seq (stmt1, stmt2)) 573 574 | Clight.Sbreak -> 575 let br_lbl = match br_lbl with 576 | Some x -> x 577 | None -> invalid_arg("break without enclosing scope") in 578 ([], Cminor.St_goto br_lbl) 579 580 | Clight.Scontinue -> 581 let cnt_lbl = match cnt_lbl with 582 | Some x -> x 583 | None -> invalid_arg("continue without enclosing scope") in 584 ([], Cminor.St_goto cnt_lbl) 585 | Clight.Sswitch _ -> 558 586 (* Should not appear because of switch transformation performed 559 587 beforehand. *) 560 588 assert false 561 589 562 | Clight.Sreturn None, _, _ -> ([], Cminor.St_return None) 563 564 | Clight.Sreturn (Some _), e :: _, _ -> ([], Cminor.St_return (Some e)) 565 566 | Clight.Slabel (lbl, _), _, stmt :: _ -> ([], Cminor.St_label (lbl, stmt)) 567 568 | Clight.Sgoto lbl, _, _ -> ([], Cminor.St_goto lbl) 569 570 | Clight.Scost (lbl, _), _, stmt :: _ -> ([], Cminor.St_cost (lbl, stmt)) 571 572 | _ -> assert false (* type error *) in 573 574 (tmps @ added_tmps, stmt) 575 576 let translate_statement fresh var_locs = 577 ClightFold.statement2 (f_expr var_locs) (f_stmt fresh var_locs) 590 | Clight.Sreturn None -> ([], Cminor.St_return None) 591 592 | Clight.Sreturn (Some e) -> 593 let e = translate_expr var_locs e in 594 ([], Cminor.St_return (Some e)) 595 596 | Clight.Slabel (lbl, stmt) -> 597 let (tmps, stmt) = translate_stmt fresh var_locs cnt_lbl br_lbl stmt in 598 (tmps, Cminor.St_label (lbl, stmt)) 599 600 | Clight.Sgoto lbl -> ([], Cminor.St_goto lbl) 601 602 | Clight.Scost (lbl, stmt) -> 603 let (tmps, stmt) = translate_stmt fresh var_locs cnt_lbl br_lbl stmt in 604 (tmps, Cminor.St_cost (lbl, stmt)) 605 606 | _ -> assert false (* type error *) 578 607 579 608 … … 596 625 let params = 597 626 List.map (fun (x, t) -> (x, sig_type_of_ctype t)) cfun.Clight.fn_params in 598 let (tmps, body) = translate_statement fresh var_locs cfun.Clight.fn_body in 627 let body = cfun.Clight.fn_body in 628 let (tmps, body) = translate_stmt fresh var_locs None None body in 599 629 let body = add_stack_parameters_initialization var_locs body in 600 630 { Cminor.f_return = type_return_of_ctype cfun.Clight.fn_return ; -
Deliverables/D2.2/8051-indexed-labels-branch/src/cminor/cminor.mli
r1334 r1392 34 34 | St_seq of statement * statement 35 35 | St_ifthenelse of expression * statement * statement 36 | St_loop of statement36 (* | St_loop of statement 37 37 | St_block of statement 38 | St_exit of int 38 | St_exit of int *) 39 39 40 40 (* Switch. Parameters are the expression whose value is switch, a 41 41 table of cases and their corresponding number of blocks to exit, 42 42 and the number of block to exit in the default case. *) 43 | St_switch of expression * (int* int) list * int43 | St_switch of expression * (int*Label.t) list * Label.t 44 44 45 45 | St_return of expression option 46 46 | St_label of AST.ident * statement 47 | St_goto of string47 | St_goto of Label.t 48 48 | St_cost of CostLabel.t * statement 49 49 | St_ind_0 of CostLabel.index * statement 50 | St_ind_inc of statement * CostLabel.index50 | St_ind_inc of CostLabel.index * statement 51 51 52 52 -
Deliverables/D2.2/8051-indexed-labels-branch/src/cminor/cminorFold.ml
r1334 r1392 31 31 32 32 let statement_subs = function 33 | Cminor.St_skip | Cminor.St_exit _ |Cminor.St_return None33 | Cminor.St_skip | (*Cminor.St_exit _ |*) Cminor.St_return None 34 34 | Cminor.St_goto _ -> ([], []) 35 35 | Cminor.St_assign (_, e) | Cminor.St_switch (e, _, _) … … 43 43 | Cminor.St_ifthenelse (e, stmt1, stmt2) -> 44 44 ([e], [stmt1 ; stmt2]) 45 | Cminor.St_loop stmt | Cminor.St_block stmt45 (*| Cminor.St_loop stmt | Cminor.St_block stmt *) 46 46 | Cminor.St_label (_, stmt) | Cminor.St_cost (_, stmt) 47 | Cminor.St_ind_0 (_, stmt) | Cminor.St_ind_inc ( stmt, _) ->47 | Cminor.St_ind_0 (_, stmt) | Cminor.St_ind_inc (_, stmt) -> 48 48 ([], [stmt]) 49 49 50 50 let statement_fill_subs stmt sub_es sub_stmts = 51 51 match stmt, sub_es, sub_stmts with 52 | ( Cminor.St_skip | Cminor.St_exit _ |Cminor.St_return None52 | ( Cminor.St_skip | (*Cminor.St_exit _ |*) Cminor.St_return None 53 53 | Cminor.St_goto _), _, _ -> stmt 54 54 | Cminor.St_assign (x, _), e :: _, _ -> … … 68 68 | Cminor.St_ifthenelse _, e :: _, stmt1 :: stmt2 :: _ -> 69 69 Cminor.St_ifthenelse (e, stmt1, stmt2) 70 | Cminor.St_loop _, _, stmt :: _ ->70 (* | Cminor.St_loop _, _, stmt :: _ -> 71 71 Cminor.St_loop stmt 72 72 | Cminor.St_block _, _, stmt :: _ -> 73 Cminor.St_block stmt 73 Cminor.St_block stmt *) 74 74 | Cminor.St_label (lbl, _), _, stmt :: _ -> 75 75 Cminor.St_label (lbl, stmt) 76 76 | Cminor.St_cost (lbl, _), _, stmt :: _ -> 77 77 Cminor.St_cost (lbl, stmt) 78 | Cminor.St_ind_0 (i, _), _, stmt :: _ -> 79 Cminor.St_ind_0 (i, stmt) 80 | Cminor.St_ind_inc (i, _), _, stmt :: _ -> 81 Cminor.St_ind_inc (i, stmt) 78 82 | _ -> assert false (* do not use on these arguments *) 79 83 -
Deliverables/D2.2/8051-indexed-labels-branch/src/cminor/cminorInterpret.ml
r1357 r1392 28 28 Ct_stop 29 29 | Ct_cont of statement*continuation 30 | Ct_ind_inc of CostLabel.index*continuation 31 | Ct_endblock of continuation 30 (* | Ct_endblock of continuation *) 32 31 | Ct_returnto of 33 32 ident option*internal_function*Val.address*local_env*continuation … … 62 61 | St_seq _ -> "sequence" 63 62 | St_ifthenelse (e, _, _) -> "if (" ^ (string_of_expr e) ^ ")" 64 | St_loop _ -> "loop"63 (* | St_loop _ -> "loop" 65 64 | St_block _ -> "block" 66 | St_exit n -> "exit " ^ (string_of_int n) 65 | St_exit n -> "exit " ^ (string_of_int n) *) 67 66 | St_switch (e, _, _) -> "switch (" ^ (string_of_expr e) ^ ")" 68 67 | St_return None -> "return" … … 74 73 "cost " ^ lbl 75 74 | St_ind_0 (i, _) -> "reset " ^ string_of_int i ^ " to 0" 76 | St_ind_inc ( _, i) -> "post-increment " ^ string_of_int i75 | St_ind_inc (i, _) -> "post-increment " ^ string_of_int i 77 76 78 77 let print_state = function … … 233 232 234 233 let rec callcont = function 235 | Ct_cont(_,k) | Ct_endblock k | Ct_ind_inc(_,k) -> callcont k234 | Ct_cont(_,k) (*| Ct_endblock k *) -> callcont k 236 235 | (Ct_stop | Ct_returnto _) as k -> k 237 236 … … 245 244 | St_seq(s1,s2) -> 246 245 (match fdlbl (Ct_cont(s2,k)) s1 with 247 248 246 None -> fdlbl k s2 247 | Some(v) -> Some(v) 249 248 ) 250 249 | St_ifthenelse(_,s1,s2) -> 251 250 (match fdlbl k s1 with 252 253 251 None -> fdlbl k s2 252 | Some(v) -> Some(v) 254 253 ) 255 | St_loop(s) -> fdlbl (Ct_cont(St_loop(s),k)) s254 (* | St_loop(s) -> fdlbl (Ct_cont(St_loop(s),k)) s 256 255 | St_block(s) -> fdlbl (Ct_endblock(k)) s 257 | St_exit(_) -> None 256 | St_exit(_) -> None *) 258 257 | St_switch(_,_,_) -> None 259 258 | St_return(_) -> None 260 | St_label(l,s) -> if l=lbl then Some((s,k)) else None259 | St_label(l,s) when l = lbl -> Some((s,k)) 261 260 | St_goto(_) -> None 262 | St_cost (_,s) | St_ind_0(_,s) | St_ind_inc(s,_) -> fdlbl k s 261 | St_cost(_,s) | St_label(_,s) 262 | St_ind_0(_,s) | St_ind_inc(_,s) -> fdlbl k s 263 263 in match fdlbl k st with 264 264 None -> assert false (*Wrong label*) … … 274 274 let eval_stmt f k sigma e m i s = match s, k with 275 275 | St_skip,Ct_cont(s,k) -> (State_regular(f, s, k, sigma, e, m, i),[]) 276 | St_skip,Ct_endblock(k) -> (State_regular(f, St_skip, k, sigma, e, m, i),[])276 (* | St_skip,Ct_endblock(k) -> (State_regular(f, St_skip, k, sigma, e, m, i),[]) *) 277 277 | St_skip, (Ct_returnto _ as k) -> 278 278 (State_return (Val.undef,k,Mem.free m sigma,i),[]) 279 | St_skip,Ct_ind_inc(ind,k) ->280 CostLabel.continue_loop i ind;281 (State_regular(f, s, k, sigma, e, m, i),[])282 279 | St_skip,Ct_stop -> 283 280 (State_return (Val.undef,Ct_stop,Mem.free m sigma,i),[]) … … 304 301 else error "undefined conditional value." in 305 302 (State_regular(f,next_stmt,k,sigma,e,m,i),l) 306 | St_loop(s),_ -> (State_regular(f,s,Ct_cont((St_loop s),k),sigma,e,m,i),[])303 (* | St_loop(s),_ -> (State_regular(f,s,Ct_cont((St_loop s),k),sigma,e,m,i),[]) 307 304 | St_block(s),_ -> (State_regular(f,s,(Ct_endblock k),sigma,e,m,i),[]) 308 305 | St_exit(n),Ct_cont(s,k) -> (State_regular(f,(St_exit n),k,sigma,e,m,i),[]) 309 306 | St_exit(0),Ct_endblock(k) -> (State_regular(f,St_skip,k,sigma,e,m,i),[]) 310 307 | St_exit(n),Ct_endblock(k) -> 311 (State_regular(f,(St_exit (n-1)),k,sigma,e,m,i),[]) 308 (State_regular(f,(St_exit (n-1)),k,sigma,e,m,i),[]) *) 312 309 | St_label(_,s),_ -> (State_regular(f,s,k,sigma,e,m,i),[]) 313 | St_goto(lbl),_ -> 310 | St_goto(lbl),_ -> 314 311 let (s2,k2) = findlabel lbl f.f_body (callcont k) in 315 312 (State_regular(f,s2,k2,sigma,e,m,i),[]) … … 318 315 if Val.is_int v then 319 316 try 320 let v = Val.to_int v in 321 let nb_exit = 322 if List.mem_assoc v lst then List.assoc v lst 323 else def in 324 (State_regular(f, St_exit nb_exit,k, sigma, e, m, i),l) 317 let v = Val.to_int v in 318 let lbl = 319 try 320 List.assoc v lst 321 with 322 | Not_found -> def in 323 let (s',k') = findlabel lbl f.f_body (callcont k) in 324 (State_regular(f, s', k', sigma, e, m, i),l) 325 325 with _ -> error "int value too big." 326 326 else error "undefined switch value." … … 337 337 CostLabel.enter_loop i ind; 338 338 (State_regular(f,s,k,sigma,e,m,i), []) 339 | St_ind_inc(s,ind),_ -> 340 (State_regular(f,s,Ct_ind_inc(ind,k),sigma,e,m,i), []) 341 | _ -> error "state malformation." 339 | St_ind_inc(ind,s),_ -> 340 CostLabel.continue_loop i ind; 341 (State_regular(f,s,k,sigma,e,m,i), []) 342 (* | _ -> error "state malformation." *) 342 343 343 344 -
Deliverables/D2.2/8051-indexed-labels-branch/src/cminor/cminorPrinter.ml
r1334 r1392 137 137 let print_table n = 138 138 let f s (case, exit) = 139 Printf.sprintf "%s%scase %d: exit %d;\n" s (n_spaces n) case exit139 Printf.sprintf "%s%scase %d: goto %s;\n" s (n_spaces n) case exit 140 140 in 141 141 List.fold_left f "" … … 187 187 (print_body (n+2) s2) 188 188 (n_spaces n) 189 | Cminor.St_loop s ->189 (* | Cminor.St_loop s -> 190 190 Printf.sprintf "%sloop {\n%s%s}\n" 191 191 (n_spaces n) … … 198 198 (n_spaces n) 199 199 | Cminor.St_exit i -> 200 Printf.sprintf "%sexit %d;\n" (n_spaces n) i 200 Printf.sprintf "%sexit %d;\n" (n_spaces n) i *) 201 201 | Cminor.St_switch (e, tbl, dflt) -> 202 Printf.sprintf "%sswitch (%s) {\n%s%sdefault: exit %d;\n%s}\n"202 Printf.sprintf "%sswitch (%s) {\n%s%sdefault: goto %s;\n%s}\n" 203 203 (n_spaces n) 204 204 (print_expression e) … … 219 219 | Cminor.St_ind_0 (i, s) -> 220 220 Printf.sprintf "%sindex %d:\n%s" (n_spaces n) i (print_body n s) 221 | Cminor.St_ind_inc ( s, i) ->222 Printf.sprintf "%s %sincrement %d;\n" (print_body n s) (n_spaces n) i221 | Cminor.St_ind_inc (i,s) -> 222 Printf.sprintf "%sincrement %d:\n%s\n" (n_spaces n) i (print_body n s) 223 223 224 224 let print_internal f_name f_def = … … 257 257 | Cminor.St_seq(_,_) -> "seq" 258 258 | Cminor.St_ifthenelse(_,_,_) -> "ifthenelse" 259 | Cminor.St_loop(_) -> "loop"259 (* | Cminor.St_loop(_) -> "loop" 260 260 | Cminor.St_block(_) -> "block" 261 | Cminor.St_exit(_) -> "exit" 261 | Cminor.St_exit(_) -> "exit" *) 262 262 | Cminor.St_switch(_,_,_) -> "switch" 263 263 | Cminor.St_return(_) -> "return" -
Deliverables/D2.2/8051-indexed-labels-branch/src/cminor/cminorToRTLabs.ml
r1340 r1392 333 333 translate_branch rtlabs_fun lenv e lbl_true lbl_false 334 334 335 | Cminor.St_loop s ->335 (* | Cminor.St_loop s -> 336 336 let loop_start = fresh_label rtlabs_fun in 337 337 let rtlabs_fun = change_entry rtlabs_fun loop_start in … … 345 345 346 346 | Cminor.St_exit n -> 347 change_entry rtlabs_fun (List.nth exits n) 347 change_entry rtlabs_fun (List.nth exits n) *) 348 348 349 349 | Cminor.St_return eopt -> … … 376 376 generate rtlabs_fun (RTLabs.St_ind_0 (i, old_entry)) 377 377 378 | Cminor.St_ind_inc ( s, i) ->379 let old_entry = rtlabs_fun.RTLabs.f_entryin380 let rtlabs_fun = generate rtlabs_fun (RTLabs.St_ind_inc(i, old_entry))in381 translate_stmt rtlabs_fun lenv exits s378 | Cminor.St_ind_inc (i, s) -> 379 let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s in 380 let old_entry = rtlabs_fun.RTLabs.f_entry in 381 generate rtlabs_fun (RTLabs.St_ind_inc (i, old_entry)) 382 382 383 383 | Cminor.St_goto lbl ->
Note: See TracChangeset
for help on using the changeset viewer.