+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
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:
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++ */
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. */
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.
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);
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
void
GNU_xref_hier(cls, base, pub, virt, frnd)
- char *cls;
- char *base;
+ tree cls;
+ tree base;
int pub;
int virt;
int 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