aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2024-01-04 09:36:28 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2024-01-04 09:36:28 -0500
commit6ecc1e32353e331137647a65a611eeb01b22184c (patch)
treeb8c38faaf78bd30663e798d5583b7788bb862e73 /gcc/opts.h
parent5bb18475a10d05d2aebf37db73ebf36c6912104d (diff)
downloadgcc-6ecc1e32353e331137647a65a611eeb01b22184c.zip
gcc-6ecc1e32353e331137647a65a611eeb01b22184c.tar.gz
gcc-6ecc1e32353e331137647a65a611eeb01b22184c.tar.bz2
opts: add logic to generate options-urls.cc
Changed in v2: - split out from the code that uses this - now handles lang-specific URLs, as well as generic URLs - the generated options-urls.cc now contains a function with a switch statement, rather than an array, to support lang-specific URLs: const char * get_opt_url_suffix (int option_index, unsigned lang_mask) { switch (option_index) { [...snip...] case OPT_B: if (lang_mask & CL_D) return "gdc/Directory-Options.html#index-B"; return "gcc/Directory-Options.html#index-B"; [...snip...] return nullptr; } gcc/ChangeLog: * Makefile.in (ALL_OPT_URL_FILES): New. (GCC_OBJS): Add options-urls.o. (OBJS): Likewise. (OBJS-libcommon): Likewise. (s-options): Depend on $(ALL_OPT_URL_FILES), and add this to inputs to opt-gather.awk. (options-urls.cc): New Makefile target. * opt-functions.awk (url_suffix): New function. (lang_url_suffix): New function. * options-urls-cc-gen.awk: New file. * opts.h (get_opt_url_suffix): New decl. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/opts.h')
-rw-r--r--gcc/opts.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/opts.h b/gcc/opts.h
index 866a137..20419e4 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -152,6 +152,10 @@ struct cl_option_state {
extern const struct cl_option cl_options[];
extern const unsigned int cl_options_count;
+
+extern const char *
+get_opt_url_suffix (int option_index, unsigned lang_mask);
+
#ifdef ENABLE_PLUGIN
extern const struct cl_var cl_vars[];
#endif