From patchwork Thu Jul 8 13:50:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 1502305 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=adacore-com.20150623.gappssmtp.com header.i=@adacore-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=E8f/yAa2; dkim-atps=neutral Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GLJ0S5NJbz9sWq for ; Fri, 9 Jul 2021 00:03:04 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3ACCF3AA7CB6 for ; Thu, 8 Jul 2021 14:03:02 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id 90C5B398B88C for ; Thu, 8 Jul 2021 13:50:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 90C5B398B88C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-lf1-x132.google.com with SMTP id t17so15882469lfq.0 for ; Thu, 08 Jul 2021 06:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=fxPy3fff9b08Ej5RZoXr2atvQzaaCHdUL6Zgdd5b4Dc=; b=E8f/yAa2h1GPfLMct31/zTrzT2OUy9D2db3OnWSUixkNxmUVDHKI5Ez7qhI6HZSWWb gJ0Q2fkOJH/B6Vsw7jcHaBucglwWlaA/sLT+oElZOcubjkpHn8KiWuWqzctqxHqDmQMT VdPL6WTKH4jkQm95uT1rZq9hzSG32BYyA9IoZnaK8O3yyXOIQov16GPzJ9K1vplLqyGE JivjoLmoX70kVRtlh/kp9KZRwm+EPe49ZH9vuIsCCRQfuhHC8KpbgcKEdbbB3IBVCI67 UnwNmI+3I8fR4aGnsVf1fl4NEX5xi5rLbCBfUzic1K+/2bpEAwP6gK46QIDBsF4VPTYi onQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=fxPy3fff9b08Ej5RZoXr2atvQzaaCHdUL6Zgdd5b4Dc=; b=cjyzI/6cmMppJvY/g/5W3UlvIANU8lKvYeC/ujPn55z1OESBwOJUqgDu+PqYWldGMp HN7oC7JkFHiF0M+FbSjtsLvR8paFLrJMYzQanHwwmJAmnCLA9BOfgm+WlG3lGEeVoCE+ n1dVeQQbCfq4LHkoh7wRr3SnZk7u9VgrXAXsn5wRhD6OSODjS8Dl6fgPy2V+qDjWO3Nx RQ7uvH0nszUlriD5lN4kgBxMcNK39K4VxWoSItclDhB2cI59XeSRN7Ajo/xoWdn7ck4j j2rVNhOGTSfE9I9ZebrdZ7VhDOW738NxeDt2j4P3JeA3EuA4LccNCRTrPxlEgrY0kw2e w5iQ== X-Gm-Message-State: AOAM531p2iPhQTgria3REelgeUq09Pao1zwskIu7/vvt5qZv59zCZqXB 48i41vFKhrmF6BX2L5QNOHzbIZXElvOFLA== X-Google-Smtp-Source: ABdhPJyj+11iEtcbSExnpEbCHSzuMh/xoUU/da4nP0eiE+0aucQcNDkw2zS1d9FCsTTGr8Ajmnyjhg== X-Received: by 2002:ac2:4db4:: with SMTP id h20mr13868028lfe.170.1625752235358; Thu, 08 Jul 2021 06:50:35 -0700 (PDT) Received: from adacore.com ([2a02:2ab8:224:2ce:72b5:e8ff:feef:ee60]) by smtp.gmail.com with ESMTPSA id g3sm202045lfu.269.2021.07.08.06.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 06:50:34 -0700 (PDT) Date: Thu, 8 Jul 2021 13:50:33 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Subject: [Ada] Duplicated D lines in ali files Message-ID: <20210708135033.GA2465961@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ghjuvan Lacambre Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" GNATcoverage possibly relies on the presence of the duplicate D lines in ALI files for its Source Coverage Obligation tables among different instantiations of a same generic. Mention this in comments. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * lib-writ.ads: Mention SCOs dependency as reason for duplicates. * lib.ads (Units): Update documentation to mention duplicated units. diff --git a/gcc/ada/lib-writ.ads b/gcc/ada/lib-writ.ads --- a/gcc/ada/lib-writ.ads +++ b/gcc/ada/lib-writ.ads @@ -1053,6 +1053,9 @@ package Lib.Writ is -- The Object parameter is true if an object file is created, and false -- otherwise. Note that the pseudo-object file generated in GNATprove mode -- does count as an object file from this point of view. + -- May output duplicate D lines caused by generic instantiations. This is + -- by design as GNATcoverage relies on them for its coverage of generic + -- instantiations, although this may be revisited in the future. procedure Add_Preprocessing_Dependency (S : Source_File_Index); -- Indicate that there is a dependency to be added on a preprocessing data diff --git a/gcc/ada/lib.ads b/gcc/ada/lib.ads --- a/gcc/ada/lib.ads +++ b/gcc/ada/lib.ads @@ -926,7 +926,9 @@ private -- The following table records a mapping between a name and the entry in -- the units table whose Unit_Name is this name. It is used to speed up -- the Is_Loaded function, whose original implementation (linear search) - -- could account for 2% of the time spent in the front end. Note that, in + -- could account for 2% of the time spent in the front end. When the unit + -- is an instance of a generic, the unit might get duplicated in the unit + -- table - see Make_Instance_Unit for more information. Note that, in -- the case of source files containing multiple units, the units table may -- temporarily contain two entries with the same Unit_Name during parsing, -- which means that the mapping must be to the first entry in the table.