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); + char *buf = (char *) opt; + char *name; + int i; + + for (i = 0; i < max && (name = strsep(&buf, ",")); i++) + 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 }, -- 2.19.0