Skip to content
Snippets Groups Projects
Commit bd181971 authored by Allan Blanchard's avatar Allan Blanchard Committed by Julien Signoles
Browse files

[Tests] Replaces deprecated function call related to Visitor_behavior

parent 5a43e278
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,8 @@ let main () = ...@@ -3,7 +3,8 @@ let main () =
Logic_env.Builtins.apply *) Logic_env.Builtins.apply *)
ignore ignore
(File.create_project_from_visitor "foo" (File.create_project_from_visitor "foo"
(fun p -> new Visitor.generic_frama_c_visitor (Cil.copy_visit p))); (fun p ->
new Visitor.generic_frama_c_visitor (Visitor_behavior.copy_visit p)));
let p = Project.create "bar" in let p = Project.create "bar" in
(* Computing the AST first calls File.cil_init, than calls (* Computing the AST first calls File.cil_init, than calls
Logic_env.Builtins.apply. This second call raises an exception because Logic_env.Builtins.apply. This second call raises an exception because
......
...@@ -50,7 +50,7 @@ let visit_bar vis ext = ...@@ -50,7 +50,7 @@ let visit_bar vis ext =
| Ext_id idx -> | Ext_id idx ->
let l = Bar_table.find idx in let l = Bar_table.find idx in
let l' = Cil.mapNoCopy (Cil.visitCilPredicate vis) l in let l' = Cil.mapNoCopy (Cil.visitCilPredicate vis) l in
if Cil.is_copy_behavior vis#behavior then begin if Visitor_behavior.is_copy vis#behavior then begin
let idx' = Count.next () in let idx' = Count.next () in
Queue.add (fun () -> Bar_table.add idx' l') vis#get_filling_actions; Queue.add (fun () -> Bar_table.add idx' l') vis#get_filling_actions;
Cil.ChangeTo(Ext_id idx') Cil.ChangeTo(Ext_id idx')
......
...@@ -20,7 +20,7 @@ class visit prj = ...@@ -20,7 +20,7 @@ class visit prj =
From [ Logic_const.new_identified_term (Logic_const.tvar x); From [ Logic_const.new_identified_term (Logic_const.tvar x);
Logic_const.new_identified_term (Logic_const.tvar c)] Logic_const.new_identified_term (Logic_const.tvar c)]
]; ];
let nkf = Cil.get_kernel_function self#behavior kf in let nkf = Visitor_behavior.get_kernel_function self#behavior kf in
let keep_empty = true in let keep_empty = true in
let post b = let post b =
Queue.add Queue.add
......
open Cil_types open Cil_types
open Cil open Visitor_behavior
let category = Kernel.register_category "refresh-test" let category = Kernel.register_category "refresh-test"
......
...@@ -11,11 +11,11 @@ object(self) ...@@ -11,11 +11,11 @@ object(self)
let f1 = Visitor.visitFramacFunction (self:>Visitor.frama_c_visitor) f let f1 = Visitor.visitFramacFunction (self:>Visitor.frama_c_visitor) f
in in
let v2 = Cil.copyVarinfo f.svar (f.svar.vname ^ "1") in let v2 = Cil.copyVarinfo f.svar (f.svar.vname ^ "1") in
let orig = Cil.get_original_varinfo self#behavior f.svar in let orig = Visitor_behavior.get_original_varinfo self#behavior f.svar in
Cil.set_varinfo self#behavior orig v2; Visitor_behavior.set_varinfo self#behavior orig v2;
Cil.set_orig_varinfo self#behavior v2 orig; Visitor_behavior.set_orig_varinfo self#behavior v2 orig;
Cil.reset_behavior_fundec self#behavior; Visitor_behavior.reset_fundec self#behavior;
Cil.reset_behavior_stmt self#behavior; Visitor_behavior.reset_stmt self#behavior;
let f2 = Visitor.visitFramacFunction (self:>Visitor.frama_c_visitor) f let f2 = Visitor.visitFramacFunction (self:>Visitor.frama_c_visitor) f
in in
f2.svar <- v2; f2.svar <- v2;
......
...@@ -9,7 +9,8 @@ class vis prj = object(self) ...@@ -9,7 +9,8 @@ class vis prj = object(self)
let s1 = Cil.mkStmtOneInstr ~valid_sid:true instr in let s1 = Cil.mkStmtOneInstr ~valid_sid:true instr in
let b = Cil.mkBlock [s1] in let b = Cil.mkBlock [s1] in
if create then begin if create then begin
let f = Cil.get_fundec self#behavior (Extlib.the self#current_func) in let f = Visitor_behavior.get_fundec
self#behavior (Extlib.the self#current_func) in
let y = Cil.makeLocalVar f ~scope:b "y" (TInt(IInt,[])) in let y = Cil.makeLocalVar f ~scope:b "y" (TInt(IInt,[])) in
my_var <- Some y; my_var <- Some y;
let loc = Cil_datatype.Location.unknown in let loc = Cil_datatype.Location.unknown in
...@@ -31,7 +32,8 @@ class vis prj = object(self) ...@@ -31,7 +32,8 @@ class vis prj = object(self)
with Log.AbortFatal _ -> with Log.AbortFatal _ ->
Kernel.feedback "transient_block fatal error on %a as expected" Kernel.feedback "transient_block fatal error on %a as expected"
Printer.pp_instr instr; Printer.pp_instr instr;
let f = Cil.get_fundec self#behavior (Extlib.the self#current_func) in let f = Visitor_behavior.get_fundec
self#behavior (Extlib.the self#current_func) in
let y = Extlib.the my_var in let y = Extlib.the my_var in
f.slocals <- f.slocals <-
List.filter List.filter
......
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