Fix i686-pc-cygwin build failure.
authorJim Wilson <jim.wilson@linaro.org>
Tue, 25 Jul 2017 16:06:37 +0000 (16:06 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 25 Jul 2017 16:06:37 +0000 (09:06 -0700)
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.

From-SVN: r250529

gcc/ChangeLog
gcc/config/i386/winnt-cxx.c

index fa76a9b9e90c8e77f4a7a3aef806b8722c2dbe5b..1ddf5b5933996ef6464ba672637793334461b443 100644 (file)
@@ -1,3 +1,9 @@
+2017-07-25  Jim Wilson  <jim.wilson@linaro.org>
+
+       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.
+
 2017-07-25  Jim Wilson  <jim.wilson@linaro.org>
 
        * config/i386/gstabs.h: Delete.
index cf271d301c95995f4ee026974aea085a39db5952..a3569fb1b561805bf3d27caf07197ccc707deb41 100644 (file)
@@ -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);