]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ir.h
-disasm switch for qcvm
[xonotic/gmqcc.git] / ir.h
diff --git a/ir.h b/ir.h
index dc29e79e297c109a4b203913fca87d91309d36dd..1059c6ed9c1753f5d15f7613b4f4fc6030ae47f4 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);
@@ -82,7 +83,7 @@ ir_value* ir_value_var(const char *name, int st, int vtype);
  */
 ir_value* ir_value_out(struct ir_function_s *owner, const char *name, int st, int vtype);
 void      ir_value_delete(ir_value*);
-void      ir_value_set_name(ir_value*, const char *name);
+bool      ir_value_set_name(ir_value*, const char *name);
 ir_value* ir_value_vector_member(ir_value*, unsigned int member);
 
 MEM_VECTOR_PROTO_ALL(ir_value, struct ir_instr_s*, reads);
@@ -110,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 {
@@ -304,6 +305,11 @@ typedef struct ir_builder_s
     MEM_VECTOR_MAKE(ir_function*, functions);
     MEM_VECTOR_MAKE(ir_value*, globals);
     MEM_VECTOR_MAKE(ir_value*, fields);
+
+    MEM_VECTOR_MAKE(const char*, filenames);
+    MEM_VECTOR_MAKE(qcint,       filestrings);
+    /* we cache the #IMMEDIATE string here */
+    qcint str_immediate;
 } ir_builder;
 
 ir_builder* ir_builder_new(const char *modulename);
@@ -312,8 +318,10 @@ void        ir_builder_delete(ir_builder*);
 bool ir_builder_set_name(ir_builder *self, const char *name);
 
 MEM_VECTOR_PROTO(ir_builder, ir_function*, functions);
-MEM_VECTOR_PROTO(ir_builder, ir_value*, globals);
-MEM_VECTOR_PROTO(ir_builder, ir_value*, fields);
+MEM_VECTOR_PROTO(ir_builder, ir_value*,    globals);
+MEM_VECTOR_PROTO(ir_builder, ir_value*,    fields);
+MEM_VECTOR_PROTO(ir_builder, const char*,  filenames);
+MEM_VECTOR_PROTO(ir_builder, qcint,        filestrings);
 
 ir_function* ir_builder_get_function(ir_builder*, const char *fun);
 ir_function* ir_builder_create_function(ir_builder*, const char *name, int outtype);