From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117316 invoked by alias); 23 Jan 2020 10:55:59 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 114870 invoked by uid 48); 23 Jan 2020 10:55:56 -0000 From: "vries at gcc dot gnu.org" To: dwz@sourceware.org Subject: [Bug default/25449] Factor out compilation units Date: Wed, 01 Jan 2020 00:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: dwz X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: nobody at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2020-q1/txt/msg00039.txt https://sourceware.org/bugzilla/show_bug.cgi?id=3D25449 --- Comment #1 from Tom de Vries --- (In reply to Tom de Vries from comment #0) > So, as a first step we could do a optimization in DWZ to look at all the > items that are selected to be moved into a PU, and decide whether we can > transform the PU into a CU and drop the imports. One of the requirements probably has to be that the items are from a single language. > An #include directive appearing outside any other declarations is a good > candidate to be represented using DW_TAG_compile_unit. >=20 > However, an #include appearing inside a C++ namespace declaration or a > function, for example, is not a good candidate because the entities inclu= ded > are not necessarily file level entities. The appendix suggests DIEs in a namespace are not good candidates, but I th= ink what that tries to say is that if we originally we have a DIE in a namespac= e: ... DIE2: compilation unit B DIE3: namespace bla DIE1 ... and do some factoring out like so: ... DIE0: factored-out unit A DIE1 DIE2: compilation unit B DIE3: namespace bla DIE4: import DIE0 ... the factored-out unit cannot use DW_TAG_compile_unit, because DIE1 is not a globally visible entry. However, dwz generates this type of partial unit: ... DIE0: partial unit A DIE3: namespace bla DIE1 DIE2: compilation unit B DIE4: import DIE0 ... which basically works around this problem, and I don't see a reason here why unit A can't be a compilation unit. --=20 You are receiving this mail because: You are on the CC list for the bug.