From a328185a8fea540e75ce8750fba43bad5ba715cb Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Tue, 3 Dec 2024 10:35:35 -0700 Subject: [PATCH] internal support for script optimization options for keeping asserts, not consolidating event handlers --- src/script_opt/ScriptOpt.cc | 2 ++ src/script_opt/ScriptOpt.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/script_opt/ScriptOpt.cc b/src/script_opt/ScriptOpt.cc index 47effda307..60347c876b 100644 --- a/src/script_opt/ScriptOpt.cc +++ b/src/script_opt/ScriptOpt.cc @@ -265,11 +265,13 @@ static void init_options() { check_env_opt("ZEEK_DUMP_UDS", analysis_options.dump_uds); check_env_opt("ZEEK_INLINE", analysis_options.inliner); check_env_opt("ZEEK_NO_INLINE", analysis_options.no_inliner); + check_env_opt("ZEEK_NO_EH_COALESCENCE", analysis_options.no_eh_coalescence); check_env_opt("ZEEK_OPT", analysis_options.optimize_AST); check_env_opt("ZEEK_XFORM", analysis_options.activate); check_env_opt("ZEEK_ZAM", analysis_options.gen_ZAM); check_env_opt("ZEEK_COMPILE_ALL", analysis_options.compile_all); check_env_opt("ZEEK_REPORT_UNCOMPILABLE", analysis_options.report_uncompilable); + check_env_opt("ZEEK_ZAM_KEEP_ASSERTS", analysis_options.keep_asserts); check_env_opt("ZEEK_ZAM_CODE", analysis_options.gen_ZAM_code); check_env_opt("ZEEK_NO_ZAM_OPT", analysis_options.no_ZAM_opt); check_env_opt("ZEEK_NO_ZAM_CONTROL_FLOW_OPT", analysis_options.no_ZAM_control_flow_opt); diff --git a/src/script_opt/ScriptOpt.h b/src/script_opt/ScriptOpt.h index 441c8d6ec2..de537af785 100644 --- a/src/script_opt/ScriptOpt.h +++ b/src/script_opt/ScriptOpt.h @@ -57,6 +57,12 @@ struct AnalyOpt { // enabled due to other options. bool no_inliner = false; + // If true, when inlining skip event handler coalescence. + bool no_eh_coalescence = false; + + // Whether to keep or elide "assert" statements. + bool keep_asserts = false; + // If true, report which functions are directly and indirectly // recursive, and exit. Only germane if running the inliner. bool report_recursive = false;