From patchwork Thu Aug 1 00:51:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 1967370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NTENq0cK; 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 4WZ9Qm3QWBz1ybX for ; Thu, 1 Aug 2024 10:52:00 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 921003858294 for ; Thu, 1 Aug 2024 00:51:58 +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.129.124]) by sourceware.org (Postfix) with ESMTP id 774873857022 for ; Thu, 1 Aug 2024 00:51:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 774873857022 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 774873857022 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722473479; cv=none; b=xhijk2kggPjv4hi6nk6qVp2TLKvdfZz+ihYbuLVOgiQf3pPC/SmHnpuqrA8aBlodR11GwulYJ8JTPaQ9QEgaG6392NJvg4mswTPIIyGmnYzCVHTtN6RD67/sOvprwdDscuSnLhfqDDTNCgftZPQuDBp0cTiotPTJAwY/V/pMbnU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722473479; c=relaxed/simple; bh=Ok1YBumYkv2i09SLrL7ll0rQH30itqWXsooGt3MR4R8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=k6BERM8cwyISS43vH411mt0x/EtU5HcAAqPT4lIkj8BmW+59Zr+P0YcaBb0FiMs5/1Jw4jgcZ2fkSMz0PDiuDBVo2BrzwTf+FG4PLyJPzG67tR5BxuDkzHJLjsQYzHrbPHvlWW51Fa1zqHF6AUtN6GAEz8qQ+B00AYgCPciA+/E= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722473473; 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=HMx3kGWgJRoFXO91pUPU/43bp2V+8/aH4VkI8ZhrD4w=; b=NTENq0cKCq3sRLZWf9YKtUz26ooaaFtmXKIIv0IMSQ1az2kwf3aBpvMKtzFBnrhLM9Wq78 /lVAYfj/SCZgE28s3Fi3CASxbvKWltttLZNFaXhG8g+wO+O67be7uDVOV1oEJXqGGtA0k/ nQroJn+LnCurUn7xnItLJ7Blr5AMm4I= Received: from mx-prod-mc-05.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-569-jFQ_OB4nNKyS-vozc-ma4A-1; Wed, 31 Jul 2024 20:51:12 -0400 X-MC-Unique: jFQ_OB4nNKyS-vozc-ma4A-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8BEE4195609E for ; Thu, 1 Aug 2024 00:51:11 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.22.33.183]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 52EA31955D42; Thu, 1 Aug 2024 00:51:09 +0000 (UTC) From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [pushed] diagnostics: handle logical locations with NULL name Date: Wed, 31 Jul 2024 20:51:07 -0400 Message-Id: <20240801005107.1003894-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 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_H3, 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 Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Successful run of analyzer integration tests on x86_64-pc-linux-gnu. Pushed to trunk as r15-2467-g55982d1682921f. gcc/ChangeLog: * diagnostic-path.cc (thread_event_printer::print_swimlane_for_event_range): Gracefully handle logical_location::get_name_for_path_output returning null. Signed-off-by: David Malcolm --- gcc/diagnostic-path.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/diagnostic-path.cc b/gcc/diagnostic-path.cc index b497d89d059..37751843f9a 100644 --- a/gcc/diagnostic-path.cc +++ b/gcc/diagnostic-path.cc @@ -860,7 +860,8 @@ public: if (const logical_location *logical_loc = range->m_logical_loc) { label_text name (logical_loc->get_name_for_path_output ()); - pp_printf (pp, "%qs: ", name.get ()); + if (name.get ()) + pp_printf (pp, "%qs: ", name.get ()); } if (range->m_start_idx == range->m_end_idx) pp_printf (pp, "event %i",