]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ir.h
the lexer now doesn't _allocate_ the token structure, also: the vector holding the...
[xonotic/gmqcc.git] / ir.h
diff --git a/ir.h b/ir.h
index e36aa086eb04f3d4a916d713dda275d37c6ad85f..e044d75163fb318c4f933ecefdeb7b4918b48abf 100644 (file)
--- a/ir.h
+++ b/ir.h
@@ -68,6 +68,7 @@ typedef struct ir_value_s {
 
     /* for acessing vectors */
     struct ir_value_s *members[3];
+    struct ir_value_s *memberof;
 
     /* For the temp allocator */
     MEM_VECTOR_MAKE(ir_life_entry_t, life);
@@ -95,6 +96,7 @@ bool GMQCC_WARN ir_value_set_int(ir_value*, int i);
 #endif
 bool GMQCC_WARN ir_value_set_string(ir_value*, const char *s);
 bool GMQCC_WARN ir_value_set_vector(ir_value*, vector v);
+bool GMQCC_WARN ir_value_set_field(ir_value*, ir_value *fld);
 /*bool   ir_value_set_pointer_v(ir_value*, ir_value* p); */
 /*bool   ir_value_set_pointer_i(ir_value*, int i);       */
 
@@ -109,7 +111,7 @@ bool ir_value_lives(ir_value*, size_t);
 bool ir_values_overlap(const ir_value*, const ir_value*);
 
 void ir_value_dump(ir_value*, int (*oprintf)(const char*,...));
-void ir_value_dump_life(ir_value *self, int (*oprintf)(const char*,...));
+void ir_value_dump_life(const ir_value *self, int (*oprintf)(const char*,...));
 
 /* A vector of IR values */
 typedef struct {
@@ -259,6 +261,14 @@ typedef struct ir_function_s
 
     lex_ctx       context;
 
+    /* for prototypes - first we generate all the
+     * globals, and we remember teh function-defs
+     * so we can later fill in the entry pos
+     *
+     * remember the ID:
+     */
+    qcint code_function_def;
+
     /* for temp allocation */
     size_t run_id;
 
@@ -320,6 +330,6 @@ void ir_builder_dump(ir_builder*, int (*oprintf)(const char*, ...));
 
 /* This code assumes 32 bit floats while generating binary */
 extern int check_int_and_float_size
-[ (sizeof(int32_t) == sizeof(( (ir_value*)(NULL) )->constval.vvec.x)) ? 1 : -1 ];
+[ (sizeof(int32_t) == sizeof(qcfloat)) ? 1 : -1 ];
 
 #endif