Skip to content

Commit 36bc71f

Browse files
committed
CHB: reset type analysis per function
1 parent 400793a commit 36bc71f

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CodeHawk/CHB/bchlib/bCHLibTypes.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3162,6 +3162,8 @@ class type type_constraint_graph_int =
31623162
class type type_constraint_store_int =
31633163
object
31643164

3165+
method reset: unit
3166+
31653167
method add_constraint: type_constraint_t -> unit
31663168

31673169
method add_var_constraint: type_variable_t -> unit

CodeHawk/CHB/bchlib/bCHTypeConstraintStore.ml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ object (self)
7070
(* constraints that involve a global variable *)
7171
val gvartypes = H.create 5
7272

73+
method reset =
74+
begin
75+
H.clear store;
76+
H.clear functiontypes;
77+
H.clear reglhss;
78+
H.clear stacklhss;
79+
H.clear gvartypes
80+
end
81+
7382
method add_constraint (c: type_constraint_t) =
7483
let index = tcd#index_type_constraint c in
7584
(* index the constraint *)

CodeHawk/CHB/bchlibarm32/bCHFnARMTypeConstraints.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,4 +619,7 @@ end
619619
let mk_arm_fn_type_constraints
620620
(store: type_constraint_store_int)
621621
(fn: arm_assembly_function_int): arm_fn_type_constraints_int =
622-
new arm_fn_type_constraints_t store fn
622+
begin
623+
store#reset;
624+
new arm_fn_type_constraints_t store fn
625+
end

0 commit comments

Comments
 (0)