]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
type_store_instr[] to get an INSTR_STORE_x by type
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Tue, 3 Jul 2012 20:46:38 +0000 (22:46 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Tue, 3 Jul 2012 20:46:38 +0000 (22:46 +0200)
gmqcc.h
ir.c

diff --git a/gmqcc.h b/gmqcc.h
index e814bce6c9ac70f23c1e37c79b88e52c5d476fa7..6a56675683904297cf8bf9538fe5f37f9b46d777 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -371,6 +371,7 @@ enum {
 };
 
 extern size_t type_sizeof[TYPE_COUNT];
+extern uint16_t type_store_instr[TYPE_COUNT];
 
 /*
  * Each paramater incerements by 3 since vector types hold
diff --git a/ir.c b/ir.c
index 1f0773f278209fa77a82ca81421c5aba39f6d98c..48c4ccf032da0602350408537fc0dab8cd7bc4dc 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -44,6 +44,21 @@ size_t type_sizeof[TYPE_COUNT] = {
     3, /* TYPE_VARIANT  */
 };
 
+uint16_t type_store_instr[TYPE_COUNT] = {
+    INSTR_STORE_F, /* should use I when having integer support */
+    INSTR_STORE_S,
+    INSTR_STORE_F,
+    INSTR_STORE_V,
+    INSTR_STORE_ENT,
+    INSTR_STORE_FLD,
+    INSTR_STORE_FNC,
+    INSTR_STORE_ENT, /* should use I */
+#if 0
+    INSTR_STORE_ENT, /* integer type */
+#endif
+    INSTR_STORE_V, /* variant, should never be accessed */
+};
+
 MEM_VEC_FUNCTIONS(ir_value_vector, ir_value*, v)
 
 /***********************************************************************