Ignore:
Timestamp:
Oct 10, 2011, 2:17:02 PM (8 years ago)
Author:
tranquil
Message:

work on Cminor completed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051-indexed-labels-branch/src/clight/clightInterpret.ml

    r1328 r1334  
    487487
    488488let eval_stmt f k e m s c =
    489         let enter_loop = CostLabel.enter_loop in
    490         let continue_loop = CostLabel.continue_loop in
    491489        match s, k with
    492490  | Sskip, Kseq(s,k) -> (State(f,s,k,e,m,c),[])
     
    494492  | Sskip, Kdowhile(i,a,s,k') | Scontinue, Kdowhile (i,a,s,k') ->
    495493                (* possibly continuing a loop *)
    496                 continue_loop i c; (* if loop is not continued, this change will have no
    497                                       effect in the following. Can be made stricter *)
     494                CostLabel.continue_loop i c; (* if loop is not continued, this change
     495                                                will have no effect in the following. *)
    498496    let ((v1,_),l1) = eval_expr e m c a in
    499497    let a_false = (State(f,Sskip,k',e,m,c),l1) in
     
    501499    condition v1 a_true a_false
    502500  | Sskip, Kfor3(i,a2,a3,s,k) | Scontinue, Kfor3(i,a2,a3,s,k) ->
    503     continue_loop i c;
     501    CostLabel.continue_loop i c;
    504502    let ((v1,_),l1) = eval_expr e m c a2 in
    505503    let a_false = (State(f,Sskip,k,e,m,c),l1) in
     
    533531    condition v1 a_true a_false
    534532  | Swhile(i,a,s), _ ->
    535                 enter_loop i c;
     533                CostLabel.enter_loop i c;
    536534    let ((v1,_),l1) = eval_expr e m c a in
    537535    let a_false = (State(f,Sskip,k,e,m,c),l1) in
     
    539537    condition v1 a_true a_false
    540538  | Sdowhile(i,a,s), _ ->
    541                 enter_loop i c;
     539                CostLabel.enter_loop i c;
    542540                (State(f,s,Kdowhile(i,a,s,k),e,m,c),[])
    543541  | Sfor(i,Sskip,a2,a3,s), _ ->
    544                 enter_loop i c;
     542                CostLabel.enter_loop i c;
    545543    let ((v1,_),l1) = eval_expr e m c a2 in
    546544    let a_false = (State(f,Sskip,k,e,m,c),l1) in
Note: See TracChangeset for help on using the changeset viewer.