]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ir.c
Update doc/specification.tex
[xonotic/gmqcc.git] / ir.c
diff --git a/ir.c b/ir.c
index 0f437aaeb0551ae220cf39fa766d8b12655ed181..5d8085a18947e6fddbf3998b565afe71394c5eaa 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -83,11 +83,11 @@ uint16_t type_store_instr[TYPE_COUNT] = {
 
     INSTR_STORE_V, /* variant, should never be accessed */
 
-    AINSTR_END, /* struct */
-    AINSTR_END, /* union  */
-    AINSTR_END, /* array  */
-    AINSTR_END, /* nil    */
-    AINSTR_END, /* noexpr */
+    VINSTR_END, /* struct */
+    VINSTR_END, /* union  */
+    VINSTR_END, /* array  */
+    VINSTR_END, /* nil    */
+    VINSTR_END, /* noexpr */
 };
 
 uint16_t field_store_instr[TYPE_COUNT] = {
@@ -107,11 +107,11 @@ uint16_t field_store_instr[TYPE_COUNT] = {
 
     INSTR_STORE_V, /* variant, should never be accessed */
 
-    AINSTR_END, /* struct */
-    AINSTR_END, /* union  */
-    AINSTR_END, /* array  */
-    AINSTR_END, /* nil    */
-    AINSTR_END, /* noexpr */
+    VINSTR_END, /* struct */
+    VINSTR_END, /* union  */
+    VINSTR_END, /* array  */
+    VINSTR_END, /* nil    */
+    VINSTR_END, /* noexpr */
 };
 
 uint16_t type_storep_instr[TYPE_COUNT] = {
@@ -131,11 +131,11 @@ uint16_t type_storep_instr[TYPE_COUNT] = {
 
     INSTR_STOREP_V, /* variant, should never be accessed */
 
-    AINSTR_END, /* struct */
-    AINSTR_END, /* union  */
-    AINSTR_END, /* array  */
-    AINSTR_END, /* nil    */
-    AINSTR_END, /* noexpr */
+    VINSTR_END, /* struct */
+    VINSTR_END, /* union  */
+    VINSTR_END, /* array  */
+    VINSTR_END, /* nil    */
+    VINSTR_END, /* noexpr */
 };
 
 uint16_t type_eq_instr[TYPE_COUNT] = {
@@ -155,11 +155,11 @@ uint16_t type_eq_instr[TYPE_COUNT] = {
 
     INSTR_EQ_V, /* variant, should never be accessed */
 
-    AINSTR_END, /* struct */
-    AINSTR_END, /* union  */
-    AINSTR_END, /* array  */
-    AINSTR_END, /* nil    */
-    AINSTR_END, /* noexpr */
+    VINSTR_END, /* struct */
+    VINSTR_END, /* union  */
+    VINSTR_END, /* array  */
+    VINSTR_END, /* nil    */
+    VINSTR_END, /* noexpr */
 };
 
 uint16_t type_ne_instr[TYPE_COUNT] = {
@@ -179,11 +179,11 @@ uint16_t type_ne_instr[TYPE_COUNT] = {
 
     INSTR_NE_V, /* variant, should never be accessed */
 
-    AINSTR_END, /* struct */
-    AINSTR_END, /* union  */
-    AINSTR_END, /* array  */
-    AINSTR_END, /* nil    */
-    AINSTR_END, /* noexpr */
+    VINSTR_END, /* struct */
+    VINSTR_END, /* union  */
+    VINSTR_END, /* array  */
+    VINSTR_END, /* nil    */
+    VINSTR_END, /* noexpr */
 };
 
 uint16_t type_not_instr[TYPE_COUNT] = {
@@ -203,11 +203,11 @@ uint16_t type_not_instr[TYPE_COUNT] = {
 
     INSTR_NOT_V, /* variant, should never be accessed */
 
-    AINSTR_END, /* struct */
-    AINSTR_END, /* union  */
-    AINSTR_END, /* array  */
-    AINSTR_END, /* nil    */
-    AINSTR_END, /* noexpr */
+    VINSTR_END, /* struct */
+    VINSTR_END, /* union  */
+    VINSTR_END, /* array  */
+    VINSTR_END, /* nil    */
+    VINSTR_END, /* noexpr */
 };
 
 /* protos */
@@ -3228,7 +3228,7 @@ static bool gen_function_locals(ir_builder *ir, ir_value *global)
     irfun = global->constval.vfunc;
     def   = code_functions + irfun->code_function_def;
 
-    if (OPTION_VALUE_BOOL(OPTION_G) ||
+    if (OPTS_OPTION_BOOL(OPTION_G) ||
         !OPTS_OPTIMIZATION(OPTIM_OVERLAP_LOCALS)        ||
         (irfun->flags & IR_FLAG_MASK_NO_OVERLAP))
     {
@@ -3379,7 +3379,7 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
     def.type   = global->vtype;
     def.offset = vec_size(code_globals);
     def.name   = 0;
-    if (OPTION_VALUE_BOOL(OPTION_G) || !islocal)
+    if (OPTS_OPTION_BOOL(OPTION_G) || !islocal)
     {
         pushdef = true;
 
@@ -3555,7 +3555,7 @@ static bool ir_builder_gen_field(ir_builder *self, ir_value *field)
     def.offset = (uint16_t)vec_size(code_globals);
 
     /* create a global named the same as the field */
-    if (OPTION_VALUE_U32(OPTION_STANDARD) == COMPILER_GMQCC) {
+    if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_GMQCC) {
         /* in our standard, the global gets a dot prefix */
         size_t len = strlen(field->name);
         char name[1024];
@@ -3693,7 +3693,7 @@ bool ir_builder_generate(ir_builder *self, const char *filename)
         code_push_statement(&stmt, vec_last(code_linenums));
     }
 
-    if (OPTION_VALUE_BOOL(OPTION_PP_ONLY))
+    if (OPTS_OPTION_BOOL(OPTION_PP_ONLY))
         return true;
 
     if (vec_size(code_statements) != vec_size(code_linenums)) {
@@ -3714,7 +3714,7 @@ bool ir_builder_generate(ir_builder *self, const char *filename)
         memcpy(vec_add(lnofile, 5), ".lno", 5);
     }
 
-    if (!OPTION_VALUE_BOOL(OPTION_QUIET)) {
+    if (!OPTS_OPTION_BOOL(OPTION_QUIET)) {
         if (lnofile)
             con_out("writing '%s' and '%s'...\n", filename, lnofile);
         else