Skip to content

Commit 164770f

Browse files
committed
CHB:ARM: save typing rule applications
1 parent 18c2c18 commit 164770f

File tree

8 files changed

+355
-272
lines changed

8 files changed

+355
-272
lines changed

CodeHawk/CH/xprlib/xsimplify.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,10 @@ and reduce_ne m e1 e2 =
10401040
(* (a - b) != 0 ===> a != b *)
10411041
| (XOp (XMinus, [x; y]), SConst a) when zero_num a -> (true, XOp (XNe, [x; y]))
10421042

1043+
(* (a + b) != 0 ====> a != -b *)
1044+
| (XOp (XPlus, [x; y]), SConst a) when zero_num a ->
1045+
(true, XOp (XNe, [x; (XOp (XNeg, [y]))]))
1046+
10431047
| _ -> default
10441048

10451049

CodeHawk/CHB/bchlib/bCHVersion.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ end
9595

9696

9797
let version = new version_info_t
98-
~version:"0.6.0_20250716"
99-
~date:"2025-07-16"
98+
~version:"0.6.0_20250722"
99+
~date:"2025-07-22"
100100
~licensee: None
101101
~maxfilesize: None
102102
()

CodeHawk/CHB/bchlibarm32/bCHARMAnalysisResults.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,7 @@ object (self)
304304
save_vars faddr vard
305305
end );
306306
(* (if save then fndata#save); *)
307-
H.add table fn#get_address#to_hex_string fn;
308-
typeconstraints#record_type_constraints;
307+
H.add table fn#get_address#to_hex_string fn
309308
end
310309

311310
method write_xml (node:xml_element_int) =
@@ -325,9 +324,12 @@ object (self)
325324

326325
method save =
327326
let node = xmlElement "application-results" in
327+
let tcnode = xmlElement "type-constraint-store" in
328328
begin
329329
self#write_xml node;
330-
save_resultdata_file node
330+
save_resultdata_file node;
331+
typeconstraintstore#write_xml tcnode;
332+
save_typeconstraintstore tcnode
331333
end
332334

333335
end

CodeHawk/CHB/bchlibarm32/bCHARMOperand.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,9 @@ object (self:'a)
735735
method is_pc_register =
736736
match kind with ARMReg ARPC -> true | _ -> false
737737

738+
method is_sp_register =
739+
match kind with ARMReg ARSP -> true | _ -> false
740+
738741
method is_double_register =
739742
match kind with ARMDoubleReg _ -> true | _ -> false
740743

CodeHawk/CHB/bchlibarm32/bCHARMTypes.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ class type arm_operand_int =
202202
method is_register: bool
203203
method is_shifted_register: bool
204204
method is_pc_register: bool
205+
method is_sp_register: bool
205206
method is_double_register: bool
206207
method is_extension_register: bool
207208
method is_double_extension_register: bool

CodeHawk/CHB/bchlibarm32/bCHFnARMDictionary.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,6 +2385,7 @@ object (self)
23852385
let r0_op = arm_register_op AR0 RD in
23862386
let xr0_r = r0_op#to_expr floc in
23872387
let xxr0_r = TR.tmap rewrite_expr xr0_r in
2388+
let xxr0_r = TR.tmap (rewrite_in_cc_context floc c) xxr0_r in
23882389
let cxr0_r = TR.tbind floc#convert_xpr_to_c_expr xxr0_r in
23892390
add_return_value tags args xr0_r xxr0_r cxr0_r
23902391
else

0 commit comments

Comments
 (0)