]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.h
Fix output of util_memory_d
[xonotic/gmqcc.git] / ast.h
diff --git a/ast.h b/ast.h
index 0059e823fa303c0bc895ea3e7d0a7db4c68e8ce1..55691eb473fa9d7cd3c5aa0011ad828acb3beacf 100644 (file)
--- a/ast.h
+++ b/ast.h
@@ -149,6 +149,7 @@ struct ast_value_s
 };
 
 ast_value* ast_value_new(lex_ctx ctx, const char *name, int qctype);
+ast_value* ast_value_copy(const ast_value *self);
 /* This will NOT delete an underlying ast_function */
 void ast_value_delete(ast_value*);
 
@@ -161,6 +162,9 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir);
 bool GMQCC_WARN ast_value_params_add(ast_value*, ast_value*);
 
 bool ast_compare_type(ast_expression *a, ast_expression *b);
+ast_expression* ast_type_copy(lex_ctx ctx, const ast_expression *ex);
+#define ast_type_adopt(a, b) ast_type_adopt_impl((ast_expression*)(a), (ast_expression*)(b))
+bool ast_type_adopt_impl(ast_expression *self, const ast_expression *other);
 
 /* Binary
  *
@@ -427,6 +431,7 @@ struct ast_block_s
 
     MEM_VECTOR_MAKE(ast_value*,      locals);
     MEM_VECTOR_MAKE(ast_expression*, exprs);
+    MEM_VECTOR_MAKE(ast_expression*, collect);
 };
 ast_block* ast_block_new(lex_ctx ctx);
 void ast_block_delete(ast_block*);
@@ -434,8 +439,10 @@ bool ast_block_set_type(ast_block*, ast_expression *from);
 
 MEM_VECTOR_PROTO(ast_block, ast_value*, locals);
 MEM_VECTOR_PROTO(ast_block, ast_expression*, exprs);
+MEM_VECTOR_PROTO(ast_block, ast_expression*, collect);
 
 bool ast_block_codegen(ast_block*, ast_function*, bool lvalue, ir_value**);
+bool ast_block_collect(ast_block*, ast_expression*);
 
 /* Function
  *