diff options
author | David Malcolm <dmalcolm@redhat.com> | 2024-10-09 21:26:08 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2024-10-09 21:26:08 -0400 |
commit | 8d0de31c931ddacc03e8bd1ce6d89f517c62c7b3 (patch) | |
tree | 84cba20a88c76848a0131754d8c30ded532f803e /gcc | |
parent | e95512e2d5a317e8c043f232158df4b38186e51c (diff) | |
download | gcc-8d0de31c931ddacc03e8bd1ce6d89f517c62c7b3.zip gcc-8d0de31c931ddacc03e8bd1ce6d89f517c62c7b3.tar.gz gcc-8d0de31c931ddacc03e8bd1ce6d89f517c62c7b3.tar.bz2 |
lto: reimplement print_lto_docs_link [PR116613]
gcc/ChangeLog:
PR other/116613
* lto-wrapper.cc (print_lto_docs_link): Use a format string rather
than building the string manually. Fix memory leak of "url" by
using label_text.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/lto-wrapper.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc index 141856c..9d7fe18 100644 --- a/gcc/lto-wrapper.cc +++ b/gcc/lto-wrapper.cc @@ -1366,19 +1366,10 @@ init_num_threads (void) void print_lto_docs_link () { - bool print_url = global_dc->m_printer->supports_urls_p (); - const char *url = global_dc->make_option_url (OPT_flto); - - pretty_printer pp; - pp.set_url_format (URL_FORMAT_DEFAULT); - pp_string (&pp, "see the "); - if (print_url) - pp_begin_url (&pp, url); - pp_string (&pp, "%<-flto%> option documentation"); - if (print_url) - pp_end_url (&pp); - pp_string (&pp, " for more information"); - inform (UNKNOWN_LOCATION, pp_formatted_text (&pp)); + label_text url = label_text::take (global_dc->make_option_url (OPT_flto)); + inform (UNKNOWN_LOCATION, + "see the %{%<-flto%> option documentation%} for more information", + url.get ()); } /* Test that a make command is present and working, return true if so. */ |