"-O validate-ZAM" option to validate generated ZAM instructions

This commit is contained in:
Vern Paxson 2024-08-06 08:29:16 +01:00 committed by Arne Welzel
parent db22448270
commit 1457099df3
7 changed files with 134 additions and 5 deletions

View file

@ -61,6 +61,10 @@ struct AnalyOpt {
// recursive, and exit. Only germane if running the inliner.
bool report_recursive = false;
// If true, assess the instructions generated from ZAM templates
// for validity, and exit.
bool validate_ZAM = false;
// If true, generate ZAM code for applicable function bodies,
// activating all optimizations.
bool gen_ZAM = false;
@ -244,6 +248,11 @@ extern bool should_analyze(const ScriptFuncPtr& f, const StmtPtr& body);
// suppressed by the flag) and optimization.
extern void analyze_scripts(bool no_unused_warnings);
// Conduct internal validation of ZAM instructions. Upon success, generates
// a terse report to stdout. Exits with an internal error if a problem is
// encountered.
extern void validate_ZAM_insts();
// Called when all script processing is complete and we can discard
// unused ASTs and associated state.
extern void clear_script_analysis();