From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 164FE3984042; Fri, 15 May 2020 18:19:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 164FE3984042 From: "gprocida+abigail at google dot com" To: libabigail@sourceware.org Subject: [Bug default/25998] New: Support incomplete enum types Date: Fri, 15 May 2020 18:19:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: libabigail X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: gprocida+abigail at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dodji at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 18:19:03 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25998 Bug ID: 25998 Summary: Support incomplete enum types Product: libabigail Version: unspecified Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: default Assignee: dodji at redhat dot com Reporter: gprocida+abigail at google dot com CC: libabigail at sourceware dot org Target Milestone: --- Incomplete enum types are a GCC and Clang extension for C and are widely us= ed in the (AOSP at least) Linux kernel code. C++ now supports "opaque" enums which are essentially forward-declared types *of known size*. If would good to have support in libabigail for the C case as this lack is affecting AOSP kernel ABI monitoring. I posted an RFC patch series demonstrating feasibility as: https://sourceware.org/pipermail/libabigail/2020q2/001994.html I followed up with a simplification of WIP types in the DWARF reader to red= uce some of the code duplication in the initial series: https://sourceware.org/pipermail/libabigail/2020q2/002262.html However, this only tackles a fraction of the duplication. There are two possible approaches in general: templating over the relevant types or facto= ring the common features into or otherwise using a type hierarchy. libabigail already has a type hierarchy. There are at least two issues: * the functionality for dealing with incomplete types exists at the class_or_union level which is quite far down the hierarchy * the common ancestors (plural, multiple inheritance) of class_or_union and enum_decl_type are quite high up in hierarchy Essentially, if we're going to try inheritance to avoid duplication, the hierarchy will have to change. Inheritance may not be a perfect fit, for example, there are separate hierarchies of type types and diff types (and the diff types have to have specialised methods like first_num) and things like get_definition_of_declaration whose return value will need to be downcast if it's made a base class method. Templating comes with its own concerns. The main reason not to use it here = is that the combination of both inheritance and templating may impose a high cognitive load on the poor developers. Any detailed proposal should include full support for the newer C++ enum ty= pes (scoped and opaque) and the should cover DWARF reader TODOs about supporting incomplete union types. --=20 You are receiving this mail because: You are on the CC list for the bug.=