option handling for new -u/-uu flag for reporting usage issues

This commit is contained in:
Vern Paxson 2021-01-23 10:25:06 -08:00
parent 989cc6f607
commit 732633ebb4
4 changed files with 31 additions and 8 deletions

View file

@ -36,8 +36,18 @@ struct AnalyOpt {
// If true, report which functions are directly and indirectly
// recursive, and exit. Only germane if running the inliner.
bool report_recursive = false;
// If non-zero, looks for variables that are used-but-possibly-not-set,
// or set-but-not-used.
//
// If > 1, also reports on uses of uninitialized record fields and
// analyzes nested records in depth. Warning: with the current
// data structures this greatly increases analysis time.
int usage_issues = 0;
};
extern AnalyOpt analysis_options;
class ProfileFunc;
@ -81,7 +91,7 @@ extern std::unordered_set<const Func*> non_recursive_funcs;
extern void analyze_func(ScriptFuncPtr f);
// Analyze all of the parsed scripts collectively for optimization.
extern void analyze_scripts(Options& opts);
extern void analyze_scripts();
} // namespace zeek::detail