On 08/12/2018 22:04, Luc Van Oostenryck wrote: > Currently, the syntax of attribute(address-space()) accept > an identifier as well as the usual 'address space number'. > > However, developers with a recent version can't benefit > of the display of address spaces by name before the kernel > definition of __user is changed. > > To let early adopters to already benefit, allow to specify > the address names via the command line (which ignore unknown > options and is thus forward compatible): -faddress-space-names. > > Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> > --- > lib.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/lib.c b/lib.c > index d8f652421..3d0fbf27b 100644 > --- a/lib.c > +++ b/lib.c > @@ -924,6 +924,19 @@ static int handle_fpasses(const char *arg, const char *opt, const struct flag *f > return 0; > } > > +static int handle_faddress_space_names(const char *arg, const char *opt, const struct flag *flag, int options) > +{ > + int max = ARRAY_SIZE(address_space_names); use MAX_AS_NAMES below instead? > + char *buf = (char *) opt; > + char *name; > + int i; > + > + for (i = 0; i < max && (name = strsep(&buf, ",")); i++) Hmm, i = 0, so the first address-space name is given the 'invalid' address-space number? > + address_space_names[i] = built_in_ident(name); > + > + return 1; > +} > + > static int handle_fdiagnostic_prefix(const char *arg, const char *opt, const struct flag *flag, int options) > { > switch (*opt) { > @@ -964,6 +977,7 @@ static int handle_fmax_warnings(const char *arg, const char *opt, const struct f > } > > static struct flag fflags[] = { > + { "address-space-names=",NULL, handle_faddress_space_names }, > { "diagnostic-prefix", NULL, handle_fdiagnostic_prefix }, > { "dump-ir", NULL, handle_fdump_ir }, > { "linearize", NULL, handle_fpasses, PASS_LINEARIZE },> Document -faddress-space-names and filter it out in cgcc. [that's me done for tonight!] ATB, Ramsay Jones