]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.h
ast_binary_codegen, ast_function_label (no I don't like sprintf...)
[xonotic/gmqcc.git] / ast.h
diff --git a/ast.h b/ast.h
index 9609a08d678600d2a44fe4b741203c40e5da0b4f..b2d906e6a0c9bdf3a515d311ea51ba8bc1eeab9f 100644 (file)
--- a/ast.h
+++ b/ast.h
@@ -276,11 +276,24 @@ struct ast_function_s
     ir_function *ir_func;
     ir_block    *curblock;
 
+    size_t       labelcount;
+    /* in order for thread safety - for the optional
+     * channel abesed multithreading... keeping a buffer
+     * here to use in ast_function_label.
+     */
+    char         labelbuf[64];
+
     MEM_VECTOR_MAKE(ast_block*, blocks);
 };
 ast_function* ast_function_new(lex_ctx ctx, const char *name, ast_value *vtype);
 /* This will NOT delete the underlying ast_value */
 void ast_function_delete(ast_function*);
+/* TODO: for better readability in dumps, this should take some kind of
+ * value prefix...
+ * For "optimized" builds this can just keep returning "foo"...
+ * or whatever...
+ */
+const char* ast_function_label(ast_function*);
 
 MEM_VECTOR_PROTO(ast_function, ast_block*, blocks);