diff options
author | Mike Yang <yang@research.att.com> | 2001-03-27 04:52:21 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-03-27 04:52:21 +0000 |
commit | 005a5cb08b854e411ef9941d4fcb9de0bbce755a (patch) | |
tree | d401692554588cd30579539bc212105f7f93fa95 /gcc | |
parent | 5fa9abc3e9676702f2c1699ee4283773b1bf8de1 (diff) | |
download | gcc-005a5cb08b854e411ef9941d4fcb9de0bbce755a.zip gcc-005a5cb08b854e411ef9941d4fcb9de0bbce755a.tar.gz gcc-005a5cb08b854e411ef9941d4fcb9de0bbce755a.tar.bz2 |
dump.c (dump_access): New function.
* dump.c (dump_access): New function.
(cp_dump_tree): Use it. Dump basetype information for class
types.
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>
From-SVN: r40866
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/dump.c | 46 |
2 files changed, 50 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cdf1637..fc01aed 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2001-03-26 Mike Yang <yang@research.att.com> + Mark Mitchell <mark@codesourcery.com> + + * dump.c (dump_access): New function. + (cp_dump_tree): Use it. Dump basetype information for class + types. + 2001-03-26 Mark Mitchell <mark@codesourcery.com> * Makefile.in (optimize.o): Depend on params.h. diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c index 9be8d88..a0982a6 100644 --- a/gcc/cp/dump.c +++ b/gcc/cp/dump.c @@ -1,5 +1,5 @@ /* Tree-dumping functionality for intermediate representation. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. Written by Mark Mitchell <mark@codesourcery.com> This file is part of GNU CC. @@ -25,6 +25,25 @@ Boston, MA 02111-1307, USA. */ #include "cp-tree.h" #include "c-dump.h" +static void dump_access + PARAMS ((dump_info_p, tree)); + +/* Dump a representation of the accessibility information associated + with T. */ + +static void +dump_access (di, t) + dump_info_p di; + tree t; +{ + if (TREE_PROTECTED(t)) + dump_string (di, "protected"); + else if (TREE_PRIVATE(t)) + dump_string (di, "private"); + else + dump_string (di, "public"); +} + int cp_dump_tree (di, t) dump_info_p di; @@ -82,13 +101,33 @@ cp_dump_tree (di, t) } dump_child ("vfld", TYPE_VFIELD (t)); + + { + int i; + + for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); ++i) + { + tree base_binfo = BINFO_BASETYPE (TYPE_BINFO (t), i); + dump_child ("base", BINFO_TYPE (base_binfo)); + if (TREE_VIA_VIRTUAL (base_binfo)) + dump_string (di, "virtual"); + dump_access (di, base_binfo); + } + } + break; + + case FIELD_DECL: + dump_access (di, t); break; case FUNCTION_DECL: if (!DECL_THUNK_P (t)) { - if (DECL_FUNCTION_MEMBER_P (t)) - dump_string (di, "member"); + if (DECL_FUNCTION_MEMBER_P (t)) + { + dump_string (di, "member"); + dump_access (di, t); + } if (DECL_CONSTRUCTOR_P (t)) dump_string (di, "constructor"); if (DECL_DESTRUCTOR_P (t)) @@ -132,6 +171,7 @@ cp_dump_tree (di, t) dump_child ("rslt", DECL_TEMPLATE_RESULT (t)); dump_child ("inst", DECL_TEMPLATE_INSTANTIATIONS (t)); dump_child ("spcs", DECL_TEMPLATE_SPECIALIZATIONS (t)); + dump_child ("prms", DECL_TEMPLATE_PARMS (t)); break; case OVERLOAD: |