Commit 570e228b by Jakub Jelinek Committed by Jakub Jelinek

re PR target/81521 (After [r250413] GCC 8.0 doesn't compile for Windows)

	PR bootstrap/81521
	* tree.def: Remove TYPE_METHODS documentation, adjust TYPE_FIELDS
	documentation.
	* doc/generic.texi: Likewise.
	* config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition): Look
	for FUNCTION_DECLs in TYPE_FIELDS rather than TYPE_METHODS.

From-SVN: r250476
parent 4b40986c
2017-07-24 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/81521
* tree.def: Remove TYPE_METHODS documentation, adjust TYPE_FIELDS
documentation.
* doc/generic.texi: Likewise.
* config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition): Look
for FUNCTION_DECLs in TYPE_FIELDS rather than TYPE_METHODS.
2017-07-24 Jackson Woodruff <jackson.woodruff@arm.com> 2017-07-24 Jackson Woodruff <jackson.woodruff@arm.com>
* config/aarch64/aarch64-simd.md (aarch64_mla_elt_merge<mode>): New. * config/aarch64/aarch64-simd.md (aarch64_mla_elt_merge<mode>): New.
......
...@@ -114,14 +114,11 @@ i386_pe_adjust_class_at_definition (tree t) ...@@ -114,14 +114,11 @@ i386_pe_adjust_class_at_definition (tree t)
decl_attributes (&ti_decl, na, 0); decl_attributes (&ti_decl, na, 0);
} }
/* Check static VAR_DECL's. */ /* Check FUNCTION_DECL's and static VAR_DECL's. */
for (member = TYPE_FIELDS (t); member; member = DECL_CHAIN (member)) for (member = TYPE_FIELDS (t); member; member = DECL_CHAIN (member))
if (TREE_CODE (member) == VAR_DECL) if (TREE_CODE (member) == VAR_DECL)
maybe_add_dllexport (member); maybe_add_dllexport (member);
else if (TREE_CODE (member) == FUNCTION_DECL)
/* Check FUNCTION_DECL's. */
for (member = TYPE_METHODS (t); member; member = DECL_CHAIN (member))
if (TREE_CODE (member) == FUNCTION_DECL)
{ {
tree thunk; tree thunk;
maybe_add_dllexport (member); maybe_add_dllexport (member);
...@@ -132,7 +129,8 @@ i386_pe_adjust_class_at_definition (tree t) ...@@ -132,7 +129,8 @@ i386_pe_adjust_class_at_definition (tree t)
maybe_add_dllexport (thunk); maybe_add_dllexport (thunk);
} }
/* Check vtables */ /* 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) if (TREE_CODE (member) == VAR_DECL)
maybe_add_dllexport (member); maybe_add_dllexport (member);
} }
......
...@@ -2820,7 +2820,6 @@ This function cannot be used with namespaces that have ...@@ -2820,7 +2820,6 @@ This function cannot be used with namespaces that have
@findex BINFO_TYPE @findex BINFO_TYPE
@findex TYPE_FIELDS @findex TYPE_FIELDS
@findex TYPE_VFIELD @findex TYPE_VFIELD
@findex TYPE_METHODS
Besides namespaces, the other high-level scoping construct in C++ is the Besides namespaces, the other high-level scoping construct in C++ is the
class. (Throughout this manual the term @dfn{class} is used to mean the class. (Throughout this manual the term @dfn{class} is used to mean the
...@@ -2837,7 +2836,7 @@ macro to discern whether or not a particular type is a @code{class} as ...@@ -2837,7 +2836,7 @@ macro to discern whether or not a particular type is a @code{class} as
opposed to a @code{struct}. This macro will be true only for classes opposed to a @code{struct}. This macro will be true only for classes
declared with the @code{class} tag. declared with the @code{class} tag.
Almost all non-function members are available on the @code{TYPE_FIELDS} Almost all members are available on the @code{TYPE_FIELDS}
list. Given one member, the next can be found by following the list. Given one member, the next can be found by following the
@code{TREE_CHAIN}. You should not depend in any way on the order in @code{TREE_CHAIN}. You should not depend in any way on the order in
which fields appear on this list. All nodes on this list will be which fields appear on this list. All nodes on this list will be
...@@ -2849,7 +2848,11 @@ list, if the enumeration type was declared in the class. (Of course, ...@@ -2849,7 +2848,11 @@ list, if the enumeration type was declared in the class. (Of course,
the @code{TYPE_DECL} for the enumeration type will appear here as well.) the @code{TYPE_DECL} for the enumeration type will appear here as well.)
There are no entries for base classes on this list. In particular, There are no entries for base classes on this list. In particular,
there is no @code{FIELD_DECL} for the ``base-class portion'' of an there is no @code{FIELD_DECL} for the ``base-class portion'' of an
object. object. If a function member is overloaded, each of the overloaded
functions appears; no @code{OVERLOAD} nodes appear on the @code{TYPE_FIELDS}
list. Implicitly declared functions (including default constructors,
copy constructors, assignment operators, and destructors) will appear on
this list as well.
The @code{TYPE_VFIELD} is a compiler-generated field used to point to The @code{TYPE_VFIELD} is a compiler-generated field used to point to
virtual function tables. It may or may not appear on the virtual function tables. It may or may not appear on the
...@@ -2857,14 +2860,6 @@ virtual function tables. It may or may not appear on the ...@@ -2857,14 +2860,6 @@ virtual function tables. It may or may not appear on the
@code{TYPE_VFIELD} just like all the entries on the @code{TYPE_FIELDS} @code{TYPE_VFIELD} just like all the entries on the @code{TYPE_FIELDS}
list. list.
The function members are available on the @code{TYPE_METHODS} list.
Again, subsequent members are found by following the @code{TREE_CHAIN}
field. If a function is overloaded, each of the overloaded functions
appears; no @code{OVERLOAD} nodes appear on the @code{TYPE_METHODS}
list. Implicitly declared functions (including default constructors,
copy constructors, assignment operators, and destructors) will appear on
this list as well.
Every class has an associated @dfn{binfo}, which can be obtained with Every class has an associated @dfn{binfo}, which can be obtained with
@code{TYPE_BINFO}. Binfos are used to represent base-classes. The @code{TYPE_BINFO}. Binfos are used to represent base-classes. The
binfo given by @code{TYPE_BINFO} is the degenerate case, whereby every binfo given by @code{TYPE_BINFO} is the degenerate case, whereby every
......
...@@ -112,10 +112,7 @@ DEFTREECODE (BLOCK, "block", tcc_exceptional, 0) ...@@ -112,10 +112,7 @@ DEFTREECODE (BLOCK, "block", tcc_exceptional, 0)
itself or have named members doesn't really have a "scope" per se. itself or have named members doesn't really have a "scope" per se.
The TYPE_STUB_DECL field is used as a forward-references to names for The TYPE_STUB_DECL field is used as a forward-references to names for
ENUMERAL_TYPE, RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE nodes; ENUMERAL_TYPE, RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE nodes;
see below. see below. */
The TYPE_METHODS points to list of all methods associated with the type.
It is non-NULL only at main variant of the type and after free_lang_data
it may be set to error_mark_node instead of actual list to save memory. */
/* The ordering of the following codes is optimized for the checking /* The ordering of the following codes is optimized for the checking
macros in tree.h. Changing the order will degrade the speed of the macros in tree.h. Changing the order will degrade the speed of the
...@@ -213,8 +210,9 @@ DEFTREECODE (ARRAY_TYPE, "array_type", tcc_type, 0) ...@@ -213,8 +210,9 @@ DEFTREECODE (ARRAY_TYPE, "array_type", tcc_type, 0)
/* Struct in C, or record in Pascal. */ /* Struct in C, or record in Pascal. */
/* Special fields: /* Special fields:
TYPE_FIELDS chain of FIELD_DECLs for the fields of the struct, TYPE_FIELDS chain of FIELD_DECLs for the fields of the struct,
and VAR_DECLs, TYPE_DECLs and CONST_DECLs for record-scope variables, VAR_DECLs, TYPE_DECLs and CONST_DECLs for record-scope variables,
types and enumerators. types and enumerators and FUNCTION_DECLs for methods associated
with the type.
A few may need to be added for Pascal. */ A few may need to be added for Pascal. */
/* See the comment above, before ENUMERAL_TYPE, for how /* See the comment above, before ENUMERAL_TYPE, for how
forward references to struct tags are handled in C. */ forward references to struct tags are handled in C. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment