]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ir.h
ir_function now has a flags field - flags are: IR_FLAG_HAS_{ARRAYS,UNINITIALIZED...
[xonotic/gmqcc.git] / ir.h
diff --git a/ir.h b/ir.h
index a12827fc36898f8ac90036c4fcff81bff87569c5..75946959a900ed0914dd21b2072359c2594f34d4 100644 (file)
--- a/ir.h
+++ b/ir.h
@@ -75,6 +75,9 @@ typedef struct ir_value_s {
     struct ir_value_s *members[3];
     struct ir_value_s *memberof;
 
+    /* arrays will never overlap with temps */
+    bool unique_life;
+
     /* For the temp allocator */
     ir_life_entry_t *life;
 } ir_value;
@@ -206,7 +209,7 @@ ir_value* ir_block_create_div(ir_block*, lex_ctx, const char *label, ir_value *l
 ir_instr* ir_block_create_phi(ir_block*, lex_ctx, const char *label, int vtype);
 ir_value* ir_phi_value(ir_instr*);
 void ir_phi_add(ir_instr*, ir_block *b, ir_value *v);
-ir_instr* ir_block_create_call(ir_block*, lex_ctx, const char *label, ir_value *func);
+ir_instr* ir_block_create_call(ir_block*, lex_ctx, const char *label, ir_value *func, bool noreturn);
 ir_value* ir_call_value(ir_instr*);
 void ir_call_param(ir_instr*, ir_value*);
 
@@ -234,6 +237,8 @@ typedef struct ir_function_s
     int       *params;
     ir_block **blocks;
 
+    uint32_t   flags;
+
     int builtin;
 
     ir_value *value;
@@ -267,6 +272,10 @@ typedef struct ir_function_s
 
     struct ir_builder_s *owner;
 } ir_function;
+#define IR_FLAG_HAS_ARRAYS        (1<<1)
+#define IR_FLAG_HAS_UNINITIALIZED (1<<2)
+#define IR_FLAG_HAS_GOTO          (1<<3)
+#define IR_FLAG_MASK_NO_OVERLAP (IR_FLAG_HAS_ARRAYS | IR_FLAG_HAS_UNINITIALIZED)
 
 ir_function* ir_function_new(struct ir_builder_s *owner, int returntype);
 void         ir_function_delete(ir_function*);