diff options
author | Michael Tiemann <tiemann@happy.cygnus.com> | 1999-07-09 16:15:04 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-07-09 12:15:04 -0400 |
commit | f90cdf34d2409c87ade5b20cff4f9b4ffc64cfaf (patch) | |
tree | fe4da5c0be7eb3c448a6b274d4e1907f06e7d1e7 /gcc/cp/ptree.c | |
parent | 1d02ac8371b1d3b31ed029c29fa23fadeca48787 (diff) | |
download | gcc-f90cdf34d2409c87ade5b20cff4f9b4ffc64cfaf.zip gcc-f90cdf34d2409c87ade5b20cff4f9b4ffc64cfaf.tar.gz gcc-f90cdf34d2409c87ade5b20cff4f9b4ffc64cfaf.tar.bz2 |
cp-tree.h (struct lang_decl): Added field for storing sorted FIELD_DECLs (used in TYPE_DECLs).
* cp-tree.h (struct lang_decl): Added field for storing sorted
FIELD_DECLs (used in TYPE_DECLs).
(DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union.
(DECL_SORTED_FIELDS): New macro.
* class.c (method_name_cmp): New function.
(finish_struct_methods): Modified to support sorting and searching
methods.
(finish_struct_anon): Changed code in inner loop to use ELT rather
than UELT (which required an extra indirection for every reference).
(field_decl_cmp): New function to support sorting FIELD_DECLs.
(finish_struct_1): Sort fields.
* search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them.
(lookup_fnfields_1): Search sorted methods in METHOD_VEC.
Also, switch to using array indexing rather than a changing pointer.
* ptree.c (print_lang_decl): Handle TYPE_DECLs that have
DECL_SORTED_FIELDS.
Co-Authored-By: Jason Merrill <jason@yorick.cygnus.com>
From-SVN: r28046
Diffstat (limited to 'gcc/cp/ptree.c')
-rw-r--r-- | gcc/cp/ptree.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c index 4008e39..3c84864 100644 --- a/gcc/cp/ptree.c +++ b/gcc/cp/ptree.c @@ -48,11 +48,18 @@ print_lang_decl (file, node, indent) fprintf (file, " decl-main-variant "); fprintf (file, HOST_PTR_PRINTF, DECL_MAIN_VARIANT (node)); } - if (DECL_PENDING_INLINE_INFO (node)) + if (TREE_CODE (node) == FUNCTION_DECL + && DECL_PENDING_INLINE_INFO (node)) { fprintf (file, " pending-inline-info "); fprintf (file, HOST_PTR_PRINTF, DECL_PENDING_INLINE_INFO (node)); } + if (TREE_CODE (node) == TYPE_DECL + && DECL_SORTED_FIELDS (node)) + { + fprintf (file, " sorted-fields "); + fprintf (file, HOST_PTR_PRINTF, DECL_SORTED_FIELDS (node)); + } if (DECL_TEMPLATE_INFO (node)) { fprintf (file, " template-info "); |