time_identifier = get_identifier (buf);
if (TIME_IDENTIFIER_TIME (time_identifier) == NULL_TREE)
{
- push_obstacks_nochange ();
- end_temporary_allocation ();
+ push_permanent_obstack ();
TIME_IDENTIFIER_TIME (time_identifier) = build_int_2 (0, 0);
TIME_IDENTIFIER_FILEINFO (time_identifier)
= build_int_2 (0, 1);
set_identifier_size (sizeof (struct lang_identifier));
decl_printable_name = lang_printable_name;
+ init_cplus_unsave ();
init_cplus_expand ();
bcopy (cplus_tree_code_type,
/* This is for ANSI C++. */
ridpointers[(int) RID_MUTABLE] = get_identifier ("mutable");
- /* Signature handling extensions. */
- signature_type_node = build_int_2 (signature_type, 0);
- TREE_TYPE (signature_type_node) = signature_type_node;
- ridpointers[(int) RID_SIGNATURE] = signature_type_node;
-
/* Create the built-in __null node. Note that we can't yet call for
type_for_size here because integer_type_node and so forth are not
set up. Therefore, we don't set the type of these nodes until
UNSET_RESERVED_WORD ("headof");
}
- if (! flag_handle_signatures || flag_no_gnu_keywords)
- {
- /* Easiest way to not recognize signature
- handling extensions... */
- UNSET_RESERVED_WORD ("signature");
- UNSET_RESERVED_WORD ("sigof");
- }
if (flag_no_asm || flag_no_gnu_keywords)
UNSET_RESERVED_WORD ("typeof");
if (! flag_operator_names)
fprintf (file, " `union'");
else if (yylval.ttype == enum_type_node)
fprintf (file, " `enum'");
- else if (yylval.ttype == signature_type_node)
- fprintf (file, " `signature'");
else
my_friendly_abort (80);
break;
else
id = lastiddecl;
- /* Scope class declarations before global
- declarations. */
- if ((!id || is_global (id))
- && current_class_type != 0
- && TYPE_SIZE (current_class_type) == 0)
- {
- /* Could be from one of the base classes. */
- tree field = lookup_field (current_class_type, token, 1, 0);
- if (field == 0)
- ;
- else if (field == error_mark_node)
- /* We have already generated the error message.
- But we still want to return this value. */
- id = lookup_field (current_class_type, token, 0, 0);
- else if (TREE_CODE (field) == VAR_DECL
- || TREE_CODE (field) == CONST_DECL
- || TREE_CODE (field) == TEMPLATE_DECL)
- id = field;
- else if (TREE_CODE (field) != FIELD_DECL)
- my_friendly_abort (61);
- else
- {
- cp_error ("invalid use of member `%D'", field);
- id = error_mark_node;
- return id;
- }
- }
-
/* Do Koenig lookup if appropriate (inside templates we build lookup
- expressions instead). */
+ expressions instead).
+
+ [basic.lookup.koenig]: If the ordinary unqualified lookup of the name
+ finds the declaration of a class member function, the associated
+ namespaces and classes are not considered. */
+
if (args && !current_template_parms && (!id || is_global (id)))
- /* If we have arguments and we only found global names, do Koenig
- lookup. */
id = lookup_arg_dependent (token, id, args);
/* Remember that this name has been used in the class definition, as per
#endif
/* Place to save freed lang_decls which were allocated on the
- permanent_obstack. @@ Not currently used. */
-tree free_lang_decl_chain;
+ permanent_obstack. */
+struct lang_decl *free_lang_decl_chain;
tree
build_lang_decl (code, name, type)
tree t;
{
struct obstack *obstack = current_obstack;
- register int i = sizeof (struct lang_decl) / sizeof (int);
- register int *pi;
+ struct lang_decl *ld;
+
+ my_friendly_assert (CAN_HAVE_FULL_LANG_DECL_P (t), 19990816);
if (! TREE_PERMANENT (t))
obstack = saveable_obstack;
if (free_lang_decl_chain && obstack == &permanent_obstack)
{
- pi = (int *)free_lang_decl_chain;
- free_lang_decl_chain = TREE_CHAIN (free_lang_decl_chain);
+ ld = free_lang_decl_chain;
+ free_lang_decl_chain = free_lang_decl_chain->u.next;
}
else
- pi = (int *) obstack_alloc (obstack, sizeof (struct lang_decl));
+ ld = ((struct lang_decl *)
+ obstack_alloc (obstack, sizeof (struct lang_decl)));
- while (i > 0)
- pi[--i] = 0;
+ bzero (ld, sizeof (struct lang_decl));
- DECL_LANG_SPECIFIC (t) = (struct lang_decl *) pi;
- LANG_DECL_PERMANENT ((struct lang_decl *) pi)
- = obstack == &permanent_obstack;
- my_friendly_assert (LANG_DECL_PERMANENT ((struct lang_decl *) pi)
- == TREE_PERMANENT (t), 234);
+ DECL_LANG_SPECIFIC (t) = ld;
+ LANG_DECL_PERMANENT (ld) = obstack == &permanent_obstack;
+ my_friendly_assert (LANG_DECL_PERMANENT (ld) == TREE_PERMANENT (t), 234);
DECL_MAIN_VARIANT (t) = t;
if (current_lang_name == lang_name_cplusplus)
DECL_LANGUAGE (t) = lang_cplusplus;
DECL_LANGUAGE (t) = lang_java;
else my_friendly_abort (64);
-#if 0 /* not yet, should get fixed properly later */
- if (code == TYPE_DECL)
- {
- tree id;
- id = get_identifier (build_overload_name (type, 1, 1));
- DECL_ASSEMBLER_NAME (t) = id;
- }
-
-#endif
#ifdef GATHER_STATISTICS
tree_node_counts[(int)lang_decl] += 1;
tree_node_sizes[(int)lang_decl] += sizeof (struct lang_decl);
#endif
}
+/* Like build_decl, except that a new lang_decl_flags structure is
+ placed in DECL_LANG_SPECIFIC. */
+
tree
build_lang_field_decl (code, name, type)
enum tree_code code;
extern struct obstack *current_obstack, *saveable_obstack;
register tree t = build_decl (code, name, type);
struct obstack *obstack = current_obstack;
- register int i = sizeof (struct lang_decl_flags) / sizeof (int);
- register int *pi;
-#if 0 /* not yet, should get fixed properly later */
-
- if (code == TYPE_DECL)
- {
- tree id;
- id = get_identifier (build_overload_name (type, 1, 1));
- DECL_ASSEMBLER_NAME (t) = id;
- }
-#endif
if (! TREE_PERMANENT (t))
obstack = saveable_obstack;
else
my_friendly_assert (obstack == &permanent_obstack, 235);
- pi = (int *) obstack_alloc (obstack, sizeof (struct lang_decl_flags));
- while (i > 0)
- pi[--i] = 0;
+ my_friendly_assert (!CAN_HAVE_FULL_LANG_DECL_P (t), 19990816);
- DECL_LANG_SPECIFIC (t) = (struct lang_decl *) pi;
+ DECL_LANG_SPECIFIC (t)
+ = ((struct lang_decl *)
+ obstack_alloc (obstack, sizeof (struct lang_decl_flags)));
+ bzero (DECL_LANG_SPECIFIC (t), sizeof (struct lang_decl_flags));
return t;
}
if (! DECL_LANG_SPECIFIC (node))
return;
- if (TREE_CODE (node) == FIELD_DECL)
+ if (!CAN_HAVE_FULL_LANG_DECL_P (node))
size = sizeof (struct lang_decl_flags);
else
size = sizeof (struct lang_decl);