Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CodeHawk/CHB/bchlib/bCHFunctionInfo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,8 @@ object (self)

method is_register_variable = varmgr#is_register_variable

method is_stackpointer_variable = varmgr#is_stackpointer_variable

method is_initial_register_value = varmgr#is_initial_register_value

method is_initial_mips_argument_value = varmgr#is_initial_mips_argument_value
Expand Down
9 changes: 9 additions & 0 deletions CodeHawk/CHB/bchlib/bCHLibTypes.mli
Original file line number Diff line number Diff line change
Expand Up @@ -3564,6 +3564,7 @@ object ('a)

method is_auxiliary_variable: bool
method is_register_variable: bool
method is_stackpointer_variable: bool
method is_mips_argument_variable: bool
method is_arm_argument_variable: bool
method is_arm_extension_register_variable: bool
Expand Down Expand Up @@ -3949,6 +3950,10 @@ object
(** Returns [true] if [var] is a register variable (of any architecture). *)
method is_register_variable: variable_t -> bool

(** Returns [true] if [var] is a register used as a stackpointer (in the
current architecture). *)
method is_stackpointer_variable: variable_t -> bool

(** Returns the register associated with [var].

Returns [Error] if [var] is not a register variable or [var] cannot be
Expand Down Expand Up @@ -4452,6 +4457,10 @@ class type function_environment_int =
(** Returns [true] if [var] is a register variable (of any architecture). *)
method is_register_variable: variable_t -> bool

(** Returns [true] if [var] is a register variable that used by the current
architecture as a stackpointer. *)
method is_stackpointer_variable: variable_t -> bool

(** Returns the register associated with [var].

Returns [Error] if [var] is not a register variable or [var] cannot be
Expand Down
9 changes: 9 additions & 0 deletions CodeHawk/CHB/bchlib/bCHVariable.ml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ object (self:'a)
method is_register_variable =
match denotation with RegisterVariable _ -> true | _ -> false

method is_stackpointer_variable =
match denotation with
| RegisterVariable r -> BCHCPURegisters.is_stackpointer_register r
| _ -> false

method is_mips_argument_variable =
match denotation with
| RegisterVariable reg ->
Expand Down Expand Up @@ -927,6 +932,10 @@ object (self)
tfold_default
(fun av -> av#is_register_variable) false (self#get_variable v)

method is_stackpointer_variable (v: variable_t) =
tfold_default
(fun av -> av#is_stackpointer_variable) false (self#get_variable v)

method is_mips_argument_variable (v:variable_t) =
tfold_default
(fun av -> av#is_mips_argument_variable) false (self#get_variable v)
Expand Down
3 changes: 3 additions & 0 deletions CodeHawk/CHB/bchlibarm32/bCHTranslateARMToCHIF.ml
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,9 @@ let translate_arm_instruction
let xw = inv#rewrite_expr x in
let xs = simplify_xpr xw in
let disvars = inv#get_init_disequalities in
let disvars =
List.filter
(fun v -> not (floc#f#env#is_initial_stackpointer_value v)) disvars in
let is_disvar v = List.exists (fun vv -> v#equal vv) disvars in
let xprvars = floc#env#variables_in_expr xs in
let vars =
Expand Down
Loading