mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
flag/environment variable for dumping use-defs
This commit is contained in:
parent
8a3622a726
commit
12c9b5ede5
3 changed files with 8 additions and 1 deletions
|
@ -157,6 +157,7 @@ static void set_analysis_option(const char* opt, Options& opts)
|
|||
if ( util::streq(opt, "help") )
|
||||
{
|
||||
fprintf(stderr, "--optimize options:\n");
|
||||
fprintf(stderr, " dump-uds dump use-defs to stdout; implies xform\n");
|
||||
fprintf(stderr, " dump-xform dump transformed scripts to stdout; implies xform\n");
|
||||
fprintf(stderr, " help print this list\n");
|
||||
fprintf(stderr, " inline inline function calls\n");
|
||||
|
@ -167,7 +168,9 @@ static void set_analysis_option(const char* opt, Options& opts)
|
|||
|
||||
auto& a_o = opts.analysis_options;
|
||||
|
||||
if ( util::streq(opt, "dump-xform") )
|
||||
if ( util::streq(opt, "dump-uds") )
|
||||
a_o.activate = a_o.dump_uds = true;
|
||||
else if ( util::streq(opt, "dump-xform") )
|
||||
a_o.activate = a_o.dump_xform = true;
|
||||
else if ( util::streq(opt, "inline") )
|
||||
a_o.inliner = true;
|
||||
|
|
|
@ -115,6 +115,7 @@ void analyze_scripts()
|
|||
if ( ! did_init )
|
||||
{
|
||||
check_env_opt("ZEEK_DUMP_XFORM", analysis_options.dump_xform);
|
||||
check_env_opt("ZEEK_DUMP_UDS", analysis_options.dump_uds);
|
||||
check_env_opt("ZEEK_INLINE", analysis_options.inliner);
|
||||
check_env_opt("ZEEK_XFORM", analysis_options.activate);
|
||||
|
||||
|
|
|
@ -27,6 +27,9 @@ struct AnalyOpt {
|
|||
// them. Always done if only_func is set.
|
||||
bool dump_xform = false;
|
||||
|
||||
// If true, dump out the use-defs for each analyzed function.
|
||||
bool dump_uds = false;
|
||||
|
||||
// If non-nil, then only analyze the given function/event/hook.
|
||||
std::optional<std::string> only_func;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue