Commit a2af967e by Nathan Sidwell Committed by Nathan Sidwell

[C++ PATCH] Kill IDENTIFIER_LABEL_VALUE

https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01854.html
	Kill IDENTIFIER_LABEL_VALUE.
	* cp-tree.h (lang_identifier): Delete label_value slot.
	(IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
	(struct named_label_hasher): Rename to ...
	(struct named_label_hash): ... here.  Reimplement.
	(struct language_function): Adjust x_named_labels.
	* name-lookup.h (struct cp_label_binding): Delete.
	(struct cp_binding_level): Delete shadowed_labels slot.
	* decl.c (struct named_label_entry): Add name and outer slots.
	(pop_label): Rename to ...
	(check_label_used): ... here.  Don't pop.
	(note_label, sort_labels): Delete.
	(pop_labels, pop_local_label): Reimplement.
	(poplevel): Pop local labels as any other decl. Remove
	shadowed_labels handling.
	(named_label_hash::hash, named_label_hash::equal): New.
	(make_label_decl): Absorb into ...
	(lookup_label_1): ... here.  Add making_local_p arg, reimplement.
	(lookup_label, declare_local_label): Adjust.
	(check_goto, define_label): Adjust.
	* lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
	* ptree.c (cxx_print_identifier): Don't print identifier binding.

From-SVN: r254087
parent 733ba9b9
2017-10-25 Nathan Sidwell <nathan@acm.org> 2017-10-25 Nathan Sidwell <nathan@acm.org>
Kill IDENTIFIER_LABEL_VALUE.
* cp-tree.h (lang_identifier): Delete label_value slot.
(IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
(struct named_label_hasher): Rename to ...
(struct named_label_hash): ... here. Reimplement.
(struct language_function): Adjust x_named_labels.
* name-lookup.h (struct cp_label_binding): Delete.
(struct cp_binding_level): Delete shadowed_labels slot.
* decl.c (struct named_label_entry): Add name and outer slots.
(pop_label): Rename to ...
(check_label_used): ... here. Don't pop.
(note_label, sort_labels): Delete.
(pop_labels, pop_local_label): Reimplement.
(poplevel): Pop local labels as any other decl. Remove
shadowed_labels handling.
(named_label_hash::hash, named_label_hash::equal): New.
(make_label_decl): Absorb into ...
(lookup_label_1): ... here. Add making_local_p arg, reimplement.
(lookup_label, declare_local_label): Adjust.
(check_goto, define_label): Adjust.
* lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
* ptree.c (cxx_print_identifier): Don't print identifier binding.
* decl.c (identifier_goto): Reduce duplication. * decl.c (identifier_goto): Reduce duplication.
(check_previous_goto_1): Likewise. (check_previous_goto_1): Likewise.
(check_goto): Move var decls to initialization. (check_goto): Move var decls to initialization.
......
...@@ -561,7 +561,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; ...@@ -561,7 +561,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
struct GTY(()) lang_identifier { struct GTY(()) lang_identifier {
struct c_common_identifier c_common; struct c_common_identifier c_common;
cxx_binding *bindings; cxx_binding *bindings;
tree label_value;
}; };
/* Return a typed pointer version of T if it designates a /* Return a typed pointer version of T if it designates a
...@@ -996,11 +995,6 @@ enum GTY(()) abstract_class_use { ...@@ -996,11 +995,6 @@ enum GTY(()) abstract_class_use {
#define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = (TYPE)) #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = (TYPE))
#define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0) #define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0)
#define IDENTIFIER_LABEL_VALUE(NODE) \
(LANG_IDENTIFIER_CAST (NODE)->label_value)
#define SET_IDENTIFIER_LABEL_VALUE(NODE, VALUE) \
IDENTIFIER_LABEL_VALUE (NODE) = (VALUE)
/* Kinds of identifiers. Values are carefully chosen. */ /* Kinds of identifiers. Values are carefully chosen. */
enum cp_identifier_kind { enum cp_identifier_kind {
cik_normal = 0, /* Not a special identifier. */ cik_normal = 0, /* Not a special identifier. */
...@@ -1662,12 +1656,22 @@ struct cxx_int_tree_map_hasher : ggc_ptr_hash<cxx_int_tree_map> ...@@ -1662,12 +1656,22 @@ struct cxx_int_tree_map_hasher : ggc_ptr_hash<cxx_int_tree_map>
static bool equal (cxx_int_tree_map *, cxx_int_tree_map *); static bool equal (cxx_int_tree_map *, cxx_int_tree_map *);
}; };
struct named_label_entry; struct named_label_entry; /* Defined in decl.c. */
struct named_label_hasher : ggc_ptr_hash<named_label_entry> struct named_label_hash : ggc_remove <named_label_entry *>
{ {
static hashval_t hash (named_label_entry *); typedef named_label_entry *value_type;
static bool equal (named_label_entry *, named_label_entry *); typedef tree compare_type; /* An identifier. */
inline static hashval_t hash (value_type);
inline static bool equal (const value_type, compare_type);
inline static void mark_empty (value_type &p) {p = NULL;}
inline static bool is_empty (value_type p) {return !p;}
/* Nothing is deletable. Everything is insertable. */
inline static bool is_deleted (value_type) { return false; }
inline static void mark_deleted (value_type) { gcc_unreachable (); }
}; };
/* Global state pertinent to the current function. */ /* Global state pertinent to the current function. */
...@@ -1696,7 +1700,8 @@ struct GTY(()) language_function { ...@@ -1696,7 +1700,8 @@ struct GTY(()) language_function {
BOOL_BITFIELD invalid_constexpr : 1; BOOL_BITFIELD invalid_constexpr : 1;
hash_table<named_label_hasher> *x_named_labels; hash_table<named_label_hash> *x_named_labels;
cp_binding_level *bindings; cp_binding_level *bindings;
vec<tree, va_gc> *x_local_names; vec<tree, va_gc> *x_local_names;
/* Tracking possibly infinite loops. This is a vec<tree> only because /* Tracking possibly infinite loops. This is a vec<tree> only because
......
...@@ -189,27 +189,33 @@ struct GTY((chain_next ("%h.next"))) named_label_use_entry { ...@@ -189,27 +189,33 @@ struct GTY((chain_next ("%h.next"))) named_label_use_entry {
function, and so we can check the validity of jumps to these labels. */ function, and so we can check the validity of jumps to these labels. */
struct GTY((for_user)) named_label_entry { struct GTY((for_user)) named_label_entry {
/* The decl itself. */
tree label_decl; tree name; /* Name of decl. */
tree label_decl; /* LABEL_DECL, unless deleted local label. */
named_label_entry *outer; /* Outer shadowed chain. */
/* The binding level to which the label is *currently* attached. /* The binding level to which the label is *currently* attached.
This is initially set to the binding level in which the label This is initially set to the binding level in which the label
is defined, but is modified as scopes are closed. */ is defined, but is modified as scopes are closed. */
cp_binding_level *binding_level; cp_binding_level *binding_level;
/* The head of the names list that was current when the label was /* The head of the names list that was current when the label was
defined, or the inner scope popped. These are the decls that will defined, or the inner scope popped. These are the decls that will
be skipped when jumping to the label. */ be skipped when jumping to the label. */
tree names_in_scope; tree names_in_scope;
/* A vector of all decls from all binding levels that would be /* A vector of all decls from all binding levels that would be
crossed by a backward branch to the label. */ crossed by a backward branch to the label. */
vec<tree, va_gc> *bad_decls; vec<tree, va_gc> *bad_decls;
/* A list of uses of the label, before the label is defined. */ /* A list of uses of the label, before the label is defined. */
struct named_label_use_entry *uses; named_label_use_entry *uses;
/* The following bits are set after the label is defined, and are /* The following bits are set after the label is defined, and are
updated as scopes are popped. They indicate that a backward jump updated as scopes are popped. They indicate that a jump to the
to the label will illegally enter a scope of the given flavor. */ label will illegally enter a scope of the given flavor. */
bool in_try_scope; bool in_try_scope;
bool in_catch_scope; bool in_catch_scope;
bool in_omp_scope; bool in_omp_scope;
...@@ -347,7 +353,7 @@ finish_scope (void) ...@@ -347,7 +353,7 @@ finish_scope (void)
in a valid manner, and issue any appropriate warnings or errors. */ in a valid manner, and issue any appropriate warnings or errors. */
static void static void
pop_label (tree label, tree old_value) check_label_used (tree label)
{ {
if (!processing_template_decl) if (!processing_template_decl)
{ {
...@@ -364,32 +370,6 @@ pop_label (tree label, tree old_value) ...@@ -364,32 +370,6 @@ pop_label (tree label, tree old_value)
else else
warn_for_unused_label (label); warn_for_unused_label (label);
} }
SET_IDENTIFIER_LABEL_VALUE (DECL_NAME (label), old_value);
}
/* Push all named labels into a vector, so that we can sort it on DECL_UID
to avoid code generation differences. */
int
note_label (named_label_entry **slot, vec<named_label_entry **> &labels)
{
labels.quick_push (slot);
return 1;
}
/* Helper function to sort named label entries in a vector by DECL_UID. */
static int
sort_labels (const void *a, const void *b)
{
named_label_entry **slot1 = *(named_label_entry **const *) a;
named_label_entry **slot2 = *(named_label_entry **const *) b;
if (DECL_UID ((*slot1)->label_decl) < DECL_UID ((*slot2)->label_decl))
return -1;
if (DECL_UID ((*slot1)->label_decl) > DECL_UID ((*slot2)->label_decl))
return 1;
return 0;
} }
/* At the end of a function, all labels declared within the function /* At the end of a function, all labels declared within the function
...@@ -399,46 +379,49 @@ sort_labels (const void *a, const void *b) ...@@ -399,46 +379,49 @@ sort_labels (const void *a, const void *b)
static void static void
pop_labels (tree block) pop_labels (tree block)
{ {
if (named_labels) if (!named_labels)
return;
hash_table<named_label_hash>::iterator end (named_labels->end ());
for (hash_table<named_label_hash>::iterator iter
(named_labels->begin ()); iter != end; ++iter)
{ {
auto_vec<named_label_entry **, 32> labels; named_label_entry *ent = *iter;
named_label_entry **slot;
unsigned int i;
/* Push all the labels into a vector and sort them by DECL_UID, gcc_checking_assert (!ent->outer);
so that gaps between DECL_UIDs don't affect code generation. */ if (ent->label_decl)
labels.reserve_exact (named_labels->elements ());
named_labels->traverse<vec<named_label_entry **> &, note_label> (labels);
labels.qsort (sort_labels);
FOR_EACH_VEC_ELT (labels, i, slot)
{ {
struct named_label_entry *ent = *slot; check_label_used (ent->label_decl);
pop_label (ent->label_decl, NULL_TREE);
/* Put the labels into the "variables" of the top-level block, /* Put the labels into the "variables" of the top-level block,
so debugger can see them. */ so debugger can see them. */
DECL_CHAIN (ent->label_decl) = BLOCK_VARS (block); DECL_CHAIN (ent->label_decl) = BLOCK_VARS (block);
BLOCK_VARS (block) = ent->label_decl; BLOCK_VARS (block) = ent->label_decl;
named_labels->clear_slot (slot);
} }
named_labels = NULL; ggc_free (ent);
} }
named_labels = NULL;
} }
/* At the end of a block with local labels, restore the outer definition. */ /* At the end of a block with local labels, restore the outer definition. */
static void static void
pop_local_label (tree label, tree old_value) pop_local_label (tree id, tree label)
{ {
struct named_label_entry dummy; check_label_used (label);
named_label_entry **slot = named_labels->find_slot_with_hash
pop_label (label, old_value); (id, IDENTIFIER_HASH_VALUE (id), NO_INSERT);
named_label_entry *ent = *slot;
dummy.label_decl = label; if (ent->outer)
named_label_entry **slot = named_labels->find_slot (&dummy, NO_INSERT); ent = ent->outer;
named_labels->clear_slot (slot); else
{
ent = ggc_cleared_alloc<named_label_entry> ();
ent->name = id;
}
*slot = ent;
} }
/* The following two routines are used to interface to Objective-C++. /* The following two routines are used to interface to Objective-C++.
...@@ -579,7 +562,6 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -579,7 +562,6 @@ poplevel (int keep, int reverse, int functionbody)
int leaving_for_scope; int leaving_for_scope;
scope_kind kind; scope_kind kind;
unsigned ix; unsigned ix;
cp_label_binding *label_bind;
bool subtime = timevar_cond_start (TV_NAME_LOOKUP); bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
restart: restart:
...@@ -613,11 +595,12 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -613,11 +595,12 @@ poplevel (int keep, int reverse, int functionbody)
Usually current_binding_level->names is in reverse order. Usually current_binding_level->names is in reverse order.
But parameter decls were previously put in forward order. */ But parameter decls were previously put in forward order. */
decls = current_binding_level->names;
if (reverse) if (reverse)
current_binding_level->names {
= decls = nreverse (current_binding_level->names); decls = nreverse (decls);
else current_binding_level->names = decls;
decls = current_binding_level->names; }
/* If there were any declarations or structure tags in that level, /* If there were any declarations or structure tags in that level,
or if this level is a function body, or if this level is a function body,
...@@ -770,7 +753,10 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -770,7 +753,10 @@ poplevel (int keep, int reverse, int functionbody)
} }
} }
/* Remove the binding. */ /* Remove the binding. */
pop_local_binding (name, decl); if (TREE_CODE (decl) == LABEL_DECL)
pop_local_label (name, decl);
else
pop_local_binding (name, decl);
} }
/* Remove declarations for any `for' variables from inner scopes /* Remove declarations for any `for' variables from inner scopes
...@@ -784,11 +770,6 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -784,11 +770,6 @@ poplevel (int keep, int reverse, int functionbody)
link; link = TREE_CHAIN (link)) link; link = TREE_CHAIN (link))
SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (link), TREE_VALUE (link)); SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (link), TREE_VALUE (link));
/* Restore the IDENTIFIER_LABEL_VALUEs for local labels. */
FOR_EACH_VEC_SAFE_ELT_REVERSE (current_binding_level->shadowed_labels,
ix, label_bind)
pop_local_label (label_bind->label, label_bind->prev_value);
/* There may be OVERLOADs (wrapped in TREE_LISTs) on the BLOCK_VARs /* There may be OVERLOADs (wrapped in TREE_LISTs) on the BLOCK_VARs
list if a `using' declaration put them there. The debugging list if a `using' declaration put them there. The debugging
back ends won't understand OVERLOAD, so we remove them here. back ends won't understand OVERLOAD, so we remove them here.
...@@ -2949,81 +2930,83 @@ redeclaration_error_message (tree newdecl, tree olddecl) ...@@ -2949,81 +2930,83 @@ redeclaration_error_message (tree newdecl, tree olddecl)
} }
} }
/* Hash and equality functions for the named_label table. */ /* Hash and equality functions for the named_label table. */
hashval_t hashval_t
named_label_hasher::hash (named_label_entry *ent) named_label_hash::hash (const value_type entry)
{ {
return DECL_UID (ent->label_decl); return IDENTIFIER_HASH_VALUE (entry->name);
} }
bool bool
named_label_hasher::equal (named_label_entry *a, named_label_entry *b) named_label_hash::equal (const value_type entry, compare_type name)
{ {
return a->label_decl == b->label_decl; return name == entry->name;
} }
/* Create a new label, named ID. */ /* Look for a label named ID in the current function. If one cannot
be found, create one. Return the named_label_entry, or NULL on
failure. */
static tree static named_label_entry *
make_label_decl (tree id, int local_p) lookup_label_1 (tree id, bool making_local_p)
{ {
struct named_label_entry *ent; /* You can't use labels at global scope. */
tree decl; if (current_function_decl == NULL_TREE)
{
decl = build_decl (input_location, LABEL_DECL, id, void_type_node); error ("label %qE referenced outside of any function", id);
return NULL;
DECL_CONTEXT (decl) = current_function_decl; }
SET_DECL_MODE (decl, VOIDmode);
C_DECLARED_LABEL_FLAG (decl) = local_p;
/* Say where one reference is to the label, for the sake of the
error if it is not defined. */
DECL_SOURCE_LOCATION (decl) = input_location;
/* Record the fact that this identifier is bound to this label. */
SET_IDENTIFIER_LABEL_VALUE (id, decl);
/* Create the label htab for the function on demand. */
if (!named_labels) if (!named_labels)
named_labels = hash_table<named_label_hasher>::create_ggc (13); named_labels = hash_table<named_label_hash>::create_ggc (13);
/* Record this label on the list of labels used in this function. hashval_t hash = IDENTIFIER_HASH_VALUE (id);
We do this before calling make_label_decl so that we get the named_label_entry **slot
IDENTIFIER_LABEL_VALUE before the new label is declared. */ = named_labels->find_slot_with_hash (id, hash, INSERT);
ent = ggc_cleared_alloc<named_label_entry> (); named_label_entry *old = *slot;
ent->label_decl = decl;
if (old && old->label_decl)
named_label_entry **slot = named_labels->find_slot (ent, INSERT); {
gcc_assert (*slot == NULL); if (!making_local_p)
*slot = ent; return old;
return decl; if (old->binding_level == current_binding_level)
} {
error ("local label %qE conflicts with existing label", id);
inform (DECL_SOURCE_LOCATION (old->label_decl), "previous label");
return NULL;
}
}
/* Look for a label named ID in the current function. If one cannot /* We are making a new decl, create or reuse the named_label_entry */
be found, create one. (We keep track of used, but undefined, named_label_entry *ent = NULL;
labels, and complain about them at the end of a function.) */ if (old && !old->label_decl)
ent = old;
else
{
ent = ggc_cleared_alloc<named_label_entry> ();
ent->name = id;
ent->outer = old;
*slot = ent;
}
static tree /* Now create the LABEL_DECL. */
lookup_label_1 (tree id) tree decl = build_decl (input_location, LABEL_DECL, id, void_type_node);
{
tree decl;
/* You can't use labels at global scope. */ DECL_CONTEXT (decl) = current_function_decl;
if (current_function_decl == NULL_TREE) SET_DECL_MODE (decl, VOIDmode);
if (making_local_p)
{ {
error ("label %qE referenced outside of any function", id); C_DECLARED_LABEL_FLAG (decl) = true;
return NULL_TREE; DECL_CHAIN (decl) = current_binding_level->names;
current_binding_level->names = decl;
} }
/* See if we've already got this label. */ ent->label_decl = decl;
decl = IDENTIFIER_LABEL_VALUE (id);
if (decl != NULL_TREE && DECL_CONTEXT (decl) == current_function_decl)
return decl;
decl = make_label_decl (id, /*local_p=*/0); return ent;
return decl;
} }
/* Wrapper for lookup_label_1. */ /* Wrapper for lookup_label_1. */
...@@ -3031,30 +3014,19 @@ lookup_label_1 (tree id) ...@@ -3031,30 +3014,19 @@ lookup_label_1 (tree id)
tree tree
lookup_label (tree id) lookup_label (tree id)
{ {
tree ret;
bool subtime = timevar_cond_start (TV_NAME_LOOKUP); bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
ret = lookup_label_1 (id); named_label_entry *ent = lookup_label_1 (id, false);
timevar_cond_stop (TV_NAME_LOOKUP, subtime); timevar_cond_stop (TV_NAME_LOOKUP, subtime);
return ret; return ent ? ent->label_decl : NULL_TREE;
} }
/* Declare a local label named ID. */
tree tree
declare_local_label (tree id) declare_local_label (tree id)
{ {
tree decl; bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
cp_label_binding bind; named_label_entry *ent = lookup_label_1 (id, true);
timevar_cond_stop (TV_NAME_LOOKUP, subtime);
/* Add a new entry to the SHADOWED_LABELS list so that when we leave return ent ? ent->label_decl : NULL_TREE;
this scope we can restore the old value of IDENTIFIER_TYPE_VALUE. */
bind.prev_value = IDENTIFIER_LABEL_VALUE (id);
decl = make_label_decl (id, /*local_p=*/1);
bind.label = decl;
vec_safe_push (current_binding_level->shadowed_labels, bind);
return decl;
} }
/* Returns nonzero if it is ill-formed to jump past the declaration of /* Returns nonzero if it is ill-formed to jump past the declaration of
...@@ -3232,8 +3204,6 @@ check_switch_goto (cp_binding_level* level) ...@@ -3232,8 +3204,6 @@ check_switch_goto (cp_binding_level* level)
void void
check_goto (tree decl) check_goto (tree decl)
{ {
struct named_label_entry *ent, dummy;
/* We can't know where a computed goto is jumping. /* We can't know where a computed goto is jumping.
So we assume that it's OK. */ So we assume that it's OK. */
if (TREE_CODE (decl) != LABEL_DECL) if (TREE_CODE (decl) != LABEL_DECL)
...@@ -3244,22 +3214,22 @@ check_goto (tree decl) ...@@ -3244,22 +3214,22 @@ check_goto (tree decl)
if (decl == cdtor_label) if (decl == cdtor_label)
return; return;
dummy.label_decl = decl; hashval_t hash = IDENTIFIER_HASH_VALUE (DECL_NAME (decl));
ent = named_labels->find (&dummy); named_label_entry **slot
gcc_assert (ent != NULL); = named_labels->find_slot_with_hash (DECL_NAME (decl), hash, NO_INSERT);
named_label_entry *ent = *slot;
/* If the label hasn't been defined yet, defer checking. */ /* If the label hasn't been defined yet, defer checking. */
if (! DECL_INITIAL (decl)) if (! DECL_INITIAL (decl))
{ {
struct named_label_use_entry *new_use;
/* Don't bother creating another use if the last goto had the /* Don't bother creating another use if the last goto had the
same data, and will therefore create the same set of errors. */ same data, and will therefore create the same set of errors. */
if (ent->uses if (ent->uses
&& ent->uses->names_in_scope == current_binding_level->names) && ent->uses->names_in_scope == current_binding_level->names)
return; return;
new_use = ggc_alloc<named_label_use_entry> (); named_label_use_entry *new_use
= ggc_alloc<named_label_use_entry> ();
new_use->binding_level = current_binding_level; new_use->binding_level = current_binding_level;
new_use->names_in_scope = current_binding_level->names; new_use->names_in_scope = current_binding_level->names;
new_use->o_goto_locus = input_location; new_use->o_goto_locus = input_location;
...@@ -3378,25 +3348,15 @@ check_omp_return (void) ...@@ -3378,25 +3348,15 @@ check_omp_return (void)
static tree static tree
define_label_1 (location_t location, tree name) define_label_1 (location_t location, tree name)
{ {
struct named_label_entry *ent, dummy;
cp_binding_level *p;
tree decl;
decl = lookup_label (name);
dummy.label_decl = decl;
ent = named_labels->find (&dummy);
gcc_assert (ent != NULL);
/* After labels, make any new cleanups in the function go into their /* After labels, make any new cleanups in the function go into their
own new (temporary) binding contour. */ own new (temporary) binding contour. */
for (p = current_binding_level; for (cp_binding_level *p = current_binding_level;
p->kind != sk_function_parms; p->kind != sk_function_parms;
p = p->level_chain) p = p->level_chain)
p->more_cleanups_ok = 0; p->more_cleanups_ok = 0;
if (name == get_identifier ("wchar_t")) named_label_entry *ent = lookup_label_1 (name, false);
permerror (input_location, "label named wchar_t"); tree decl = ent->label_decl;
if (DECL_INITIAL (decl) != NULL_TREE) if (DECL_INITIAL (decl) != NULL_TREE)
{ {
......
...@@ -585,7 +585,6 @@ make_conv_op_name (tree type) ...@@ -585,7 +585,6 @@ make_conv_op_name (tree type)
/* Just in case something managed to bind. */ /* Just in case something managed to bind. */
IDENTIFIER_BINDING (identifier) = NULL; IDENTIFIER_BINDING (identifier) = NULL;
IDENTIFIER_LABEL_VALUE (identifier) = NULL_TREE;
/* Hang TYPE off the identifier so it can be found easily later /* Hang TYPE off the identifier so it can be found easily later
when performing conversions. */ when performing conversions. */
......
...@@ -148,15 +148,6 @@ struct GTY(()) cp_class_binding { ...@@ -148,15 +148,6 @@ struct GTY(()) cp_class_binding {
tree identifier; tree identifier;
}; };
struct GTY(()) cp_label_binding {
/* The bound LABEL_DECL. */
tree label;
/* The previous IDENTIFIER_LABEL_VALUE. */
tree prev_value;
};
/* For each binding contour we allocate a binding_level structure /* For each binding contour we allocate a binding_level structure
which records the names defined in that contour. which records the names defined in that contour.
Contours include: Contours include:
...@@ -202,10 +193,6 @@ struct GTY(()) cp_binding_level { ...@@ -202,10 +193,6 @@ struct GTY(()) cp_binding_level {
the class. */ the class. */
tree type_shadowed; tree type_shadowed;
/* Similar to class_shadowed, but for IDENTIFIER_LABEL_VALUE, and
used for all binding levels. */
vec<cp_label_binding, va_gc> *shadowed_labels;
/* For each level (except not the global one), /* For each level (except not the global one),
a chain of BLOCK nodes for all the levels a chain of BLOCK nodes for all the levels
that were entered and exited one level down. */ that were entered and exited one level down. */
......
...@@ -177,7 +177,6 @@ cxx_print_identifier (FILE *file, tree node, int indent) ...@@ -177,7 +177,6 @@ cxx_print_identifier (FILE *file, tree node, int indent)
indent_to (file, indent + 4); indent_to (file, indent + 4);
fprintf (file, "%s local bindings <%p>", get_identifier_kind_name (node), fprintf (file, "%s local bindings <%p>", get_identifier_kind_name (node),
(void *) IDENTIFIER_BINDING (node)); (void *) IDENTIFIER_BINDING (node));
print_node (file, "label", IDENTIFIER_LABEL_VALUE (node), indent + 4);
} }
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment