]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnostics: xml: add add_text_from_pp
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 11 Jun 2025 00:06:38 +0000 (20:06 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 11 Jun 2025 00:06:38 +0000 (20:06 -0400)
commit896edb1d0ae90ff1f60a6b894f04eb3c436790f5
treeede6245b4651935209b34e6b7de24e31fc664d32
parent3dcce649a1e0833a4c3bb9ced4b9c0b38c3fb8a5
diagnostics: xml: add add_text_from_pp

Various places use
  xp.add_text (pp_formatted_text (&pp))
Add a helper function for this.
No functional change intended.

gcc/ChangeLog:
* diagnostic-path-output.cc: Use xml::printer::add_text_from_pp.
* diagnostic-show-locus.cc: Likewise.
* xml-printer.h (xml::printer::add_text_from_pp): New decl.
* xml.cc (xml::node_with_children::add_text_from_pp): New.
(xml::printer::add_text_from_pp): New.
* xml.h (xml::node_with_children::add_text_from_pp): New decl.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/diagnostic-path-output.cc
gcc/diagnostic-show-locus.cc
gcc/xml-printer.h
gcc/xml.cc
gcc/xml.h