Skip to content
Snippets Groups Projects
Commit ee52527e authored by Basile Desloges's avatar Basile Desloges
Browse files

[eacsl:codegen] Remove the moving of variables declarations from switch to upper blocks

parent d1291507
No related branches found
No related tags found
No related merge requests found
......@@ -496,18 +496,7 @@ class prepare_visitor = object (self)
Annotations.iter_code_annot
(fun _ a -> self#push_post_code_annot a)
stmt;
(* move variables declared in the body of a switch statement to the
outer scope *)
match stmt.skind with
| Switch(_,sw_blk,_,_) ->
let new_blk = Cil.mkBlock [ stmt ] in
let new_stmt = Cil.mkStmt ~valid_sid:true (Block new_blk) in
new_blk.blocals <- sw_blk.blocals;
sw_blk.blocals <- [];
has_new_stmt_in_fundec <- true;
new_stmt
| _ ->
stmt)
stmt)
method !vfunc fundec =
Cil.DoChildrenPost
......
......@@ -25,8 +25,6 @@
More precisely, this module performs the following tasks:
- generating a new definition for functions with contract;
- removing term sharing;
- moving declarations of variables declared in the bodies of switch
statements to upper scopes;
- storing what is necessary to translate in [Keep_status];
- in case of temporal validity checks, adding the attribute "aligned" to
variables that are not sufficiently aligned. *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment