X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ast.h;h=04fa4d80b5e5b248c3a2b3d73c8a7f77c04f3b28;hp=04f8c0eaa5ec76f81327cc00214ada72d585d6ed;hb=eb2d47877069169ff9dcfb1af35de0e4e66eb00e;hpb=45236a644fb45ac9f61c3ef38bcab17b5004b095 diff --git a/ast.h b/ast.h index 04f8c0e..04fa4d8 100644 --- a/ast.h +++ b/ast.h @@ -62,6 +62,12 @@ enum { AST_FLAG_COVERAGE = 1 << 12, AST_FLAG_BLOCK_COVERAGE = 1 << 13, + /* + * Propagates norefness to the IR so the unused (read/write) check can be + * more intelligently done. + */ + AST_FLAG_NOREF = 1 << 14, + AST_FLAG_LAST, AST_FLAG_TYPE_MASK = (AST_FLAG_VARIADIC | AST_FLAG_NORETURN), AST_FLAG_COVERAGE_MASK = (AST_FLAG_BLOCK_COVERAGE) @@ -110,7 +116,7 @@ struct ast_node bool m_keep_node; bool m_side_effects; - void propagateSideEffects(ast_node *other) const; + void propagateSideEffects(const ast_node *other); }; #define ast_unref(x) do \ @@ -223,9 +229,6 @@ struct ast_value : ast_expression */ std::vector m_initlist; - /* usecount for the parser */ - size_t m_uses = 0; - ir_value *m_ir_v = nullptr; std::vector m_ir_values; size_t m_ir_value_count = 0;