From: Wolfgang (Blub) Bumiller Date: Tue, 18 Dec 2012 11:47:48 +0000 (+0100) Subject: -fsingle-vector-defs to disable _x,_y,_z generation X-Git-Tag: 0.1.9~63 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d09ab90f24204ad8e758108746783aee115708d8;p=xonotic%2Fgmqcc.git -fsingle-vector-defs to disable _x,_y,_z generation --- diff --git a/doc/gmqcc.1 b/doc/gmqcc.1 index 122fd18..0bc0160 100644 --- a/doc/gmqcc.1 +++ b/doc/gmqcc.1 @@ -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 9578e44..a2b6dcc 100644 --- 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); diff --git a/opts.def b/opts.def index f1adc7a..157f80f 100644 --- 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 */