From d09ab90f24204ad8e758108746783aee115708d8 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Tue, 18 Dec 2012 12:47:48 +0100 Subject: [PATCH] -fsingle-vector-defs to disable _x,_y,_z generation --- doc/gmqcc.1 | 5 +++++ ir.c | 4 ++-- opts.def | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) 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 */ -- 2.39.2