X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Ffilter%2Ffilter-ast.h;h=2b460b401ef669d87a3ab9da67e973a564914e59;hb=b66cbf1731486ab4dc7e0b2e1c3fa05cc5360c19;hp=29fde10f8c126f7cd430b9a8f498987386801d03;hpb=e4d2f27a74baf6942ac8fcafd5ea53e775ceceb3;p=lttng-tools.git diff --git a/src/common/filter/filter-ast.h b/src/common/filter/filter-ast.h index 29fde10f8..2b460b401 100644 --- a/src/common/filter/filter-ast.h +++ b/src/common/filter/filter-ast.h @@ -17,6 +17,7 @@ */ #include +#include #include #define printf_debug(fmt, args...) \ @@ -88,6 +89,16 @@ enum ast_link_type { AST_LINK_BRACKET, }; +enum ast_expt_type { + AST_EXP_UNKNOWN = 0, + AST_EXP_STRING, + AST_EXP_CONSTANT, + AST_EXP_FLOAT_CONSTANT, + AST_EXP_IDENTIFIER, + AST_EXP_GLOBAL_IDENTIFIER, + AST_EXP_NESTED, +}; + struct filter_node { /* * Parent node is only set on demand by specific visitor. @@ -98,20 +109,14 @@ struct filter_node { enum node_type type; union { struct { + /* Avoid -Wextern-c-compat warning with clang++. */ + char unused; } unknown; struct { struct filter_node *child; } root; struct { - enum { - AST_EXP_UNKNOWN = 0, - AST_EXP_STRING, - AST_EXP_CONSTANT, - AST_EXP_FLOAT_CONSTANT, - AST_EXP_IDENTIFIER, - AST_EXP_GLOBAL_IDENTIFIER, - AST_EXP_NESTED, - } type; + enum ast_expt_type type; enum ast_link_type post_op; /* reverse */ enum ast_link_type pre_op; /* forward */ union { @@ -157,8 +162,8 @@ struct filter_parser_ctx { struct filter_ast *ast; struct cds_list_head allocated_strings; struct ir_op *ir_root; - struct lttng_filter_bytecode_alloc *bytecode; - struct lttng_filter_bytecode_alloc *bytecode_reloc; + struct lttng_bytecode_alloc *bytecode; + struct lttng_bytecode_alloc *bytecode_reloc; }; struct filter_parser_ctx *filter_parser_ctx_alloc(FILE *input);