Skip to content

Commit b3246d8

Browse files
committed
CHC: set type of analysis
1 parent 499cc76 commit b3246d8

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

CodeHawk/CHC/cchcmdline/cCHXCAnalyzer.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ let main () =
187187

188188
else if !cmd = "outputparameters-primary" then
189189
begin
190+
system_settings#set_output_parameter_analysis;
190191
CCHCreateOutputParameterPOs.output_parameter_po_process_file ();
191192
log_info "primary proof obligations generated [%s:%d]" __FILE__ __LINE__;
192193
save_log_files "primary";

CodeHawk/CHC/cchlib/cCHLibTypes.mli

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,11 @@ class type global_contract_int =
788788
(** {1 System settings} *)
789789

790790

791+
type analysis_kind_t =
792+
| UndefinedBehaviorAnalysis
793+
| OutputParameterAnalysis
794+
795+
791796
type analysis_level_t =
792797
| UndefinedBehavior
793798
(** only indicate undefined behavior (Red) *)
@@ -867,6 +872,10 @@ class type system_settings_int =
867872
method is_implementation_defined: bool
868873
method is_value_wrap_around: bool
869874

875+
method set_output_parameter_analysis: unit
876+
method is_undefined_behavior_analysis: bool
877+
method is_output_parameter_analysis: bool
878+
870879
(** {1 Other settings} *)
871880

872881
method set_verbose: bool -> unit

CodeHawk/CHC/cchlib/cCHSettings.ml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ object
5050
val mutable wordsize = Some 32
5151
val mutable use_unreachability = false
5252
val mutable analysis_level = ImplementationDefinedBehavior
53+
val mutable analysis_kind = UndefinedBehaviorAnalysis
5354

5455
method set_projectpath (p: string) = projectpath <- p
5556
method get_projectpath = projectpath
@@ -97,6 +98,14 @@ object
9798

9899
method is_value_wrap_around = analysis_level = ValueWrapAround
99100

101+
method set_output_parameter_analysis = analysis_kind <- OutputParameterAnalysis
102+
103+
method is_undefined_behavior_analysis =
104+
analysis_kind = UndefinedBehaviorAnalysis
105+
106+
method is_output_parameter_analysis =
107+
analysis_kind = OutputParameterAnalysis
108+
100109
method use_unreachability = use_unreachability
101110
method verbose = verbose
102111

0 commit comments

Comments
 (0)