diff options
author | Martin v. Löwis <loewis@informatik.hu-berlin.de> | 1998-07-12 11:20:42 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-07-12 11:20:42 -0400 |
commit | 11b5139c461d247d048eb8f00e035e0293d87b13 (patch) | |
tree | 5dd4e123cf0ad9910b9507b7856836d4725cf192 /gcc/cp/xref.c | |
parent | cb689bb608a3129133a40686493d168df47915e4 (diff) | |
download | gcc-11b5139c461d247d048eb8f00e035e0293d87b13.zip gcc-11b5139c461d247d048eb8f00e035e0293d87b13.tar.gz gcc-11b5139c461d247d048eb8f00e035e0293d87b13.tar.bz2 |
xref.c (classname): New function.
* xref.c (classname): New function.
(GNU_xref_hier): Change class and base parameters to tree.
* decl.c (xref_baseypes): Change caller.
* friend.c (make_friend_class): Likewise.
From-SVN: r21088
Diffstat (limited to 'gcc/cp/xref.c')
-rw-r--r-- | gcc/cp/xref.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/cp/xref.c b/gcc/cp/xref.c index 845a446..14915d6 100644 --- a/gcc/cp/xref.c +++ b/gcc/cp/xref.c @@ -541,6 +541,19 @@ gen_assign(xf, name) fprintf(xref_file, "ASG %s %d %s\n", filename(xf), lineno, s); } +static char* +classname (cls) + tree cls; +{ + if (cls && TREE_CODE_CLASS (TREE_CODE (cls)) == 't') + cls = TYPE_NAME (cls); + if (cls && TREE_CODE_CLASS (TREE_CODE (cls)) == 'd') + cls = DECL_NAME (cls); + if (cls && TREE_CODE (cls) == IDENTIFIER_NODE) + return IDENTIFIER_POINTER (cls); + return "?"; +} + /* Output cross-reference info about a class hierarchy. CLS is the class type of interest. BASE is a baseclass for CLS. PUB and VIRT give the access info about @@ -551,8 +564,8 @@ gen_assign(xf, name) void GNU_xref_hier(cls, base, pub, virt, frnd) - char *cls; - char *base; + tree cls; + tree base; int pub; int virt; int frnd; @@ -564,7 +577,8 @@ GNU_xref_hier(cls, base, pub, virt, frnd) if (xf == NULL) return; fprintf(xref_file, "HIE %s %d %s %s %d %d %d\n", - filename(xf), lineno, cls, base, pub, virt, frnd); + filename(xf), lineno, classname (cls), classname (base), + pub, virt, frnd); } /* Output cross-reference info about class members. CLS |