This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Kill TYPE_METHODS 0/9
- From: Jim Wilson <jim dot wilson at linaro dot org>
- To: Jakub Jelinek <jakub at redhat dot com>, Nathan Sidwell <nathan at acm dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Richard Guenther <richard dot guenther at gmail dot com>, Jim Wilson <wilson at tuliptree dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Tue, 25 Jul 2017 09:06:43 -0700
- Subject: Re: [PATCH] Kill TYPE_METHODS 0/9
- Authentication-results: sourceware.org; auth=none
- Newsgroups: gmane.comp.gcc.patches
- References: <8377f2cd-577c-60b2-63ac-f2619ebe63aa@acm.org> <20170724092514.GN2123@tucnak>
On 07/24/2017 02:25 AM, Jakub Jelinek wrote:
Seems TYPE_METHODS have been left in a couple of spots. For winnt-cxx.c
it apparently causes bootstrap failure (I have no way to test it for that
target, but given that the bootstrap is certainly broken right now, it
can't make things worse) and documentation has not been updated.
There were two uses of TYPE_METHODS in winnt-cxx.c, and Jakub's patch
fixed only one of them. I wrote a patch to fix the other, fixed the
exact same way as Jakub's earlier patch, with a few indentation and
white space fixes also. This was tested with a cross build, and checked
in under the obvious rule.
Jim
2017-07-25 Jim Wilson <jim.wilson@linaro.org>
gcc/
PR bootstrap/81521
* config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition): Look
for FUNCTION_DECLs in TYPE_FIELDS rather than TYPE_METHODS.
Index: gcc/config/i386/winnt-cxx.c
===================================================================
--- gcc/config/i386/winnt-cxx.c (revision 250526)
+++ gcc/config/i386/winnt-cxx.c (working copy)
@@ -127,7 +127,8 @@ i386_pe_adjust_class_at_definition (tree t)
for (thunk = DECL_THUNKS (member); thunk;
thunk = TREE_CHAIN (thunk))
maybe_add_dllexport (thunk);
- }
+ }
+
/* Check vtables */
for (member = CLASSTYPE_VTABLES (t);
member; member = DECL_CHAIN (member))
@@ -145,14 +146,11 @@ i386_pe_adjust_class_at_definition (tree t)
That is just right since out-of class declarations can only be a
definition. */
- /* Check static VAR_DECL's. */
+ /* Check FUNCTION_DECL's and static VAR_DECL's. */
for (member = TYPE_FIELDS (t); member; member = DECL_CHAIN (member))
if (TREE_CODE (member) == VAR_DECL)
maybe_add_dllimport (member);
-
- /* Check FUNCTION_DECL's. */
- for (member = TYPE_METHODS (t); member; member = DECL_CHAIN (member))
- if (TREE_CODE (member) == FUNCTION_DECL)
+ else if (TREE_CODE (member) == FUNCTION_DECL)
{
tree thunk;
maybe_add_dllimport (member);
@@ -161,10 +159,11 @@ i386_pe_adjust_class_at_definition (tree t)
for (thunk = DECL_THUNKS (member); thunk;
thunk = DECL_CHAIN (thunk))
maybe_add_dllimport (thunk);
- }
+ }
/* Check vtables */
- for (member = CLASSTYPE_VTABLES (t); member; member = DECL_CHAIN (member))
+ for (member = CLASSTYPE_VTABLES (t);
+ member; member = DECL_CHAIN (member))
if (TREE_CODE (member) == VAR_DECL)
maybe_add_dllimport (member);