diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-12-11 08:05:59 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-12-11 08:05:59 +0000 |
| commit | c34f2c3d02da22ef7c1d62788c8471f3ad04a0c7 (patch) | |
| tree | 3b50fc112d5264a9a20f00daeae84f46cd770692 | |
| parent | d10f9994bfa37c82437d2669ed0588ba0814f1b8 (diff) | |
Notes
| -rw-r--r-- | contrib/gcc/cp/name-lookup.c | 31 | ||||
| -rw-r--r-- | contrib/gcc/cp/name-lookup.h | 2 |
2 files changed, 6 insertions, 27 deletions
diff --git a/contrib/gcc/cp/name-lookup.c b/contrib/gcc/cp/name-lookup.c index 744dd5c489ec..802665ef21d1 100644 --- a/contrib/gcc/cp/name-lookup.c +++ b/contrib/gcc/cp/name-lookup.c @@ -302,35 +302,11 @@ new_class_binding (tree name, tree value, tree type, cxx_scope *scope) cp_class_binding *cb; cxx_binding *binding; - if (VEC_length (cp_class_binding, scope->class_shadowed)) - { - cp_class_binding *old_base; - old_base = VEC_index (cp_class_binding, scope->class_shadowed, 0); - if (VEC_reserve (cp_class_binding, gc, scope->class_shadowed, 1)) - { - /* Fixup the current bindings, as they might have moved. */ - size_t i; - - for (i = 0; - VEC_iterate (cp_class_binding, scope->class_shadowed, i, cb); - i++) - { - cxx_binding **b; - b = &IDENTIFIER_BINDING (cb->identifier); - while (*b != &old_base[i].base) - b = &((*b)->previous); - *b = &cb->base; - } - } - cb = VEC_quick_push (cp_class_binding, scope->class_shadowed, NULL); - } - else cb = VEC_safe_push (cp_class_binding, gc, scope->class_shadowed, NULL); cb->identifier = name; - binding = &cb->base; + cb->base = binding = cxx_binding_make (value, type); binding->scope = scope; - cxx_binding_init (binding, value, type); return binding; } @@ -2447,7 +2423,10 @@ poplevel_class (void) for (i = 0; VEC_iterate (cp_class_binding, level->class_shadowed, i, cb); ++i) - IDENTIFIER_BINDING (cb->identifier) = cb->base.previous; + { + IDENTIFIER_BINDING (cb->identifier) = cb->base->previous; + cxx_binding_free (cb->base); + } ggc_free (level->class_shadowed); level->class_shadowed = NULL; } diff --git a/contrib/gcc/cp/name-lookup.h b/contrib/gcc/cp/name-lookup.h index 0d99f9beafa8..7d6e861d265a 100644 --- a/contrib/gcc/cp/name-lookup.h +++ b/contrib/gcc/cp/name-lookup.h @@ -142,7 +142,7 @@ typedef enum tag_scope { typedef struct cp_class_binding GTY(()) { - cxx_binding base; + cxx_binding *base; /* The bound name. */ tree identifier; } cp_class_binding; |
