]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnostics: use refs rather than pointers for diagnostic_{path,context}
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 9 Jul 2024 15:22:32 +0000 (11:22 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 9 Jul 2024 15:22:32 +0000 (11:22 -0400)
commit2d6e6a77e840b7b93d1f18708aa08ced8b46282e
tree896d159d1815e6db17c0d6b69107d013bf5d5e32
parent959c168e77f2e1a02b086536c69c99f7413e08bf
diagnostics: use refs rather than pointers for diagnostic_{path,context}

Use const & rather than const * in various places where it can't be null
and can't change.

No functional change intended.

gcc/ChangeLog:
* diagnostic-path.cc: Replace "const diagnostic_path *" with
"const diagnostic_path &" throughout, and "diagnostic_context *"
with "diagnostic context &".
* diagnostic.cc (diagnostic_context::show_any_path): Pass
reference in call to print_path.
* diagnostic.h (diagnostic_context::print_path): Convert param
to a reference.

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