--no-usage-warnings flag to suppress analysis

This commit is contained in:
Vern Paxson 2022-05-05 10:57:31 -07:00 committed by Tim Wojtulewicz
parent 763b448aef
commit d9479c0502
7 changed files with 29 additions and 7 deletions

View file

@ -14,6 +14,7 @@
#include "zeek/script_opt/Inline.h"
#include "zeek/script_opt/ProfileFunc.h"
#include "zeek/script_opt/Reduce.h"
#include "zeek/script_opt/UsageAnalyzer.h"
#include "zeek/script_opt/UseDefs.h"
#include "zeek/script_opt/ZAM/Compile.h"
@ -519,7 +520,7 @@ static void analyze_scripts_for_ZAM(std::unique_ptr<ProfileFuncs>& pfs)
finalize_functions(funcs);
}
void analyze_scripts()
void analyze_scripts(bool no_usage_warnings)
{
static bool did_init = false;
@ -529,6 +530,10 @@ void analyze_scripts()
did_init = true;
}
std::unique_ptr<UsageAnalyzer> ua;
if ( ! no_usage_warnings )
ua = std::make_unique<UsageAnalyzer>(funcs);
auto& ofuncs = analysis_options.only_funcs;
auto& ofiles = analysis_options.only_files;