/* Functions related to building classes and their related objects.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97-98, 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
tree ident = TYPE_NAME (type);
if (TREE_CODE (ident) != IDENTIFIER_NODE)
ident = DECL_NAME (ident);
- return identifier_subst (ident, prefix, '/', '_', "");
+ return identifier_subst (ident, prefix, '.', '_', "");
}
tree
if (resolved)
type = build_class_ref (type);
else
- type = build_utf8_ref (build_java_signature (type));
+ {
+ tree signature = build_java_signature (type);
+ type = build_utf8_ref (unmangle_classname
+ (IDENTIFIER_POINTER(signature),
+ IDENTIFIER_LENGTH(signature)));
+ }
PUSH_FIELD_VALUE (finit, "type", type);
flags = get_access_flags_from_decl (fdecl);
if (! resolved)
build_utf8_ref (DECL_CONSTRUCTOR_P (mdecl) ?
init_identifier_node
: DECL_NAME (mdecl)));
- PUSH_FIELD_VALUE (minit, "signature",
- build_utf8_ref (build_java_signature (TREE_TYPE (mdecl))));
+ {
+ tree signature = build_java_signature (TREE_TYPE (mdecl));
+ PUSH_FIELD_VALUE (minit, "signature",
+ (build_utf8_ref
+ (unmangle_classname
+ (IDENTIFIER_POINTER(signature),
+ IDENTIFIER_LENGTH(signature)))));
+ }
PUSH_FIELD_VALUE (minit, "accflags", build_int_2 (accflags, 0));
PUSH_FIELD_VALUE (minit, "ncode", code);
FINISH_RECORD_CONSTRUCTOR (minit);
START_RECORD_CONSTRUCTOR (cons, class_type_node);
PUSH_SUPER_VALUE (cons, temp);
PUSH_FIELD_VALUE (cons, "next", null_pointer_node);
-#if 0
- /* Need to fix _Jv_FindClassFromSignature. */
PUSH_FIELD_VALUE (cons, "name", build_utf8_ref (DECL_NAME (type_decl)));
-#else
- PUSH_FIELD_VALUE (cons, "name",
- build_utf8_ref (build_internal_class_name (type)));
-#endif
PUSH_FIELD_VALUE (cons, "accflags",
build_int_2 (get_access_flags_from_decl (type_decl), 0));
- PUSH_FIELD_VALUE (cons, "superclass", super);
+ PUSH_FIELD_VALUE (cons, "superclass",
+ CLASS_INTERFACE (type_decl) ? null_pointer_node : super);
PUSH_FIELD_VALUE (cons, "constants", constant_pool_constructor);
PUSH_FIELD_VALUE (cons, "methods",
build1 (ADDR_EXPR, method_ptr_type_node, methods_decl));