1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
*** ../cil/src/ext/cfg.ml 2006-05-21 06:14:15.000000000 +0200
--- ../cil_patch/src/ext/cfg.ml 2006-06-20 17:42:04.000000000 +0200
***************
*** 1,3 ****
--- 1,5 ----
+ (* MODIF: Loop constructor replaced by 3 constructors: While, DoWhile, For. *)
+
(*
*
* Copyright (c) 2001-2003,
***************
*** 156,162 ****
--- 158,169 ----
then
addOptionSucc next;
cfgBlock blk next next cont
+ (*
| Loop(blk,_,_,_) ->
+ *)
+ | While(_,blk,_)
+ | DoWhile(_,blk,_)
+ | For(_,_,_,blk,_) ->
addBlockSucc blk;
cfgBlock blk (Some s) next (Some s)
(* Since all loops have terminating condition true, we don't put
***************
*** 184,190 ****
--- 191,202 ----
| Block b -> fasBlock todo b
| If (_, tb, fb, _) -> (fasBlock todo tb; fasBlock todo fb)
| Switch (_, b, _, _) -> fasBlock todo b
+ (*
| Loop (b, _, _, _) -> fasBlock todo b
+ *)
+ | While (_, b, _) -> fasBlock todo b
+ | DoWhile (_, b, _) -> fasBlock todo b
+ | For (_, _, _, b, _) -> fasBlock todo b
| (Return _ | Break _ | Continue _ | Goto _ | Instr _) -> ()
| TryExcept _ | TryFinally _ -> E.s (E.unimp "try/except/finally")
end
***************
*** 201,207 ****
--- 213,224 ----
begin
match s.skind with
| If (e, _, _, _) -> "if" (*sprint ~width:999 (dprintf "if %a" d_exp e)*)
+ (*
| Loop _ -> "loop"
+ *)
+ | While _ -> "while"
+ | DoWhile _ -> "dowhile"
+ | For _ -> "for"
| Break _ -> "break"
| Continue _ -> "continue"
| Goto _ -> "goto"
|