diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2005-06-02 09:34:38 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2005-06-02 09:34:38 +0000 |
commit | 9267ee62db3b6b08f5b963a7b00e3489ed7bf237 (patch) | |
tree | 2e82b949e5fbc2faf1a0d693b2123f86aac63f7b /gcc/cp/mangle.c | |
parent | 58fb06b4a11160c4c6191b6c89f3c1b3a3bd0787 (diff) | |
download | gcc-9267ee62db3b6b08f5b963a7b00e3489ed7bf237.zip gcc-9267ee62db3b6b08f5b963a7b00e3489ed7bf237.tar.gz gcc-9267ee62db3b6b08f5b963a7b00e3489ed7bf237.tar.bz2 |
decl.c (start_decl): Simplify specialization handling.
* decl.c (start_decl): Simplify specialization handling. Remove
unneeded CLASSTYPE_TEMPLATE_INSTANTIATION check.
* mangle.c (discriminator_for_local_entity): Use VEC_index.
From-SVN: r100488
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r-- | gcc/cp/mangle.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index a2fefd0..8c276b5 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1426,8 +1426,6 @@ write_special_name_destructor (const tree dtor) static int discriminator_for_local_entity (tree entity) { - tree *type; - /* Assume this is the only local entity with this name. */ int discriminator = 0; @@ -1435,12 +1433,19 @@ discriminator_for_local_entity (tree entity) discriminator = DECL_DISCRIMINATOR (entity); else if (TREE_CODE (entity) == TYPE_DECL) { + int ix; + /* Scan the list of local classes. */ entity = TREE_TYPE (entity); - for (type = VEC_address (tree, local_classes); *type != entity; ++type) - if (TYPE_IDENTIFIER (*type) == TYPE_IDENTIFIER (entity) - && TYPE_CONTEXT (*type) == TYPE_CONTEXT (entity)) - ++discriminator; + for (ix = 0; ; ix++) + { + tree type = VEC_index (tree, local_classes, ix); + if (type == entity) + break; + if (TYPE_IDENTIFIER (type) == TYPE_IDENTIFIER (entity) + && TYPE_CONTEXT (type) == TYPE_CONTEXT (entity)) + ++discriminator; + } } return discriminator; |