Skip to content
Snippets Groups Projects
Commit 2faaf0d7 authored by Valentin Perrelle's avatar Valentin Perrelle Committed by David Bühler
Browse files

[Constant Propagation] Use the new Eva API

parent c95fcb4d
No related branches found
No related tags found
No related merge requests found
......@@ -131,11 +131,12 @@ class propagate project fnames ~cast_intro = object(self)
| TEnum _) -> ()
| _ -> raise Cannot_expand
end;
let ki = match self#current_stmt with
let stmt = match self#current_stmt with
| None -> raise Cannot_change
| Some s -> Kstmt s
| Some s -> s
in
let evaled = !Db.Value.access_expr ki expr in
let evaled = Eva.Results.(
before stmt |> eval_exp expr |> as_cvalue |> default Cvalue.V.top) in
let b, m = Cvalue.V.find_lonely_binding evaled in
let can_replace vi =
(* can replace the current expr by [vi] iff (1) it is a source var, or
......@@ -340,7 +341,7 @@ module Result =
let size = 7
let name = "Semantical constant propagation"
let dependencies =
[ Db.Value.self;
[ Eva.Analysis.self;
PropagationParameters.CastIntro.self;
PropagationParameters.Project_name.self ]
end)
......@@ -352,7 +353,7 @@ let journalized_get =
let get fnames cast_intro =
Result.memo
(fun _ ->
!Db.Value.compute ();
Eva.Analysis.compute ();
let fresh_project =
FC_file.create_project_from_visitor
(PropagationParameters.Project_name.get ())
......
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