Skip to content

Commit

Permalink
Create visitors in InvariantCil only once
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Mar 4, 2024
1 parent d3ef633 commit a6b7f4e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/cdomain/value/domains/invariantCil.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class exp_replace_original_name_visitor = object
method! vvrbl (vi: varinfo) =
ChangeTo (var_replace_original_name vi)
end
let exp_replace_original_name e = (* TODO: curry to create object only once *)
let exp_replace_original_name =
let visitor = new exp_replace_original_name_visitor in
visitCilExpr visitor e
visitCilExpr visitor

class exp_deep_unroll_types_visitor = object
inherit nopCilVisitor
Expand Down Expand Up @@ -93,11 +93,12 @@ class exp_contains_anon_type_visitor = object
| _ ->
DoChildren
end
let exp_contains_anon_type e = (* TODO: curry to create object only once *)
let exp_contains_anon_type =
let visitor = new exp_contains_anon_type_visitor in
match visitCilExpr visitor e with
| _ -> false
| exception Stdlib.Exit -> true
fun e ->
match visitCilExpr visitor e with
| _ -> false
| exception Stdlib.Exit -> true


(* TODO: synchronize magic constant with BaseDomain *)
Expand Down

0 comments on commit a6b7f4e

Please sign in to comment.