diff options
| author | David Malcolm <dmalcolm@redhat.com> | 2025-07-25 15:13:37 -0400 |
|---|---|---|
| committer | David Malcolm <dmalcolm@redhat.com> | 2025-07-25 15:13:37 -0400 |
| commit | e31ec9ee65386a7cf978c204e123b9a97eb9c296 (patch) | |
| tree | 8e24f260ed424ecf996334275b9616b00755d7e4 /libcpp | |
| parent | 5ac3308484c78a7c4fa2a798df587a8bd507f030 (diff) | |
diagnostics: introduce diagnostics/source-printing.cc
Move diagnostic-show-locus.cc to diagnostics/source-printing.cc
Move diagnostic-label-effects.h to diagnostics/source-printing-effects.h
Move selftest-diagnostic-show-locus.h
to diagnostics/selftest-source-printing.h
No functional change intended.
gcc/ChangeLog:
* Makefile.in (OBJS): Replace diagnostic-show-locus.o with
diagnostics/source-printing.o.
* diagnostic.h (class diagnostic_source_effect_info): Replace
with...
(class diagnotics::source_effect_info): ...this.
* diagnostics/paths-output.cc: Likewise. Update for move of
"diagnostic-label-effects.h" to
"diagnostics/source-printing-effects.h".
* diagnostics/sarif-sink.cc: Update for move of
"selftest-diagnostic-show-locus.h" to
"diagnostics/selftest-source-printing.h".
* selftest-diagnostic-show-locus.h: Move to...
* diagnostics/selftest-source-printing.h: ...here.
* diagnostic-label-effects.h: Move to...
* diagnostics/source-printing-effects.h: ...here, updating
for above changes.
* diagnostic-show-locus.cc: Move to...
* diagnostics/source-printing.cc: ...here.
* gcc-rich-location.h: Likewise.
* selftest-run-tests.cc: Likewise.
* selftest.h: Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/plugin/show-template-tree-color-labels.C: Update for
moves to "source-printing".
* gcc.dg/plugin/diagnostic-test-show-locus.py: Likewise.
libcpp/ChangeLog:
* include/cpplib.h: Update for moves to "source-printing".
* include/rich-location.h (class label_effects): Move to...
(class diagnostics::label_effects): ...here.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'libcpp')
| -rw-r--r-- | libcpp/include/cpplib.h | 3 | ||||
| -rw-r--r-- | libcpp/include/rich-location.h | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 7c147ae5847..75efdcd55d5 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -1610,7 +1610,8 @@ struct cpp_decoded_char This is a tabstop value, along with a callback for getting the widths of characters. Normally this callback is cpp_wcwidth, but we support other schemes for escaping non-ASCII unicode as a series of - ASCII chars when printing the user's source code in diagnostic-show-locus.cc + ASCII chars when printing the user's source code in + gcc/diagnostics/source-printing.cc For example, consider: - the Unicode character U+03C0 "GREEK SMALL LETTER PI" (UTF-8: 0xCF 0x80) diff --git a/libcpp/include/rich-location.h b/libcpp/include/rich-location.h index caa97692947..c74e80e9f61 100644 --- a/libcpp/include/rich-location.h +++ b/libcpp/include/rich-location.h @@ -25,7 +25,7 @@ along with this program; see the file COPYING3. If not see #include "label-text.h" class range_label; -class label_effects; +namespace diagnostics { class label_effects; } /* A hint to diagnostic_show_locus on how to print a source range within a rich_location. @@ -596,7 +596,8 @@ class range_label virtual label_text get_text (unsigned range_idx) const = 0; /* Get any special effects for the label (e.g. links to other labels). */ - virtual const label_effects *get_effects (unsigned /*range_idx*/) const + virtual const diagnostics::label_effects * + get_effects (unsigned /*range_idx*/) const { return nullptr; } |
