tracking of optimization information associated with statements

This commit is contained in:
Vern Paxson 2021-08-16 10:42:06 -07:00
parent ed3c87d253
commit 3ac725f44b
3 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,25 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Auxiliary information associated with statements to aid script
// optimization.
#pragma once
namespace zeek::detail {
class StmtOptInfo {
public:
// We number statements by their traversal order in the AST.
int stmt_num = -1; // -1 = not assigned yet
// The confluence block nesting associated with the statement.
// We number these using 0 for the outermost block of a function
// (which, strictly speaking, isn't a confluence block).
int block_level = -1;
// True if we observe that there is a branch out of the statement
// to just beyond its extent, such as due to a "break".
bool contains_branch_beyond = false;
};
} // namespace zeek::detail