From patchwork Tue Jul 9 15:26:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 1958504 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JKSZPNN3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WJPwc4zlqz1xrJ for ; Wed, 10 Jul 2024 01:26:40 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D208B386C5B4 for ; Tue, 9 Jul 2024 15:26:38 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id DF0943846097 for ; Tue, 9 Jul 2024 15:26:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF0943846097 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DF0943846097 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720538778; cv=none; b=o40vTTQbEu383w1vWnIIDx2dyFoqYB45z2HPh9/+MLjbJJRKaj2uO7GcQPRxqoOyLjgrFcPvRVYxrYbOn5awpPpzKS4AJOh1mpcaGM/kM1xebMmEJp8QSYRorzo3MF8QOPSnCGhyMHDMkzcYttnUBkt/OMhMOSA0fQhS9fYoJM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720538778; c=relaxed/simple; bh=74q18FbSCug5FJXNc7C8ls4ReJIqtcoGrOTrBNC47aQ=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=cXa8CcvtHWMyT3Nz0OJwCPO18tSlGAIUZTDiiGpqq/ccv/pgzmmQuv9/eDUllAOm0g4F6O9D/Hv+xwLrxENCwCVuA3+AtMopaz98p67OfVL+/tx4VdYf4QnUO2FlOAwxMSVFjGGoReNxAKR3XMWln5cNIyjdiE9qvjPBhwyKmyg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720538774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PArSGP+VwrO3AEGbA3/cwx1poJnlWnL2qFkzal1SysU=; b=JKSZPNN3uTelhtjC5haiTzCp0TTvufKjbAfd3SErftJWT+3FV8SSm1f5B7HrtzGG2+Yycw PqHfJV3OypCFJFfqdtCyQW5Y/oYs/Im7vUtrN9P1BepolphWEw4DHLXMlX6lwJhveev5m4 GX+w86BLbfdkRYHUIiVWbXjY10qi0AA= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-474-YOaqAYrMOyeZQdtOVMT_Bw-1; Tue, 09 Jul 2024 11:26:12 -0400 X-MC-Unique: YOaqAYrMOyeZQdtOVMT_Bw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 20E9719560AE for ; Tue, 9 Jul 2024 15:26:10 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.22.16.76]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4D5FA19560AA; Tue, 9 Jul 2024 15:26:08 +0000 (UTC) From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [pushed] diagnostics: use refs rather than pointers for diagnostic_{path, context} Date: Tue, 9 Jul 2024 11:26:05 -0400 Message-Id: <20240709152605.2250030-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Use const & rather than const * in various places where it can't be null and can't change. No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-1913-g2d6e6a77e840b7. 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 --- gcc/diagnostic-path.cc | 101 ++++++++++++++++++++--------------------- gcc/diagnostic.cc | 2 +- gcc/diagnostic.h | 2 +- 3 files changed, 52 insertions(+), 53 deletions(-) diff --git a/gcc/diagnostic-path.cc b/gcc/diagnostic-path.cc index e470bd29fdd..f279aead6c5 100644 --- a/gcc/diagnostic-path.cc +++ b/gcc/diagnostic-path.cc @@ -225,7 +225,7 @@ class path_label : public range_label { public: path_label (const diagnostic_context &ctxt, - const diagnostic_path *path, + const diagnostic_path &path, unsigned start_idx) : m_ctxt (ctxt), m_path (path), m_start_idx (start_idx), m_effects (*this) {} @@ -233,7 +233,7 @@ class path_label : public range_label label_text get_text (unsigned range_idx) const final override { unsigned event_idx = m_start_idx + range_idx; - const diagnostic_event &event = m_path->get_event (event_idx); + const diagnostic_event &event = m_path.get_event (event_idx); /* Get the description of the event, perhaps with colorization: normally, we don't colorize within a range_label, but this @@ -305,7 +305,7 @@ class path_label : public range_label const diagnostic_event &get_event (unsigned range_idx) const { unsigned event_idx = m_start_idx + range_idx; - return m_path->get_event (event_idx); + return m_path.get_event (event_idx); } const diagnostic_event *get_prev_event (unsigned range_idx) const @@ -313,11 +313,11 @@ class path_label : public range_label if (m_start_idx + range_idx == 0) return nullptr; unsigned event_idx = m_start_idx + range_idx - 1; - return &m_path->get_event (event_idx); + return &m_path.get_event (event_idx); } const diagnostic_context &m_ctxt; - const diagnostic_path *m_path; + const diagnostic_path &m_path; unsigned m_start_idx; path_label_effects m_effects; }; @@ -508,7 +508,7 @@ struct event_range }; event_range (const diagnostic_context &ctxt, - const diagnostic_path *path, unsigned start_idx, + const diagnostic_path &path, unsigned start_idx, const diagnostic_event &initial_event, per_thread_summary &t, bool show_event_links) @@ -559,7 +559,7 @@ struct event_range unsigned new_ev_idx, bool check_rich_locations) { - if (!can_consolidate_events (*m_path, + if (!can_consolidate_events (m_path, m_initial_event, m_start_idx, new_ev, new_ev_idx, check_rich_locations)) @@ -574,7 +574,7 @@ struct event_range = get_per_source_line_info (exploc.line); const diagnostic_event *prev_event = nullptr; if (new_ev_idx > 0) - prev_event = &m_path->get_event (new_ev_idx - 1); + prev_event = &m_path.get_event (new_ev_idx - 1); const bool has_in_edge = (prev_event ? prev_event->connect_to_next_event_p () : false); @@ -604,7 +604,7 @@ struct event_range /* Print the events in this range to DC, typically as a single call to the printer's diagnostic_show_locus. */ - void print (diagnostic_context *dc, pretty_printer *pp, + void print (diagnostic_context &dc, pretty_printer *pp, diagnostic_source_effect_info *effect_info) { location_t initial_loc = m_initial_event.get_location (); @@ -612,13 +612,13 @@ struct event_range /* Emit a span indicating the filename (and line/column) if the line has changed relative to the last call to diagnostic_show_locus. */ - if (dc->m_source_printing.enabled) + if (dc.m_source_printing.enabled) { expanded_location exploc = linemap_client_expand_location_to_spelling_point (line_table, initial_loc, LOCATION_ASPECT_CARET); - if (exploc.file != LOCATION_FILE (dc->m_last_location)) - diagnostic_start_span (dc) (dc, exploc); + if (exploc.file != LOCATION_FILE (dc.m_last_location)) + diagnostic_start_span (&dc) (&dc, exploc); } /* If we have an UNKNOWN_LOCATION (or BUILTINS_LOCATION) as the @@ -632,7 +632,7 @@ struct event_range { for (unsigned i = m_start_idx; i <= m_end_idx; i++) { - const diagnostic_event &iter_event = m_path->get_event (i); + const diagnostic_event &iter_event = m_path.get_event (i); diagnostic_event_id_t event_id (i); label_text event_text (iter_event.get_desc (true)); pp_printf (pp, " %@: %s", &event_id, event_text.get ()); @@ -642,18 +642,18 @@ struct event_range } /* Call diagnostic_show_locus to show the events using labels. */ - diagnostic_show_locus (dc, &m_richloc, DK_DIAGNOSTIC_PATH, pp, + diagnostic_show_locus (&dc, &m_richloc, DK_DIAGNOSTIC_PATH, pp, effect_info); /* If we have a macro expansion, show the expansion to the user. */ if (linemap_location_from_macro_expansion_p (line_table, initial_loc)) { gcc_assert (m_start_idx == m_end_idx); - maybe_unwind_expanded_macro_loc (dc, initial_loc); + maybe_unwind_expanded_macro_loc (&dc, initial_loc); } } - const diagnostic_path *m_path; + const diagnostic_path &m_path; const diagnostic_event &m_initial_event; const logical_location *m_logical_loc; int m_stack_depth; @@ -758,7 +758,7 @@ path_summary::path_summary (const diagnostic_context &ctxt, idx, check_rich_locations)) continue; - cur_event_range = new event_range (ctxt, &path, idx, event, pts, + cur_event_range = new event_range (ctxt, path, idx, event, pts, show_event_links); m_ranges.safe_push (cur_event_range); pts.m_event_ranges.safe_push (cur_event_range); @@ -812,7 +812,7 @@ public: } void - print_swimlane_for_event_range (diagnostic_context *dc, + print_swimlane_for_event_range (diagnostic_context &dc, pretty_printer *pp, event_range *range, diagnostic_source_effect_info *effect_info) @@ -823,7 +823,7 @@ public: const char *end_line_color = colorize_stop (pp_show_color (pp)); text_art::ascii_theme fallback_theme; - text_art::theme *theme = dc->get_diagram_theme (); + text_art::theme *theme = dc.get_diagram_theme (); if (!theme) theme = &fallback_theme; @@ -1022,24 +1022,25 @@ private: For events with UNKNOWN_LOCATION, print a summary of each the event. */ static void -print_path_summary_as_text (const path_summary *ps, diagnostic_context *dc, +print_path_summary_as_text (const path_summary &ps, + diagnostic_context &dc, bool show_depths) { - pretty_printer *pp = dc->printer; + pretty_printer *pp = dc.printer; std::vector thread_event_printers; - for (auto t : ps->m_per_thread_summary) + for (auto t : ps.m_per_thread_summary) thread_event_printers.push_back (thread_event_printer (*t, show_depths)); unsigned i; event_range *range; int last_out_edge_column = -1; - FOR_EACH_VEC_ELT (ps->m_ranges, i, range) + FOR_EACH_VEC_ELT (ps.m_ranges, i, range) { const int swimlane_idx = range->m_per_thread_summary.get_swimlane_index (); - if (ps->multithreaded_p ()) - if (i == 0 || ps->m_ranges[i - 1]->m_thread_id != range->m_thread_id) + if (ps.multithreaded_p ()) + if (i == 0 || ps.m_ranges[i - 1]->m_thread_id != range->m_thread_id) { if (i > 0) pp_newline (pp); @@ -1062,11 +1063,9 @@ print_path_summary_as_text (const path_summary *ps, diagnostic_context *dc, /* Print PATH according to this context's path_format. */ void -diagnostic_context::print_path (const diagnostic_path *path) +diagnostic_context::print_path (const diagnostic_path &path) { - gcc_assert (path); - - const unsigned num_events = path->num_events (); + const unsigned num_events = path.num_events (); switch (get_path_format ()) { @@ -1079,7 +1078,7 @@ diagnostic_context::print_path (const diagnostic_path *path) /* A note per event. */ for (unsigned i = 0; i < num_events; i++) { - const diagnostic_event &event = path->get_event (i); + const diagnostic_event &event = path.get_event (i); label_text event_text (event.get_desc (false)); gcc_assert (event_text.get ()); diagnostic_event_id_t event_id (i); @@ -1114,11 +1113,11 @@ diagnostic_context::print_path (const diagnostic_path *path) case DPF_INLINE_EVENTS: { /* Consolidate related events. */ - path_summary summary (*this, *path, true, + path_summary summary (*this, path, true, m_source_printing.show_event_links_p); char *saved_prefix = pp_take_prefix (this->printer); pp_set_prefix (this->printer, NULL); - print_path_summary_as_text (&summary, this, + print_path_summary_as_text (summary, *this, show_path_depths_p ()); pp_flush (this->printer); pp_set_prefix (this->printer, saved_prefix); @@ -1164,7 +1163,7 @@ test_empty_path (pretty_printer *event_pp) path_summary summary (dc, path, false); ASSERT_EQ (summary.get_num_ranges (), 0); - print_path_summary_as_text (&summary, &dc, true); + print_path_summary_as_text (summary, dc, true); ASSERT_STREQ ("", pp_formatted_text (dc.printer)); } @@ -1185,7 +1184,7 @@ test_intraprocedural_path (pretty_printer *event_pp) path_summary summary (dc, path, false); ASSERT_EQ (summary.get_num_ranges (), 1); - print_path_summary_as_text (&summary, &dc, true); + print_path_summary_as_text (summary, dc, true); ASSERT_STREQ (" `foo': events 1-2 (depth 0)\n" " (1): first `free'\n" " (2): double `free'\n", @@ -1221,7 +1220,7 @@ test_interprocedural_path_1 (pretty_printer *event_pp) ASSERT_EQ (summary.get_num_ranges (), 9); dc.set_text_art_charset (DIAGNOSTICS_TEXT_ART_CHARSET_ASCII); - print_path_summary_as_text (&summary, &dc, true); + print_path_summary_as_text (summary, dc, true); ASSERT_STREQ (" `test': events 1-2 (depth 0)\n" " |\n" @@ -1278,7 +1277,7 @@ test_interprocedural_path_1 (pretty_printer *event_pp) test_diagnostic_context dc; dc.set_text_art_charset (DIAGNOSTICS_TEXT_ART_CHARSET_UNICODE); path_summary summary (dc, path, false); - print_path_summary_as_text (&summary, &dc, true); + print_path_summary_as_text (summary, dc, true); ASSERT_STREQ (" `test': events 1-2 (depth 0)\n" " │\n" @@ -1355,7 +1354,7 @@ test_interprocedural_path_2 (pretty_printer *event_pp) path_summary summary (dc, path, false); ASSERT_EQ (summary.get_num_ranges (), 5); dc.set_text_art_charset (DIAGNOSTICS_TEXT_ART_CHARSET_ASCII); - print_path_summary_as_text (&summary, &dc, true); + print_path_summary_as_text (summary, dc, true); ASSERT_STREQ (" `foo': events 1-2 (depth 0)\n" " |\n" @@ -1388,7 +1387,7 @@ test_interprocedural_path_2 (pretty_printer *event_pp) test_diagnostic_context dc; dc.set_text_art_charset (DIAGNOSTICS_TEXT_ART_CHARSET_UNICODE); path_summary summary (dc, path, false); - print_path_summary_as_text (&summary, &dc, true); + print_path_summary_as_text (summary, dc, true); ASSERT_STREQ (" `foo': events 1-2 (depth 0)\n" " │\n" @@ -1440,7 +1439,7 @@ test_recursion (pretty_printer *event_pp) path_summary summary (dc, path, false); ASSERT_EQ (summary.get_num_ranges (), 4); - print_path_summary_as_text (&summary, &dc, true); + print_path_summary_as_text (summary, dc, true); ASSERT_STREQ (" `factorial': events 1-2 (depth 0)\n" " |\n" @@ -1468,7 +1467,7 @@ test_recursion (pretty_printer *event_pp) dc.set_text_art_charset (DIAGNOSTICS_TEXT_ART_CHARSET_UNICODE); path_summary summary (dc, path, false); - print_path_summary_as_text (&summary, &dc, true); + print_path_summary_as_text (summary, dc, true); ASSERT_STREQ (" `factorial': events 1-2 (depth 0)\n" " │\n" @@ -1588,7 +1587,7 @@ test_control_flow_1 (const line_table_case &case_, dc.set_text_art_charset (DIAGNOSTICS_TEXT_ART_CHARSET_ASCII); dc.m_source_printing.show_event_links_p = true; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ (" events 1-3\n" "FILENAME:3:7:\n" @@ -1612,7 +1611,7 @@ test_control_flow_1 (const line_table_case &case_, dc.set_text_art_charset (DIAGNOSTICS_TEXT_ART_CHARSET_ASCII); dc.m_source_printing.show_event_links_p = false; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ (" events 1-3\n" "FILENAME:3:7:\n" @@ -1634,7 +1633,7 @@ test_control_flow_1 (const line_table_case &case_, dc.m_source_printing.show_line_numbers_p = true; dc.m_source_printing.show_event_links_p = true; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ (" events 1-3\n" "FILENAME:3:7:\n" @@ -1659,7 +1658,7 @@ test_control_flow_1 (const line_table_case &case_, dc.m_source_printing.show_line_numbers_p = true; dc.m_source_printing.show_event_links_p = false; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ (" events 1-3\n" "FILENAME:3:7:\n" @@ -1680,7 +1679,7 @@ test_control_flow_1 (const line_table_case &case_, dc.set_text_art_charset (DIAGNOSTICS_TEXT_ART_CHARSET_UNICODE); dc.m_source_printing.show_event_links_p = true; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ (" events 1-3\n" "FILENAME:3:7:\n" @@ -1705,7 +1704,7 @@ test_control_flow_1 (const line_table_case &case_, dc.m_source_printing.show_event_links_p = true; dc.m_source_printing.show_line_numbers_p = true; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ (" events 1-3\n" "FILENAME:3:7:\n" @@ -1774,7 +1773,7 @@ test_control_flow_2 (const line_table_case &case_, dc.m_source_printing.show_event_links_p = true; dc.m_source_printing.show_line_numbers_p = true; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ (" events 1-3\n" "FILENAME:4:31:\n" @@ -1859,7 +1858,7 @@ test_control_flow_3 (const line_table_case &case_, dc.m_source_printing.show_event_links_p = true; dc.m_source_printing.show_line_numbers_p = true; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ (" events 1-2\n" "FILENAME:3:19:\n" @@ -1915,7 +1914,7 @@ assert_cfg_edge_path_streq (const location &loc, dc.m_source_printing.show_event_links_p = true; dc.m_source_printing.show_line_numbers_p = true; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ_AT (loc, expected_str, pp_formatted_text (dc.printer)); } @@ -2237,7 +2236,7 @@ test_control_flow_5 (const line_table_case &case_, dc.m_source_printing.show_event_links_p = true; dc.m_source_printing.show_line_numbers_p = true; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ (" events 1-5\n" "FILENAME:1:6:\n" @@ -2324,7 +2323,7 @@ test_control_flow_6 (const line_table_case &case_, dc.m_source_printing.show_event_links_p = true; dc.m_source_printing.show_line_numbers_p = true; path_summary summary (dc, path, true); - print_path_summary_as_text (&summary, &dc, false); + print_path_summary_as_text (summary, dc, false); ASSERT_STREQ (" events 1-3\n" "FILENAME:6:25:\n" diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc index bf2bd0526c1..196f34d9a2f 100644 --- a/gcc/diagnostic.cc +++ b/gcc/diagnostic.cc @@ -906,7 +906,7 @@ diagnostic_context::show_any_path (const diagnostic_info &diagnostic) if (!path) return; - print_path (path); + print_path (*path); } /* class logical_location. */ diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index 8c613234627..4dc448928d5 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -591,7 +591,7 @@ private: pretty_printer *pp, diagnostic_source_effect_info *effect_info); - void print_path (const diagnostic_path *path); + void print_path (const diagnostic_path &path); /* Data members. Ideally, all of these would be private and have "m_" prefixes. */