mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-13 13:55:15 +08:00
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:
parent
cb689bb608
commit
11b5139c46
@ -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>
|
1998-07-12 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
|
||||||
|
|
||||||
* typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter
|
* typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter
|
||||||
@ -33,7 +40,6 @@
|
|||||||
purpose_member.
|
purpose_member.
|
||||||
* decl.c (lookup_name_real): Don't call complete_type on a namespace.
|
* decl.c (lookup_name_real): Don't call complete_type on a namespace.
|
||||||
(grokvardecl): Use DECL_CLASS_SCOPE_P.
|
(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.
|
* cvt.c (convert_pointer_to_real): Check for error_mark_node sooner.
|
||||||
* class.c (warn_hidden): Fix for OVERLOAD.
|
* class.c (warn_hidden): Fix for OVERLOAD.
|
||||||
From grahams@rcp.co.uk:
|
From grahams@rcp.co.uk:
|
||||||
|
@ -3007,7 +3007,7 @@ extern void GNU_xref_decl PROTO((tree, tree));
|
|||||||
extern void GNU_xref_call PROTO((tree, char *));
|
extern void GNU_xref_call PROTO((tree, char *));
|
||||||
extern void GNU_xref_function PROTO((tree, tree));
|
extern void GNU_xref_function PROTO((tree, tree));
|
||||||
extern void GNU_xref_assign PROTO((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));
|
extern void GNU_xref_member PROTO((tree, tree));
|
||||||
|
|
||||||
/* -- end of C++ */
|
/* -- end of C++ */
|
||||||
|
@ -11309,9 +11309,6 @@ xref_basetypes (code_type_node, name, ref, binfo)
|
|||||||
SET_CLASSTYPE_MARKED (ref);
|
SET_CLASSTYPE_MARKED (ref);
|
||||||
BINFO_BASETYPES (TYPE_BINFO (ref)) = binfos = make_tree_vec (len);
|
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))
|
for (i = 0; binfo; binfo = TREE_CHAIN (binfo))
|
||||||
{
|
{
|
||||||
/* The base of a derived struct is public by default. */
|
/* The base of a derived struct is public by default. */
|
||||||
@ -11345,9 +11342,7 @@ xref_basetypes (code_type_node, name, ref, binfo)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
GNU_xref_hier (IDENTIFIER_POINTER (name),
|
GNU_xref_hier (name, basetype, via_public, via_virtual, 0);
|
||||||
IDENTIFIER_POINTER (TYPE_IDENTIFIER (basetype)),
|
|
||||||
via_public, via_virtual, 0);
|
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
/* This code replaces similar code in layout_basetypes.
|
/* This code replaces similar code in layout_basetypes.
|
||||||
|
@ -267,8 +267,7 @@ make_friend_class (type, friend_type)
|
|||||||
else
|
else
|
||||||
is_template_friend = 0;
|
is_template_friend = 0;
|
||||||
|
|
||||||
GNU_xref_hier (TYPE_NAME_STRING (type),
|
GNU_xref_hier (type, friend_type, 0, 0, 1);
|
||||||
TYPE_NAME_STRING (friend_type), 0, 0, 1);
|
|
||||||
|
|
||||||
if (is_template_friend)
|
if (is_template_friend)
|
||||||
friend_type = CLASSTYPE_TI_TEMPLATE (friend_type);
|
friend_type = CLASSTYPE_TI_TEMPLATE (friend_type);
|
||||||
|
@ -541,6 +541,19 @@ gen_assign(xf, name)
|
|||||||
fprintf(xref_file, "ASG %s %d %s\n", filename(xf), lineno, s);
|
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.
|
/* Output cross-reference info about a class hierarchy.
|
||||||
CLS is the class type of interest. BASE is a baseclass
|
CLS is the class type of interest. BASE is a baseclass
|
||||||
for CLS. PUB and VIRT give the access info about
|
for CLS. PUB and VIRT give the access info about
|
||||||
@ -551,8 +564,8 @@ gen_assign(xf, name)
|
|||||||
|
|
||||||
void
|
void
|
||||||
GNU_xref_hier(cls, base, pub, virt, frnd)
|
GNU_xref_hier(cls, base, pub, virt, frnd)
|
||||||
char *cls;
|
tree cls;
|
||||||
char *base;
|
tree base;
|
||||||
int pub;
|
int pub;
|
||||||
int virt;
|
int virt;
|
||||||
int frnd;
|
int frnd;
|
||||||
@ -564,7 +577,8 @@ GNU_xref_hier(cls, base, pub, virt, frnd)
|
|||||||
if (xf == NULL) return;
|
if (xf == NULL) return;
|
||||||
|
|
||||||
fprintf(xref_file, "HIE %s %d %s %s %d %d %d\n",
|
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
|
/* Output cross-reference info about class members. CLS
|
||||||
|
Loading…
Reference in New Issue
Block a user