diff mbox

Kill TYPE_METHODS 0/9

Message ID 448f71ec-7b97-a1a6-fd9f-4dde7c75f4d9@linaro.org
State New
Headers show

Commit Message

Jim Wilson July 25, 2017, 4:06 p.m. UTC
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
diff mbox

Patch

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);