Skip to content

Commit b86dea8

Browse files
Revert to the original definition of dummyStmt
1 parent cdd87ad commit b86dea8

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

src/cil.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,8 +1367,7 @@ let mkBlock (slst: stmt list) : block =
13671367
let mkEmptyStmt () = mkStmt (Instr [])
13681368
let mkStmtOneInstr (i: instr) = mkStmt (Instr [i])
13691369

1370-
let dummyInstr = DummyInstr(lu)
1371-
let dummyStmt = mkStmt (Instr [dummyInstr])
1370+
let dummyStmt = mkStmt (Asm([], ["dummy statement!!"], [], [], [], [], lu))
13721371

13731372
let compactStmts (b: stmt list) : stmt list =
13741373
(* Try to compress statements. Scan the list of statements and remember
@@ -6080,8 +6079,8 @@ let typeSigAttrs = function
60806079
let dExp: doc -> exp =
60816080
fun d -> Const(CStr(sprint ~width:!lineLength d, No_encoding))
60826081

6083-
let dInstr: doc -> location -> instr =
6084-
fun d l -> DummyInstr l
6082+
let dStmt: doc -> location -> stmt =
6083+
fun d l -> mkStmt (Asm([], [sprint ~width:!lineLength d], [], [], [], [], l))
60856084

60866085
let dGlobal: doc -> location -> global =
60876086
fun d l -> GAsm(sprint ~width:!lineLength d, l)

src/cil.mli

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,10 +1767,7 @@ val compactStmts: stmt list -> stmt list
17671767
(** Returns an empty statement (of kind [Instr]) *)
17681768
val mkEmptyStmt: unit -> stmt
17691769

1770-
(** A instr to serve as a placeholder *)
1771-
val dummyInstr: instr
1772-
1773-
(** A statement consisting of just [dummyInstr] *)
1770+
(** A statement to serve as a placeholder *)
17741771
val dummyStmt: stmt
17751772

17761773
(** Make a while loop. Can contain Break or Continue *)
@@ -2669,8 +2666,8 @@ val get_stmtLoc: stmtkind -> location
26692666
(** Generate an {!exp} to be used in case of errors. *)
26702667
val dExp: Pretty.doc -> exp
26712668

2672-
(** Generate an {!instr} to be used in case of errors. *)
2673-
val dInstr: Pretty.doc -> location -> instr
2669+
(** Generate an {!stmt} to be used in case of errors. *)
2670+
val dStmt: Pretty.doc -> location -> stmt
26742671

26752672
(** Generate a {!global} to be used in case of errors. *)
26762673
val dGlobal: Pretty.doc -> location -> global

src/frontc/cabs2cil.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5055,7 +5055,7 @@ and doExp (asconst: bool) (* This expression is used as a constant *)
50555055
with e when continueOnError -> begin
50565056
(*ignore (E.log "error in doExp (%s)" (Printexc.to_string e));*)
50575057
E.hadErrors := true;
5058-
(i2c (dInstr (dprintf "booo_exp(%t)" d_thisloc) !currentLoc),
5058+
(s2c (dStmt (dprintf "booo_exp(%t)" d_thisloc) !currentLoc),
50595059
integer 0, intType)
50605060
end
50615061

0 commit comments

Comments
 (0)