]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.h
Some side-effect propagation for better warnings, so that comma-operators with assign...
[xonotic/gmqcc.git] / ast.h
diff --git a/ast.h b/ast.h
index ba42e70c969c3ebd94c67232979e327a9278b6cc..0a23a324ae30c77308818e2d583ff0bf0e97878c 100644 (file)
--- a/ast.h
+++ b/ast.h
@@ -73,6 +73,7 @@ enum {
 
 #define ast_istype(x, t) ( ((ast_node_common*)x)->nodetype == (TYPE_##t) )
 #define ast_ctx(node) (((ast_node_common*)(node))->context)
+#define ast_side_effects(node) (((ast_node_common*)(node))->side_effects)
 
 /* Node interface with common components
  */
@@ -87,6 +88,7 @@ typedef struct
      * prevents its dtor from destroying this node as well.
      */
     bool             keep;
+    bool             side_effects;
 } ast_node_common;
 
 #define ast_delete(x) ( ( (ast_node*)(x) ) -> node.destroy )((ast_node*)(x))
@@ -526,6 +528,8 @@ bool ast_block_set_type(ast_block*, ast_expression *from);
 bool ast_block_codegen(ast_block*, ast_function*, bool lvalue, ir_value**);
 void ast_block_collect(ast_block*, ast_expression*);
 
+void ast_block_add_expr(ast_block*, ast_expression*);
+
 /* Function
  *
  * Contains a list of blocks... at least in theory.