mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
--no-usage-warnings flag to suppress analysis
This commit is contained in:
parent
763b448aef
commit
d9479c0502
7 changed files with 29 additions and 7 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -182,8 +182,9 @@ extern void add_file_analysis_pattern(AnalyOpt& opts, const char* pat);
|
|||
// it should be skipped.
|
||||
extern bool should_analyze(const ScriptFuncPtr& f, const StmtPtr& body);
|
||||
|
||||
// Analyze all of the parsed scripts collectively for optimization.
|
||||
extern void analyze_scripts();
|
||||
// Analyze all of the parsed scripts collectively for usage issues (unless
|
||||
// suppressed by the flag) and optimization.
|
||||
extern void analyze_scripts(bool no_usage_warnings);
|
||||
|
||||
// Called when Zeek is terminating.
|
||||
extern void finish_script_execution();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue