]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
-fsingle-vector-defs to disable _x,_y,_z generation
authorWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 18 Dec 2012 11:47:48 +0000 (12:47 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 18 Dec 2012 11:47:48 +0000 (12:47 +0100)
doc/gmqcc.1
ir.c
opts.def

index 122fd18413fa5d2922d04096be084f517e50e231..0bc0160e591c8581429f4a30f3b86f6c39ba60f4 100644 (file)
@@ -251,3 +251,8 @@ Produce a linenumber file along with the output .dat file.
 Use C's operator precedence for ternary expressions. Unless your code
 depends on fteqcc-compatible behaviour, you'll want to use thi
 soption.
+.TP
+.B -fsingle-vector-defs
+Normally vectors generate 4 defs, once for the vector, and once for
+its components with _x, _y, _z suffixes. This option
+prevents components from being listed.
diff --git a/ir.c b/ir.c
index 9578e44a224ffa72d301114ceee755b23c48a836..a2b6dcc140edf6acd11d5894f182253f606d969e 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -3152,7 +3152,7 @@ static void gen_vector_defs(prog_section_def def, const char *name)
     char  *component;
     size_t len, i;
 
-    if (!name)
+    if (!name || OPTS_FLAG(SINGLE_VECTOR_DEFS))
         return;
 
     len = strlen(name);
@@ -3178,7 +3178,7 @@ static void gen_vector_fields(prog_section_field fld, const char *name)
     char  *component;
     size_t len, i;
 
-    if (!name)
+    if (!name || OPTS_FLAG(SINGLE_VECTOR_DEFS))
         return;
 
     len = strlen(name);
index f1adc7a6a9197cbc21dd6ad70304215f2466cb33..157f80fbf9b471735faf17423df720e8e68252a3 100644 (file)
--- a/opts.def
+++ b/opts.def
@@ -39,6 +39,7 @@
     GMQCC_DEFINE_FLAG(ASSIGN_FUNCTION_TYPES)
     GMQCC_DEFINE_FLAG(LNO)
     GMQCC_DEFINE_FLAG(CORRECT_TERNARY)
+    GMQCC_DEFINE_FLAG(SINGLE_VECTOR_DEFS)
 #endif
 
 /* warning flags */