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
This commit is contained in:
Martin v. Löwis 1998-07-12 11:20:42 -04:00 committed by Jason Merrill
parent cb689bb608
commit 11b5139c46
5 changed files with 27 additions and 13 deletions

View File

@ -1,3 +1,10 @@
1998-07-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
* 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.
1998-07-12 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
* typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter
@ -33,7 +40,6 @@
purpose_member.
* decl.c (lookup_name_real): Don't call complete_type on a namespace.
(grokvardecl): Use DECL_CLASS_SCOPE_P.
(xref_basetypes): Fix call to GNU_xref_hier.
* cvt.c (convert_pointer_to_real): Check for error_mark_node sooner.
* class.c (warn_hidden): Fix for OVERLOAD.
From grahams@rcp.co.uk:

View File

@ -3007,7 +3007,7 @@ extern void GNU_xref_decl PROTO((tree, tree));
extern void GNU_xref_call PROTO((tree, char *));
extern void GNU_xref_function PROTO((tree, tree));
extern void GNU_xref_assign PROTO((tree));
extern void GNU_xref_hier PROTO((char *, char *, int, int, int));
extern void GNU_xref_hier PROTO((tree, tree, int, int, int));
extern void GNU_xref_member PROTO((tree, tree));
/* -- end of C++ */

View File

@ -11309,9 +11309,6 @@ xref_basetypes (code_type_node, name, ref, binfo)
SET_CLASSTYPE_MARKED (ref);
BINFO_BASETYPES (TYPE_BINFO (ref)) = binfos = make_tree_vec (len);
if (TREE_CODE (name) == TYPE_DECL)
name = DECL_NAME (name);
for (i = 0; binfo; binfo = TREE_CHAIN (binfo))
{
/* The base of a derived struct is public by default. */
@ -11345,9 +11342,7 @@ xref_basetypes (code_type_node, name, ref, binfo)
continue;
}
GNU_xref_hier (IDENTIFIER_POINTER (name),
IDENTIFIER_POINTER (TYPE_IDENTIFIER (basetype)),
via_public, via_virtual, 0);
GNU_xref_hier (name, basetype, via_public, via_virtual, 0);
#if 1
/* This code replaces similar code in layout_basetypes.

View File

@ -267,8 +267,7 @@ make_friend_class (type, friend_type)
else
is_template_friend = 0;
GNU_xref_hier (TYPE_NAME_STRING (type),
TYPE_NAME_STRING (friend_type), 0, 0, 1);
GNU_xref_hier (type, friend_type, 0, 0, 1);
if (is_template_friend)
friend_type = CLASSTYPE_TI_TEMPLATE (friend_type);

View File

@ -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