From patchwork Fri May 3 17:08:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 1931126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=iZQz4Tzt; 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 4VWHMB3Jr0z1ybC for ; Sat, 4 May 2024 03:08:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D15C438460BD for ; Fri, 3 May 2024 17:08:34 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id 4864E384AB58 for ; Fri, 3 May 2024 17:08:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4864E384AB58 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4864E384AB58 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::136 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714756098; cv=none; b=wvtzpDrc8Nu8etSvguYqPiiZNqg95KcHs9N6myCbBg44Gi/2jmwqDWtEcpvEBeJLr3tlZOXwAtMLvazIdstekHgzRnFp8uAqqqaW+yBV32F8ogluWT5JO9yGzIVM7TMa8xCmDdTGXs7MBWKPcFbEnhWCeSNb8Q5e0s/WZ3qrEeo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714756098; c=relaxed/simple; bh=4YN5xdtUhuo8rOcPSjaHGc0oaY3DEyKU2OgjKcGo61Y=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WRm3o/tZe6Py1XPnUAxqSo96nvOWjKKYgzsDCKTWVhlvT5CpVAyTeIU1GCaZvWLOawALPU2bPT4jMiSK0DXA7dkuIlyhBpe3FoLdPpP4ZNPuGPIqge74oujPtNfGIVnjGoBF4Tr4INWx7/Ob/PkvAJvbSb7+HaDnvngxjoWdFH0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-36c7ab8c60cso4182695ab.2 for ; Fri, 03 May 2024 10:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1714756096; x=1715360896; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qFI8iwpB2vN/FraIdbPfI7o9yA3eyDP9EKk5Uxn3U20=; b=iZQz4TztyPcEw5N5jfRZHdTwinETKX6rYMGn5Umb8K1eIT4QmOS3o59WQHTPfr8ELU ZJLfC7EmLpk8wMAEyD+nHiNOUpKNTqye5MgqA38vPIgGlY0jQsy4/yruXSF2L0eN4Ok7 1auKySYx1FhvVP365ZHvufipGgBUzrbAS8at63eRGvbr9ryeY6nSq88lFhzI2lQzCMoN FwJk/zsqa9m5sKQ15QlGJxMn2SnBjm4W5pPcwncvPgnj3k0DpUQTUIAqnwDhZ1BWbrMj XwvOuOkCjDpsZh1TotPzAfLfkiDjHSUmtqLBUTZK/5D1lZ0PzsXgyDHnYdiq1LoVJSlL oMCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714756096; x=1715360896; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qFI8iwpB2vN/FraIdbPfI7o9yA3eyDP9EKk5Uxn3U20=; b=Ot+6uRVMF+0gAFtBUbm3q9PRLGsrnurmPKrYOhpIQpu5h2aez0GRz/dwNym46V521u 9ZbDCXfRyGE97XUYqN/BcOhAK6SWPYFzuCTPG6s5PygRuNGp62y6MH5o0MRG+pU1WyyV BgqUHbCSpQdOkYiaUCc5HNajW5/CUDEmRsTiS+rUl5tApBCY6gxUgEJ/DzZl/XYmMbvq bIvbzmAGo1CRpE6vobU6QyO7v+xiwKgRoo5anekyKQ4sC5xaC3VNSWqbPkn2rAmwA0qc eGvRivvrfFad/QyFj5mQsfXoUPf9DbnUSSX+3hCQ8XOKieyNnFiDwC5GKYeOoCbdT3jF CQgw== X-Gm-Message-State: AOJu0YwwGF6rMlJWesytSkcgRp5BaXWHe3/9/PcYGbYu8qgoe53mEPkt HlY9BrPj8P8I27R3pxVxSb261SqFjemR/XeCWo1aA30YW8U/yFIRBSjLDP9g3Zbm7Ie0fQZKPqk = X-Google-Smtp-Source: AGHT+IFFIkE3Mm8mG9I5mEMQNdvl35wCi/EBTHq0JoacduULouUVavrxQviHeXtkBt14tdSCY8F4QA== X-Received: by 2002:a05:6e02:12cd:b0:36a:b4f2:ac17 with SMTP id i13-20020a056e0212cd00b0036ab4f2ac17mr4085986ilm.8.1714756096431; Fri, 03 May 2024 10:08:16 -0700 (PDT) Received: from localhost.localdomain (97-122-86-252.hlrn.qwest.net. [97.122.86.252]) by smtp.gmail.com with ESMTPSA id cn13-20020a056e02388d00b0036c0d39b257sm759331ilb.8.2024.05.03.10.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 10:08:16 -0700 (PDT) From: Tom Tromey To: gcc-patches@gcc.gnu.org Cc: Tom Tromey Subject: [PATCH] Use DW_TAG_module for Ada Date: Fri, 3 May 2024 11:08:04 -0600 Message-ID: <20240503170804.1006062-1-tromey@adacore.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 DWARF is not especially clear on the distinction between DW_TAG_namespace and DW_TAG_module, but I think that DW_TAG_module is more appropriate for Ada. This patch changes the compiler to do this. Note that the Ada compiler does not yet create NAMESPACE_DECLs. gcc * dwarf2out.cc (gen_namespace_die): Use DW_TAG_module for Ada. --- gcc/dwarf2out.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 1b0e8b5a5b2..1e46c27cdf7 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -26992,7 +26992,7 @@ gen_namespace_die (tree decl, dw_die_ref context_die) { /* Output a real namespace or module. */ context_die = setup_namespace_context (decl, comp_unit_die ()); - namespace_die = new_die (is_fortran () || is_dlang () + namespace_die = new_die (is_fortran () || is_dlang () || is_ada () ? DW_TAG_module : DW_TAG_namespace, context_die, decl); /* For Fortran modules defined in different CU don't add src coords. */