+2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
+ Ranjit Mathew <rmathew@hotmail.com>
+
+ PR java/1207, java/16178
+ * jcf-parse.c (load_class): Return immediately if passed a type decl
+ where CLASS_FROM_SOURCE_P is set. Remove FIXME.
+ * parse.y (do_resolve_class): Remove checks for CLASS_FROM_SOURCE_P
+ before calling load_class.
+ (qualify_and_find): Likewise.
+ (find_in_imports_on_demand): Likewise.
+ (find_applicable_accessible_methods_list): Likewise.
+
+2004-06-24 Bryce McKinlay <mckinlay@redhat.com>
+
+ * parse.y (java_layout_seen_class_methods): Don't call load_class
+ on class defined by source parser.
+
2004-06-23 Bryce McKinlay <mckinlay@redhat.com>
* parse.y (set_nested_class_simple_name_value): Removed.
/* Load CLASS_OR_NAME. CLASS_OR_NAME can be a mere identifier if
called from the parser, otherwise it's a RECORD_TYPE node. If
VERBOSE is 1, print error message on failure to load a class. */
-
-/* Replace calls to load_class by having callers call read_class directly
- - and then perhaps rename read_class to load_class. FIXME */
-
void
load_class (tree class_or_name, int verbose)
{
name = TYPE_NAME (TREE_PURPOSE (class_or_name));
/* Or it's a type in the making */
else
- name = DECL_NAME (TYPE_NAME (class_or_name));
+ {
+ /* If the class is from source code, then it must already be loaded. */
+ if (CLASS_FROM_SOURCE_P (class_or_name))
+ return;
+ name = DECL_NAME (TYPE_NAME (class_or_name));
+ }
saved = name;
while (1)
/* 2- And check for the type in the current compilation unit */
if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type))))
{
- if (!CLASS_LOADED_P (TREE_TYPE (new_class_decl)) &&
- !CLASS_FROM_SOURCE_P (TREE_TYPE (new_class_decl)))
+ if (!CLASS_LOADED_P (TREE_TYPE (new_class_decl)))
load_class (TYPE_NAME (class_type), 0);
return IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type));
}
load_class (new_qualified, 0);
if ((new_class_decl = IDENTIFIER_CLASS_VALUE (new_qualified)))
{
- if (!CLASS_LOADED_P (TREE_TYPE (new_class_decl)) &&
- !CLASS_FROM_SOURCE_P (TREE_TYPE (new_class_decl)))
+ if (!CLASS_LOADED_P (TREE_TYPE (new_class_decl)))
load_class (new_qualified, 0);
TYPE_NAME (class_type) = new_qualified;
return IDENTIFIER_CLASS_VALUE (new_qualified);
access_check = -1;
/* If there is no DECL set for the class or if the class isn't
loaded and not seen in source yet, then load */
- if (!decl || (!CLASS_LOADED_P (TREE_TYPE (decl))
- && !CLASS_FROM_SOURCE_P (TREE_TYPE (decl))))
+ if (!decl || ! CLASS_LOADED_P (TREE_TYPE (decl)))
{
load_class (node, 0);
decl = IDENTIFIER_CLASS_VALUE (node);
search_not_done++;
*htab_find_slot (searched_classes, class, INSERT) = class;
- if (!CLASS_LOADED_P (class) && !CLASS_FROM_SOURCE_P (class))
+ if (!CLASS_LOADED_P (class))
{
load_class (class, 1);
safe_layout_class (class);