gcc/gcc/cp/name-lookup.h

380 lines
14 KiB
C
Raw Normal View History

/* Declarations for C++ name lookup routines.
Copyright (C) 2003-2017 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCC_CP_NAME_LOOKUP_H
#define GCC_CP_NAME_LOOKUP_H
c-common.c: Move to c-family/. gcc/ChangeLog: * c-common.c: Move to c-family/. * c-common.def: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-dump.c: Likewise. * c-format.c: Likewise. * c-format.h : Likewise. * c-gimplify.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c.opt: Likewise. * c-opts.c: Likewise. * c-pch.c: Likewise. * c-ppoutput.c: Likewise. * c-pragma.c: Likewise. * c-pragma.h: Likewise. * c-pretty-print.c: Likewise. * c-pretty-print.h: Likewise. * c-semantics.c: Likewise. * stub-objc.c: Likewise. * gengtype.c (get_file_langdir): Special-case files in c-family/. (get_output_file_with_visibility): Fix name for c-common.h. * c-config-lang.in: Update paths in gtfiles for files in c-family/. * c-tree.h: Update include path for moved files. * c-lang.c: Likewise. * c-lang.h: Likewise. * c-parser.c: Likewise. * c-convert.c: Likewise. * c-decl.c: Likewise. * c-objc-common.c: Likewise. * configure.ac: Make sure c-family/ exists in the build directory. * configure: Regenerate. * Makefile.in: Update paths for moved files. Regroup files per location and update dependencies. Move generated_files down after ALL_GTFILES_H. * config/spu/spu-c.c: Update paths for moved files. * config/mep/mep-pragma.c: Likewise. * config/darwin-c.c: Likewise. * config/i386/msformat-c.c: Likewise. * config/i386/i386-c.c: Likewise. * config/avr/avr-c.c: Likewise. * config/sol2-c.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm-c.c: Likewise. * config/h8300/h8300.c: Likewise. * config/v850/v850-c.c: Likewise. * config/t-darwin: Fix dependencies for moved files. * config/t-sol2: Fix dependencies for moved files. * config/mep/t-mep: Fix dependencies for moved files. * config/ia64/t-ia64: Fix dependencies for moved files. * config/rs6000/t-rs6000: Fix dependencies for moved files. * config/v850/t-v850: Fix dependencies for moved files. * config/v850/t-v850e: Fix dependencies for moved files. * config/m32c/m32c-pragma.c * po/exgettext: Look in c-family/ also. c-family/ChangeLog: * c-common.c: Include gt-c-family-c-common.h. * c-pragma.c: Include gt-c-family-c-pragma.h. objc/ChangeLog: * objc-act.c: Update include path for moved files. * objc-lang.c: Likewise. * config-lang.in: Update paths in gtfiles for files in c-family/. objcp/ChangeLog: * objcp-lang.c: Update include path for moved files. * config-lang.in: Update paths in gtfiles for files in c-family/. cp/ChangeLog: * typeck.c: Update include path for moved files. * decl.c: Likewise. * rtti.c: Likewise. * cp-gimplify.c: Likewise. * cp-lang.c: Likewise. * pt.c: Likewise. * semantics.c: Likewise. * cxx-pretty-print.h: Likewise. * decl2.c: Likewise. * parser.c: Likewise. * cp-objcp-common.c: Likewise. * cp-tree.h: Likewise. * name-lookup.c: Likewise. * lex.c: Likewise. * name-lookup.h: Likewise. * config-lang.in: Update paths in gtfiles for files in c-family/. * Make-lang.in: Likewise. From-SVN: r160330
2010-06-05 22:33:22 +02:00
#include "c-family/c-common.h"
hashtable.h (struct ht_identifier): Add data member "hash_value". * hashtable.h (struct ht_identifier): Add data member "hash_value". * hashtable.c (ht_lookup): Use it when searching, remember. (ht_expand): Do not recompute. * tree.h (IDENTIFIER_HASH_VALUE): New macro. cp/ * cp-tree.h (struct lang_type_class): Replace data member tags with hash-table nested_udts. (CLASSTYPE_NESTED_UTDS): Rename from CLASSTYPE_TAGS. * class.c (unreverse_member_declarations): Don't touch CLASSTYPE_TAGS. (pushclass): Use cxx_remember_type_decls. * decl.c (struct cp_binding_level): Replace data member tags with hash-table type_decls. (pop_binding_level): Handle level->type_decls. (kept_level_p): Adjust. (poplevel): Remove unused local variable. (bt_print_entry): New function. (print_binding_level): Use it. (push_namespace): Build current_binding_level->type_decls. (maybe_process_template_type_declaration): Adjust. (pushtag): Likewise. (clear_anon_tags): Use binding_table_remove_anonymous_types. (gettags): Remove. (cxx_remember_type_decls): Rename from storetags. Adjust. (lookup_tag): Use binding_table_find_anon_type. Tidy. (lookup_tag_reverse): Use binding_table_reverse_maybe_remap. (cxx_init_decl_processing): Build global_binding_level->type_decls. (store_parm_decls): Remove pointless code. * name-lookup.c (free_binding_entry): New variable. (ENTRY_INDEX): New macro. (struct binding_table_s): New datatype. (binding_entry_make): New function. (binding_entry_free): Likewise. (binding_table_construct): Likewise. (binding_table_free): Likewise. (binding_table_new): Likewise. (binding_table_expand): Likewise. (binding_table_insert): Likewise. (binding_table_find): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (binding_table_remove_anonymous_types): Likewise. (binding_table_foreach): Likewise. * name-lookup.h (binding_table): New type. (binding_entry): Likewise. (bt_foreach_proc): Likewise. (struct binding_entry_s): New datatype. (SCOPE_DEFAULT_HT_SIZE): New macro. (CLASS_SCOPE_HT_SIZE): Likewise. (NAMESPACE_ORDINARY_HT_SIZE): Likewise. (NAMESPACE_STD_HT_SIZE): Likewise. (GLOBAL_SCOPE_HT_SIZE): Likewise. (binding_table_new): Declare. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (binding_table_remove_anonymous_types): Likewise. (binding_table_foreach): Likewise. (binding_table_find): Likewise. (cxx_remember_type_decls): Likewise. * pt.c (bt_instantiate_type_proc): New function. (do_type_instantiation): Use it. * search.c (lookup_field_r): Use binding_table_find. From-SVN: r66930
2003-05-18 15:40:54 +02:00
/* The type of dictionary used to map names to types declared at
a given scope. */
typedef struct binding_table_s *binding_table;
typedef struct binding_entry_s *binding_entry;
/* The type of a routine repeatedly called by binding_table_foreach. */
typedef void (*bt_foreach_proc) (binding_entry, void *);
hashtab.h: Update GTY annotations to new syntax 2009-04-21 Taras Glek <tglek@mozilla.com> * include/hashtab.h: Update GTY annotations to new syntax * include/splay-tree.h: Likewise gcc/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * alias.c: Update GTY annotations to new syntax * basic-block.h: Likewise * bitmap.h: Likewise * c-common.h: Likewise * c-decl.c: Likewise * c-parser.c: Likewise * c-pragma.c: Likewise * c-tree.h: Likewise * cfgloop.h: Likewise * cgraph.h: Likewise * config/alpha/alpha.c: Likewise * config/arm/arm.h: Likewise * config/avr/avr.h: Likewise * config/bfin/bfin.c: Likewise * config/cris/cris.c: Likewise * config/darwin.c: Likewise * config/frv/frv.c: Likewise * config/i386/i386.c: Likewise * config/i386/i386.h: Likewise * config/i386/winnt.c: Likewise * config/ia64/ia64.h: Likewise * config/iq2000/iq2000.c: Likewise * config/mips/mips.c: Likewise * config/mmix/mmix.h: Likewise * config/pa/pa.c: Likewise * config/pa/pa.h: Likewise * config/rs6000/rs6000.c: Likewise * config/s390/s390.c: Likewise * config/sparc/sparc.c: Likewise * config/xtensa/xtensa.c: Likewise * cselib.h: Likewise * dbxout.c: Likewise * dwarf2out.c: Likewise * except.c: Likewise * except.h: Likewise * fixed-value.h: Likewise * function.c: Likewise * function.h: Likewise * gimple.h: Likewise * integrate.c: Likewise * optabs.c: Likewise * output.h: Likewise * real.h: Likewise * rtl.h: Likewise * stringpool.c: Likewise * tree-data-ref.c: Likewise * tree-flow.h: Likewise * tree-scalar-evolution.c: Likewise * tree-ssa-address.c: Likewise * tree-ssa-alias.h: Likewise * tree-ssa-operands.h: Likewise * tree.c: Likewise * tree.h: Likewise * varasm.c: Likewise * varray.h: Likewise * vec.h: Likewise * coretypes.h: Do not define GTY macro if it is already defined * doc/gty.texi: Update GTY documentation to new syntax * gengtype-lex.l: Enforce attribute-like syntax for GTY annotations on structs * gengtype-parse.c: Likewise gcc/ada/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * gcc-interface/ada-tree.h: Update GTY annotations to new syntax * gcc-interface/trans.c: Likewise * gcc-interface/utils.c: Likewise gcc/cp/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * cp-tree.h: Update GTY annotations to new syntax * decl.c: Likewise * mangle.c: Likewise * name-lookup.c: Likewise * name-lookup.h: Likewise * parser.c: Likewise * pt.c: Likewise * rtti.c: Likewise * semantics.c: Likewise * typeck2.c: Likewise gcc/fortran/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * f95-lang.c: Update GTY annotations to new syntax * trans-intrinsic.c: Likewise * trans-io.c: Likewise * trans.h: Likewise gcc/java/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * builtins.c: Update GTY annotations to new syntax * decl.c: Likewise * java-tree.h: Likewise * jcf.h: Likewise * lang.c: Likewise gcc/objc/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * objc-act.c: Update GTY annotations to new syntax * objc-act.h: Likewise libcpp/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * include/cpp-id-data.h: Update GTY annotations to new syntax * include/cpplib.h: Likewise * include/line-map.h: Likewise * include/symtab.h: Likewise From-SVN: r146607
2009-04-22 20:29:36 +02:00
struct GTY(()) binding_entry_s {
hashtable.h (struct ht_identifier): Add data member "hash_value". * hashtable.h (struct ht_identifier): Add data member "hash_value". * hashtable.c (ht_lookup): Use it when searching, remember. (ht_expand): Do not recompute. * tree.h (IDENTIFIER_HASH_VALUE): New macro. cp/ * cp-tree.h (struct lang_type_class): Replace data member tags with hash-table nested_udts. (CLASSTYPE_NESTED_UTDS): Rename from CLASSTYPE_TAGS. * class.c (unreverse_member_declarations): Don't touch CLASSTYPE_TAGS. (pushclass): Use cxx_remember_type_decls. * decl.c (struct cp_binding_level): Replace data member tags with hash-table type_decls. (pop_binding_level): Handle level->type_decls. (kept_level_p): Adjust. (poplevel): Remove unused local variable. (bt_print_entry): New function. (print_binding_level): Use it. (push_namespace): Build current_binding_level->type_decls. (maybe_process_template_type_declaration): Adjust. (pushtag): Likewise. (clear_anon_tags): Use binding_table_remove_anonymous_types. (gettags): Remove. (cxx_remember_type_decls): Rename from storetags. Adjust. (lookup_tag): Use binding_table_find_anon_type. Tidy. (lookup_tag_reverse): Use binding_table_reverse_maybe_remap. (cxx_init_decl_processing): Build global_binding_level->type_decls. (store_parm_decls): Remove pointless code. * name-lookup.c (free_binding_entry): New variable. (ENTRY_INDEX): New macro. (struct binding_table_s): New datatype. (binding_entry_make): New function. (binding_entry_free): Likewise. (binding_table_construct): Likewise. (binding_table_free): Likewise. (binding_table_new): Likewise. (binding_table_expand): Likewise. (binding_table_insert): Likewise. (binding_table_find): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (binding_table_remove_anonymous_types): Likewise. (binding_table_foreach): Likewise. * name-lookup.h (binding_table): New type. (binding_entry): Likewise. (bt_foreach_proc): Likewise. (struct binding_entry_s): New datatype. (SCOPE_DEFAULT_HT_SIZE): New macro. (CLASS_SCOPE_HT_SIZE): Likewise. (NAMESPACE_ORDINARY_HT_SIZE): Likewise. (NAMESPACE_STD_HT_SIZE): Likewise. (GLOBAL_SCOPE_HT_SIZE): Likewise. (binding_table_new): Declare. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (binding_table_remove_anonymous_types): Likewise. (binding_table_foreach): Likewise. (binding_table_find): Likewise. (cxx_remember_type_decls): Likewise. * pt.c (bt_instantiate_type_proc): New function. (do_type_instantiation): Use it. * search.c (lookup_field_r): Use binding_table_find. From-SVN: r66930
2003-05-18 15:40:54 +02:00
binding_entry chain;
tree name;
tree type;
};
/* These macros indicate the initial chains count for binding_table. */
#define SCOPE_DEFAULT_HT_SIZE (1 << 3)
#define CLASS_SCOPE_HT_SIZE (1 << 3)
#define NAMESPACE_ORDINARY_HT_SIZE (1 << 5)
#define NAMESPACE_STD_HT_SIZE (1 << 8)
#define GLOBAL_SCOPE_HT_SIZE (1 << 8)
hashtable.h (struct ht_identifier): Add data member "hash_value". * hashtable.h (struct ht_identifier): Add data member "hash_value". * hashtable.c (ht_lookup): Use it when searching, remember. (ht_expand): Do not recompute. * tree.h (IDENTIFIER_HASH_VALUE): New macro. cp/ * cp-tree.h (struct lang_type_class): Replace data member tags with hash-table nested_udts. (CLASSTYPE_NESTED_UTDS): Rename from CLASSTYPE_TAGS. * class.c (unreverse_member_declarations): Don't touch CLASSTYPE_TAGS. (pushclass): Use cxx_remember_type_decls. * decl.c (struct cp_binding_level): Replace data member tags with hash-table type_decls. (pop_binding_level): Handle level->type_decls. (kept_level_p): Adjust. (poplevel): Remove unused local variable. (bt_print_entry): New function. (print_binding_level): Use it. (push_namespace): Build current_binding_level->type_decls. (maybe_process_template_type_declaration): Adjust. (pushtag): Likewise. (clear_anon_tags): Use binding_table_remove_anonymous_types. (gettags): Remove. (cxx_remember_type_decls): Rename from storetags. Adjust. (lookup_tag): Use binding_table_find_anon_type. Tidy. (lookup_tag_reverse): Use binding_table_reverse_maybe_remap. (cxx_init_decl_processing): Build global_binding_level->type_decls. (store_parm_decls): Remove pointless code. * name-lookup.c (free_binding_entry): New variable. (ENTRY_INDEX): New macro. (struct binding_table_s): New datatype. (binding_entry_make): New function. (binding_entry_free): Likewise. (binding_table_construct): Likewise. (binding_table_free): Likewise. (binding_table_new): Likewise. (binding_table_expand): Likewise. (binding_table_insert): Likewise. (binding_table_find): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (binding_table_remove_anonymous_types): Likewise. (binding_table_foreach): Likewise. * name-lookup.h (binding_table): New type. (binding_entry): Likewise. (bt_foreach_proc): Likewise. (struct binding_entry_s): New datatype. (SCOPE_DEFAULT_HT_SIZE): New macro. (CLASS_SCOPE_HT_SIZE): Likewise. (NAMESPACE_ORDINARY_HT_SIZE): Likewise. (NAMESPACE_STD_HT_SIZE): Likewise. (GLOBAL_SCOPE_HT_SIZE): Likewise. (binding_table_new): Declare. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (binding_table_remove_anonymous_types): Likewise. (binding_table_foreach): Likewise. (binding_table_find): Likewise. (cxx_remember_type_decls): Likewise. * pt.c (bt_instantiate_type_proc): New function. (do_type_instantiation): Use it. * search.c (lookup_field_r): Use binding_table_find. From-SVN: r66930
2003-05-18 15:40:54 +02:00
extern void binding_table_foreach (binding_table, bt_foreach_proc, void *);
extern binding_entry binding_table_find (binding_table, tree);
/* Datatype that represents binding established by a declaration between
a name and a C++ entity. */
typedef struct cxx_binding cxx_binding;
/* The datatype used to implement C++ scope. */
typedef struct cp_binding_level cp_binding_level;
/* Nonzero if this binding is for a local scope, as opposed to a class
or namespace scope. */
#define LOCAL_BINDING_P(NODE) ((NODE)->is_local)
/* True if NODE->value is from a base class of the class which is
currently being defined. */
#define INHERITED_VALUE_BINDING_P(NODE) ((NODE)->value_is_inherited)
hashtab.h: Update GTY annotations to new syntax 2009-04-21 Taras Glek <tglek@mozilla.com> * include/hashtab.h: Update GTY annotations to new syntax * include/splay-tree.h: Likewise gcc/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * alias.c: Update GTY annotations to new syntax * basic-block.h: Likewise * bitmap.h: Likewise * c-common.h: Likewise * c-decl.c: Likewise * c-parser.c: Likewise * c-pragma.c: Likewise * c-tree.h: Likewise * cfgloop.h: Likewise * cgraph.h: Likewise * config/alpha/alpha.c: Likewise * config/arm/arm.h: Likewise * config/avr/avr.h: Likewise * config/bfin/bfin.c: Likewise * config/cris/cris.c: Likewise * config/darwin.c: Likewise * config/frv/frv.c: Likewise * config/i386/i386.c: Likewise * config/i386/i386.h: Likewise * config/i386/winnt.c: Likewise * config/ia64/ia64.h: Likewise * config/iq2000/iq2000.c: Likewise * config/mips/mips.c: Likewise * config/mmix/mmix.h: Likewise * config/pa/pa.c: Likewise * config/pa/pa.h: Likewise * config/rs6000/rs6000.c: Likewise * config/s390/s390.c: Likewise * config/sparc/sparc.c: Likewise * config/xtensa/xtensa.c: Likewise * cselib.h: Likewise * dbxout.c: Likewise * dwarf2out.c: Likewise * except.c: Likewise * except.h: Likewise * fixed-value.h: Likewise * function.c: Likewise * function.h: Likewise * gimple.h: Likewise * integrate.c: Likewise * optabs.c: Likewise * output.h: Likewise * real.h: Likewise * rtl.h: Likewise * stringpool.c: Likewise * tree-data-ref.c: Likewise * tree-flow.h: Likewise * tree-scalar-evolution.c: Likewise * tree-ssa-address.c: Likewise * tree-ssa-alias.h: Likewise * tree-ssa-operands.h: Likewise * tree.c: Likewise * tree.h: Likewise * varasm.c: Likewise * varray.h: Likewise * vec.h: Likewise * coretypes.h: Do not define GTY macro if it is already defined * doc/gty.texi: Update GTY documentation to new syntax * gengtype-lex.l: Enforce attribute-like syntax for GTY annotations on structs * gengtype-parse.c: Likewise gcc/ada/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * gcc-interface/ada-tree.h: Update GTY annotations to new syntax * gcc-interface/trans.c: Likewise * gcc-interface/utils.c: Likewise gcc/cp/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * cp-tree.h: Update GTY annotations to new syntax * decl.c: Likewise * mangle.c: Likewise * name-lookup.c: Likewise * name-lookup.h: Likewise * parser.c: Likewise * pt.c: Likewise * rtti.c: Likewise * semantics.c: Likewise * typeck2.c: Likewise gcc/fortran/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * f95-lang.c: Update GTY annotations to new syntax * trans-intrinsic.c: Likewise * trans-io.c: Likewise * trans.h: Likewise gcc/java/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * builtins.c: Update GTY annotations to new syntax * decl.c: Likewise * java-tree.h: Likewise * jcf.h: Likewise * lang.c: Likewise gcc/objc/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * objc-act.c: Update GTY annotations to new syntax * objc-act.h: Likewise libcpp/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * include/cpp-id-data.h: Update GTY annotations to new syntax * include/cpplib.h: Likewise * include/line-map.h: Likewise * include/symtab.h: Likewise From-SVN: r146607
2009-04-22 20:29:36 +02:00
struct GTY(()) cxx_binding {
/* Link to chain together various bindings for this name. */
cxx_binding *previous;
/* The non-type entity this name is bound to. */
tree value;
/* The type entity this name is bound to. */
tree type;
/* The scope at which this binding was made. */
cp_binding_level *scope;
unsigned value_is_inherited : 1;
unsigned is_local : 1;
};
/* Datatype used to temporarily save C++ bindings (for implicit
instantiations purposes and like). Implemented in decl.c. */
remove more useless typedefs gcc/c-family/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless typedefs. gcc/c/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. gcc/cp/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, method.c, name-lookup.h, parser.c, parser.h, rtti.c, semantics.c, typeck2.c: Remove useless typedefs. gcc/fortran/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * dependency.c, dependency.h, gfortran.h, io.c, module.c, parse.h, resolve.c, trans-types.h, trans.h: remove useless typedefs. gcc/lto/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * lto.h: Remove useless typedefs. gcc/objc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: Remove useless typedefs. gcc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless typedefs. From-SVN: r227001
2015-08-19 04:48:48 +02:00
struct GTY(()) cxx_saved_binding {
/* The name of the current binding. */
tree identifier;
/* The binding we're saving. */
cxx_binding *binding;
tree real_type_value;
remove more useless typedefs gcc/c-family/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless typedefs. gcc/c/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. gcc/cp/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, method.c, name-lookup.h, parser.c, parser.h, rtti.c, semantics.c, typeck2.c: Remove useless typedefs. gcc/fortran/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * dependency.c, dependency.h, gfortran.h, io.c, module.c, parse.h, resolve.c, trans-types.h, trans.h: remove useless typedefs. gcc/lto/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * lto.h: Remove useless typedefs. gcc/objc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: Remove useless typedefs. gcc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless typedefs. From-SVN: r227001
2015-08-19 04:48:48 +02:00
};
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern tree identifier_type_value (tree);
extern void set_identifier_type_value (tree, tree);
extern void push_binding (tree, tree, cp_binding_level*);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern void pop_binding (tree, tree);
extern void pop_bindings_and_leave_scope (void);
extern tree constructor_name (tree);
extern bool constructor_name_p (tree, tree);
/* The kinds of scopes we recognize. */
remove more useless typedefs gcc/c-family/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless typedefs. gcc/c/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. gcc/cp/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, method.c, name-lookup.h, parser.c, parser.h, rtti.c, semantics.c, typeck2.c: Remove useless typedefs. gcc/fortran/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * dependency.c, dependency.h, gfortran.h, io.c, module.c, parse.h, resolve.c, trans-types.h, trans.h: remove useless typedefs. gcc/lto/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * lto.h: Remove useless typedefs. gcc/objc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: Remove useless typedefs. gcc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless typedefs. From-SVN: r227001
2015-08-19 04:48:48 +02:00
enum scope_kind {
sk_block = 0, /* An ordinary block scope. This enumerator must
have the value zero because "cp_binding_level"
is initialized by using "memset" to set the
contents to zero, and the default scope kind
is "sk_block". */
sk_cleanup, /* A scope for (pseudo-)scope for cleanup. It is
pseudo in that it is transparent to name lookup
activities. */
sk_try, /* A try-block. */
sk_catch, /* A catch-block. */
sk_for, /* The scope of the variable declared in a
Implement P0305R1, Selection statements with initializer. * cp-array-notation.c (create_an_loop): Call finish_init_stmt instead of finish_for_init_stmt. * cp-tree.h (finish_for_init_stmt): Rename to finish_init_stmt. * decl.c (poplevel): Adjust a comment. * init.c (build_vec_init): Call finish_init_stmt instead of finish_for_init_stmt. * name-lookup.c (pushdecl_maybe_friend_1): Adjust a comment. * name-lookup.h (enum scope_kind): Likewise. * parser.c (cp_parser_statement): Update commentary. (cp_parser_init_statement_p): New function. (cp_parser_selection_statement): Parse the optional init-statement. (cp_parser_for): Call finish_init_stmt instead of finish_for_init_stmt. (cp_parser_c_for): Likewise. (cp_convert_range_for): Call finish_init_stmt instead of finish_for_init_stmt. (cp_parser_range_for_member_function): Update commentary. (cp_parser_iteration_statement): (cp_parser_for_init_statement): Rename to cp_parser_init_statement. * pt.c (tsubst_omp_for_iterator): Update commentary. (tsubst_expr): Call finish_init_stmt instead of finish_for_init_stmt. * semantics.c (finish_for_init_stmt): Rename to finish_init_stmt. Update commentary. * g++.dg/cpp1z/init-statement1.C: New test. * g++.dg/cpp1z/init-statement2.C: New test. * g++.dg/cpp1z/init-statement3.C: New test. * g++.dg/cpp1z/init-statement4.C: New test. * g++.dg/cpp1z/init-statement5.C: New test. * g++.dg/cpp1z/init-statement6.C: New test. * g++.dg/cpp1z/init-statement7.C: New test. * g++.dg/cpp1z/init-statement8.C: New test. From-SVN: r240798
2016-10-05 20:02:06 +02:00
init-statement. */
sk_cond, /* The scope of the variable declared in the condition
of an if or switch statement. */
sk_function_parms, /* The scope containing function parameters. */
sk_class, /* The scope containing the members of a class. */
c-common.c (do_switch_warnings): Look through the CONST_DECLs in the enumerators of an ENUMERAL_TYPE. 2008-08-26 Douglas Gregor <doug.gregor@gmail.com> * c-common.c (do_switch_warnings): Look through the CONST_DECLs in the enumerators of an ENUMERAL_TYPE. * dbxout.c (dbxout_type): Ditto. 2008-08-26 Douglas Gregor <doug.gregor@gmail.com> * typeck.c (type_after_usual_arithmetic_conversions): Don't do the usual arithmetic conversions on scoped enumeration types. (common_type): Ditto. (default_conversion): Don't perform integral promotions on scoped enumeration types. (build_array_ref): Scoped enumeration types can't be used as subscripts. * decl.c (start_enum): If building a C++0x scoped enumeration, enter its scope. If provided with an underlying type, check that underlying type and set up the enumeration type accordingly. (finish_enum): Only compute an underlying type if the underlying type isn't already fixed, and only convert the enumerator values now if we've just computed the underlying type. Finish the scope of C++0x scoped enumerations. (build_enumerator): For enumerations with a fixed underlying type, check the enumerator values when the enumerator is defined. (lookup_enumerator): New. * call.c (standard_conversion): Don't allow assignment from integers to scoped enumeration types, even with -fpermissive. Don't convert from scoped enumerations to bool or any arithmetic types. (build_conditional_expr): Don't per the usual arithmetic conversions for scoped enumeration types. (convert_like_real): Check complain to see if we should produce warnings. * error.c (class_key_or_enum_as_string): Print scoped enums. * cp-tree.h (MAYBE_CLASS_TYPE_P): Check CLASS_TYPE_P, not TYPE_LANG_FLAG_5. (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P): New. (SCOPED_ENUM_P): New. (UNSCOPED_ENUM_P): New. (SET_SCOPED_ENUM_P): New. (ENUM_UNDERLYING_TYPE): New. * pt.c (lookup_template_class): Update the instantiation of enum types to deal with C++0x scoped enumerations and underlying types. * name-lookup.c (begin_scope): Deal with scoped enumeration scopes. (lookup_qualified_name): Deal with lookup into enumeration types. * name-lookup.h (enum scope_kind): Add sk_scoped_enum. * parser.c (cp_parser_class_or_namespace_name): Rename to... (cp_parser_qualifying_entity): ... this. Also, in C++0x mode, parse a type-name that can be an enumeration type. (cp_parser_nested_name_specifier_opt): Update with C++0x grammar. (cp_parser_elaborated_type_specifier): Parse the optional `struct' or `class' following enum (in C++0x). (cp_parser_enum_specifier): Parse C++0x scoped enumerations and enum-base clauses. 2008-08-26 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/cpp0x/scoped_enum_examples.C: New. * g++.dg/cpp0x/scoped_enum.C: New. * g++.dg/cpp0x/scoped_enum_98.C: New. * g++.dg/cpp0x/enum_base_warn.C: New. * g++.dg/cpp0x/enum_base.C: New. From-SVN: r139611
2008-08-27 00:33:10 +02:00
sk_scoped_enum, /* The scope containing the enumertors of a C++0x
scoped enumeration. */
sk_namespace, /* The scope containing the members of a
namespace, including the global scope. */
sk_template_parms, /* A scope for template parameters. */
sk_template_spec, /* Like sk_template_parms, but for an explicit
specialization. Since, by definition, an
explicit specialization is introduced by
"template <>", this scope is always empty. */
Implement N4514, C++ Extensions for Transactional Memory. gcc/ * builtins.def (BUILT_IN_ABORT): Add transaction_pure attribute. gcc/c-family/ * c-common.c (c_common_reswords): Add C++ TM TS keywords. (c_common_attribute_table): Add transaction_safe_dynamic. transaction_safe now affects type identity. (handle_tm_attribute): Handle transaction_safe_dynamic. * c-common.h (enum rid): Add RID_ATOMIC_NOEXCEPT, RID_ATOMIC_CANCEL, RID_SYNCHRONIZED. (OBJC_IS_CXX_KEYWORD): Add RID_SYNCHRONIZED. (D_TRANSMEM): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_transactional_memory. * c-pretty-print.c (pp_c_attributes_display): Don't print transaction_safe in C++. gcc/c/ * c-parser.c (c_lex_one_token): Handle @synchronized. * c-decl.c (match_builtin_function_types): A declaration of a built-in can change whether the function is transaction_safe. gcc/cp/ * cp-tree.h (struct cp_declarator): Add tx_qualifier field. (BCS_NORMAL, BCS_TRANSACTION): New enumerators. * lex.c (init_reswords): Limit TM kewords to -fgnu-tm. * parser.c (cp_lexer_get_preprocessor_token): Fix @synchronized. (make_call_declarator): Take tx_qualifier. (cp_parser_tx_qualifier_opt): New. (cp_parser_lambda_declarator_opt): Use it. (cp_parser_direct_declarator): Likewise. (cp_parser_statement): Handle atomic_noexcept, atomic_cancel. (cp_parser_compound_statement): Change in_try parameter to bcs_flags. (cp_parser_std_attribute): Map optimize_for_synchronized to transaction_callable. (cp_parser_transaction): Take the token. Handle atomic_noexcept. * lambda.c (maybe_add_lambda_conv_op): Handle transaction-safety. * call.c (enum conversion_kind): Add ck_tsafe. (standard_conversion): Handle transaction-safety conversion. (convert_like_real, resolve_address_of_overloaded_function): Likewise. (check_methods): Diagnose transaction_safe_dynamic on non-virtual function. (look_for_tm_attr_overrides): Don't inherit transaction_safe_dynamic. * cvt.c (tx_safe_fn_type_p, tx_unsafe_fn_variant) (can_convert_tx_safety): New. * typeck.c (composite_pointer_type): Handle transaction-safety. * name-lookup.h (enum scope_kind): Add sk_transaction. * name-lookup.c (begin_scope): Handle it. * semantics.c (begin_compound_stmt): Pass it. * decl.c (check_previous_goto_1): Check it. (struct named_label_entry): Add in_transaction_scope. (poplevel_named_label_1): Set it. (check_goto): Check it. (duplicate_decls): A specialization can be transaction_safe independently of its template. (grokdeclarator): Handle tx-qualifier. * rtti.c (ptr_initializer): Handle transaction-safe. * search.c (check_final_overrider): Check transaction_safe_dynamic. Don't check transaction_safe. * mangle.c (write_function_type): Mangle transaction_safe here. (write_CV_qualifiers_for_type): Not here. (write_type): Preserve transaction_safe when stripping attributes. * error.c (dump_type_suffix): Print transaction_safe. libiberty/ * cp-demangle.c (d_cv_qualifiers): Dx means transaction_safe. (cplus_demangle_type): Let d_cv_qualifiers handle it. (d_dump, d_make_comp, has_return_type, d_encoding) (d_count_templates_scopes, d_print_comp_inner) (d_print_mod_list, d_print_mod, d_print_function_type) (is_ctor_or_dtor): Handle DEMANGLE_COMPONENT_TRANSACTION_SAFE. From-SVN: r228462
2015-10-04 21:17:19 +02:00
sk_transaction, /* A synchronized or atomic statement. */
2006-06-06 13:44:09 +02:00
sk_omp /* An OpenMP structured block. */
remove more useless typedefs gcc/c-family/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless typedefs. gcc/c/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. gcc/cp/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, method.c, name-lookup.h, parser.c, parser.h, rtti.c, semantics.c, typeck2.c: Remove useless typedefs. gcc/fortran/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * dependency.c, dependency.h, gfortran.h, io.c, module.c, parse.h, resolve.c, trans-types.h, trans.h: remove useless typedefs. gcc/lto/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * lto.h: Remove useless typedefs. gcc/objc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: Remove useless typedefs. gcc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless typedefs. From-SVN: r227001
2015-08-19 04:48:48 +02:00
};
/* The scope where the class/struct/union/enum tag applies. */
remove more useless typedefs gcc/c-family/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless typedefs. gcc/c/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. gcc/cp/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, method.c, name-lookup.h, parser.c, parser.h, rtti.c, semantics.c, typeck2.c: Remove useless typedefs. gcc/fortran/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * dependency.c, dependency.h, gfortran.h, io.c, module.c, parse.h, resolve.c, trans-types.h, trans.h: remove useless typedefs. gcc/lto/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * lto.h: Remove useless typedefs. gcc/objc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: Remove useless typedefs. gcc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless typedefs. From-SVN: r227001
2015-08-19 04:48:48 +02:00
enum tag_scope {
ts_current = 0, /* Current scope only. This is for the
class-key identifier;
case mentioned in [basic.lookup.elab]/2,
or the class/enum definition
class-key identifier { ... }; */
ts_global = 1, /* All scopes. This is the 3.4.1
[basic.lookup.unqual] lookup mentioned
in [basic.lookup.elab]/2. */
ts_within_enclosing_non_class = 2, /* Search within enclosing non-class
only, for friend class lookup
according to [namespace.memdef]/3
and [class.friend]/9. */
ts_lambda = 3 /* Declaring a lambda closure. */
remove more useless typedefs gcc/c-family/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless typedefs. gcc/c/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. gcc/cp/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, method.c, name-lookup.h, parser.c, parser.h, rtti.c, semantics.c, typeck2.c: Remove useless typedefs. gcc/fortran/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * dependency.c, dependency.h, gfortran.h, io.c, module.c, parse.h, resolve.c, trans-types.h, trans.h: remove useless typedefs. gcc/lto/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * lto.h: Remove useless typedefs. gcc/objc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: Remove useless typedefs. gcc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless typedefs. From-SVN: r227001
2015-08-19 04:48:48 +02:00
};
remove more useless typedefs gcc/c-family/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless typedefs. gcc/c/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. gcc/cp/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, method.c, name-lookup.h, parser.c, parser.h, rtti.c, semantics.c, typeck2.c: Remove useless typedefs. gcc/fortran/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * dependency.c, dependency.h, gfortran.h, io.c, module.c, parse.h, resolve.c, trans-types.h, trans.h: remove useless typedefs. gcc/lto/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * lto.h: Remove useless typedefs. gcc/objc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: Remove useless typedefs. gcc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless typedefs. From-SVN: r227001
2015-08-19 04:48:48 +02:00
struct GTY(()) cp_class_binding {
cxx_binding *base;
/* The bound name. */
tree identifier;
remove more useless typedefs gcc/c-family/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless typedefs. gcc/c/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. gcc/cp/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, method.c, name-lookup.h, parser.c, parser.h, rtti.c, semantics.c, typeck2.c: Remove useless typedefs. gcc/fortran/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * dependency.c, dependency.h, gfortran.h, io.c, module.c, parse.h, resolve.c, trans-types.h, trans.h: remove useless typedefs. gcc/lto/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * lto.h: Remove useless typedefs. gcc/objc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: Remove useless typedefs. gcc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless typedefs. From-SVN: r227001
2015-08-19 04:48:48 +02:00
};
remove more useless typedefs gcc/c-family/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless typedefs. gcc/c/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. gcc/cp/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, method.c, name-lookup.h, parser.c, parser.h, rtti.c, semantics.c, typeck2.c: Remove useless typedefs. gcc/fortran/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * dependency.c, dependency.h, gfortran.h, io.c, module.c, parse.h, resolve.c, trans-types.h, trans.h: remove useless typedefs. gcc/lto/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * lto.h: Remove useless typedefs. gcc/objc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: Remove useless typedefs. gcc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless typedefs. From-SVN: r227001
2015-08-19 04:48:48 +02:00
struct GTY(()) cp_label_binding {
/* The bound LABEL_DECL. */
tree label;
/* The previous IDENTIFIER_LABEL_VALUE. */
tree prev_value;
remove more useless typedefs gcc/c-family/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h, c-objc.h, c-ppoutput.c, c-pragma.c, c-pragma.h: Remove useless typedefs. gcc/c/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs. gcc/cp/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, method.c, name-lookup.h, parser.c, parser.h, rtti.c, semantics.c, typeck2.c: Remove useless typedefs. gcc/fortran/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * dependency.c, dependency.h, gfortran.h, io.c, module.c, parse.h, resolve.c, trans-types.h, trans.h: remove useless typedefs. gcc/lto/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * lto.h: Remove useless typedefs. gcc/objc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * objc-act.h, objc-next-runtime-abi-02.c, objc-runtime-hooks.h: Remove useless typedefs. gcc/ChangeLog: 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> * bb-reorder.c, cfgloop.h, collect2.c, combine.c, dse.c, dwarf2cfi.c, gcse-common.h, genopinit.c, ggc-page.c, machmode.h, mcf.c, modulo-sched.c, omp-low.c, read-rtl.c, sched-rgn.c, signop.h, tree-call-cdce.c, tree-dfa.c, tree-diagnostic.c, tree-inline.h, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-loop-niter.c, tree-ssa-loop.h, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.h, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-ssa.h, tree-vect-loop-manip.c, tree-vectorizer.h, tree-vrp.c, var-tracking.c: Remove useless typedefs. From-SVN: r227001
2015-08-19 04:48:48 +02:00
};
/* For each binding contour we allocate a binding_level structure
which records the names defined in that contour.
Contours include:
0) the global one
1) one for each function definition,
where internal declarations of the parameters appear.
2) one for each compound statement,
to record its declarations.
The current meaning of a name can be found by searching the levels
from the current one out to the global one.
Off to the side, may be the class_binding_level. This exists only
to catch class-local declarations. It is otherwise nonexistent.
Also there may be binding levels that catch cleanups that must be
run when exceptions occur. Thus, to see whether a name is bound in
the current scope, it is not enough to look in the
CURRENT_BINDING_LEVEL. You should use lookup_name_current_level
instead. */
/* Note that the information in the `names' component of the global contour
is duplicated in the IDENTIFIER_GLOBAL_VALUEs of all identifiers. */
hashtab.h: Update GTY annotations to new syntax 2009-04-21 Taras Glek <tglek@mozilla.com> * include/hashtab.h: Update GTY annotations to new syntax * include/splay-tree.h: Likewise gcc/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * alias.c: Update GTY annotations to new syntax * basic-block.h: Likewise * bitmap.h: Likewise * c-common.h: Likewise * c-decl.c: Likewise * c-parser.c: Likewise * c-pragma.c: Likewise * c-tree.h: Likewise * cfgloop.h: Likewise * cgraph.h: Likewise * config/alpha/alpha.c: Likewise * config/arm/arm.h: Likewise * config/avr/avr.h: Likewise * config/bfin/bfin.c: Likewise * config/cris/cris.c: Likewise * config/darwin.c: Likewise * config/frv/frv.c: Likewise * config/i386/i386.c: Likewise * config/i386/i386.h: Likewise * config/i386/winnt.c: Likewise * config/ia64/ia64.h: Likewise * config/iq2000/iq2000.c: Likewise * config/mips/mips.c: Likewise * config/mmix/mmix.h: Likewise * config/pa/pa.c: Likewise * config/pa/pa.h: Likewise * config/rs6000/rs6000.c: Likewise * config/s390/s390.c: Likewise * config/sparc/sparc.c: Likewise * config/xtensa/xtensa.c: Likewise * cselib.h: Likewise * dbxout.c: Likewise * dwarf2out.c: Likewise * except.c: Likewise * except.h: Likewise * fixed-value.h: Likewise * function.c: Likewise * function.h: Likewise * gimple.h: Likewise * integrate.c: Likewise * optabs.c: Likewise * output.h: Likewise * real.h: Likewise * rtl.h: Likewise * stringpool.c: Likewise * tree-data-ref.c: Likewise * tree-flow.h: Likewise * tree-scalar-evolution.c: Likewise * tree-ssa-address.c: Likewise * tree-ssa-alias.h: Likewise * tree-ssa-operands.h: Likewise * tree.c: Likewise * tree.h: Likewise * varasm.c: Likewise * varray.h: Likewise * vec.h: Likewise * coretypes.h: Do not define GTY macro if it is already defined * doc/gty.texi: Update GTY documentation to new syntax * gengtype-lex.l: Enforce attribute-like syntax for GTY annotations on structs * gengtype-parse.c: Likewise gcc/ada/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * gcc-interface/ada-tree.h: Update GTY annotations to new syntax * gcc-interface/trans.c: Likewise * gcc-interface/utils.c: Likewise gcc/cp/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * cp-tree.h: Update GTY annotations to new syntax * decl.c: Likewise * mangle.c: Likewise * name-lookup.c: Likewise * name-lookup.h: Likewise * parser.c: Likewise * pt.c: Likewise * rtti.c: Likewise * semantics.c: Likewise * typeck2.c: Likewise gcc/fortran/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * f95-lang.c: Update GTY annotations to new syntax * trans-intrinsic.c: Likewise * trans-io.c: Likewise * trans.h: Likewise gcc/java/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * builtins.c: Update GTY annotations to new syntax * decl.c: Likewise * java-tree.h: Likewise * jcf.h: Likewise * lang.c: Likewise gcc/objc/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * objc-act.c: Update GTY annotations to new syntax * objc-act.h: Likewise libcpp/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * include/cpp-id-data.h: Update GTY annotations to new syntax * include/cpplib.h: Likewise * include/line-map.h: Likewise * include/symtab.h: Likewise From-SVN: r146607
2009-04-22 20:29:36 +02:00
struct GTY(()) cp_binding_level {
/* A chain of _DECL nodes for all variables, constants, functions,
and typedef types. These are in the reverse of the order
supplied. There may be OVERLOADs on this list, too, but they
are wrapped in TREE_LISTs; the TREE_VALUE is the OVERLOAD. */
tree names;
/* A chain of NAMESPACE_DECL nodes. */
tree namespaces;
/* An array of static functions and variables (for namespaces only) */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree, va_gc> *static_decls;
/* A list of USING_DECL nodes. */
tree usings;
/* A list of used namespaces. PURPOSE is the namespace,
VALUE the common ancestor with this binding_level's namespace. */
tree using_directives;
/* For the binding level corresponding to a class, the entities
declared in the class or its base classes. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<cp_class_binding, va_gc> *class_shadowed;
/* Similar to class_shadowed, but for IDENTIFIER_TYPE_VALUE, and
is used for all binding levels. The TREE_PURPOSE is the name of
the entity, the TREE_TYPE is the associated type. In addition
the TREE_VALUE is the IDENTIFIER_TYPE_VALUE before we entered
the class. */
tree type_shadowed;
/* Similar to class_shadowed, but for IDENTIFIER_LABEL_VALUE, and
used for all binding levels. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<cp_label_binding, va_gc> *shadowed_labels;
/* For each level (except not the global one),
a chain of BLOCK nodes for all the levels
that were entered and exited one level down. */
tree blocks;
/* The entity (namespace, class, function) the scope of which this
binding contour corresponds to. Otherwise NULL. */
tree this_entity;
/* The binding level which this one is contained in (inherits from). */
cp_binding_level *level_chain;
/* List of VAR_DECLS saved from a previous for statement.
These would be dead in ISO-conforming code, but might
be referenced in ARM-era code. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree, va_gc> *dead_vars_from_for;
/* STATEMENT_LIST for statements in this binding contour.
Only used at present for SK_CLEANUP temporary bindings. */
tree statement_list;
/* Binding depth at which this level began. */
int binding_depth;
/* The kind of scope that this object represents. However, a
SK_TEMPLATE_SPEC scope is represented with KIND set to
SK_TEMPLATE_PARMS and EXPLICIT_SPEC_P set to true. */
ENUM_BITFIELD (scope_kind) kind : 4;
/* True if this scope is an SK_TEMPLATE_SPEC scope. This field is
only valid if KIND == SK_TEMPLATE_PARMS. */
BOOL_BITFIELD explicit_spec_p : 1;
/* true means make a BLOCK for this level regardless of all else. */
unsigned keep : 1;
/* Nonzero if this level can safely have additional
cleanup-needing variables added to it. */
unsigned more_cleanups_ok : 1;
unsigned have_cleanups : 1;
/* Transient state set if this scope is of sk_class kind
and is in the process of defining 'this_entity'. Reset
on leaving the class definition to allow for the scope
to be subsequently re-used as a non-defining scope for
'this_entity'. */
unsigned defining_class_p : 1;
/* 23 bits left to fill a 32-bit word. */
};
/* The binding level currently in effect. */
#define current_binding_level \
(*(cfun && cp_function_chain && cp_function_chain->bindings \
? &cp_function_chain->bindings \
: &scope_chain->bindings))
/* The binding level of the current class, if any. */
#define class_binding_level scope_chain->class_bindings
/* The tree node representing the global scope. */
extern GTY(()) tree global_namespace;
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern GTY(()) tree global_scope_name;
/* Indicates that there is a type value in some namespace, although
that is not necessarily in scope at the moment. */
extern GTY(()) tree global_type_node;
/* True if SCOPE designates the global scope binding contour. */
#define global_scope_p(SCOPE) \
((SCOPE) == NAMESPACE_LEVEL (global_namespace))
extern cp_binding_level *leave_scope (void);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern bool kept_level_p (void);
extern bool global_bindings_p (void);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern bool toplevel_bindings_p (void);
extern bool namespace_bindings_p (void);
extern bool local_bindings_p (void);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern bool template_parm_scope_p (void);
extern scope_kind innermost_scope_kind (void);
extern cp_binding_level *begin_scope (scope_kind, tree);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern void print_binding_stack (void);
extern void push_to_top_level (void);
extern void pop_from_top_level (void);
extern void pop_everything (void);
extern void keep_next_level (bool);
extern bool is_ancestor (tree, tree);
extern tree push_scope (tree);
extern void pop_scope (tree);
extern tree push_inner_scope (tree);
extern void pop_inner_scope (tree, tree);
extern void push_binding_level (cp_binding_level *);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern bool push_namespace (tree);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern void pop_namespace (void);
extern void push_nested_namespace (tree);
extern void pop_nested_namespace (tree);
extern bool handle_namespace_attrs (tree, tree);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern void pushlevel_class (void);
extern void poplevel_class (void);
extern tree pushdecl_with_scope (tree, cp_binding_level *, bool);
extern tree lookup_name_prefer_type (tree, int);
extern tree lookup_name_real (tree, int, int, bool, int, int);
extern tree lookup_type_scope (tree, tag_scope);
extern tree namespace_binding (tree, tree);
extern void set_namespace_binding (tree, tree, tree);
Friend class name lookup 5/n PR c++/1016 Friend class name lookup 5/n PR c++/1016 * cp-tree.h (pushtag): Adjust declaration. * decl.c (lookup_and_check_tag): Call lookup_type_scope if lookup_name fails. (xref_tag): Adjust call to pushtag. Make hidden class visible. (start_enum): Adjust call to pushtag. * name-lookup.c (ambiguous_decl): Ignore hidden names. (qualify_lookup): Change return type to bool. (hidden_name_p): New function. (lookup_namespace_name, unqualified_namespace_lookup, lookup_name_real): Use it. (lookup_type_scope): Update comments. (maybe_process_template_type_declaration): Change parameter name from globalize to is_friend. (pushtag): Change globalize parameter of type int to tag_scope. Hide name if introduced by friend declaration. * name-lookup.h (hidden_name_p): Add declaration. * parser.c (cp_parser_lookup_name): Don't deal with hidden name here. * pt.c (push_template_decl_real): Make hidden class template visible. (lookup_template_class, instantiate_class_template): Adjust call to pushtag. * semantics.c (begin_class_definition): Likewise. * rtti.c (init_rtti_processing, build_dynamic_cast_1, tinfo_base_init, emit_support_tinfos): Use ts_current instead of ts_global. * g++.dg/lookup/hidden-class1.C: New test. * g++.dg/lookup/hidden-class2.C: Likewise. * g++.dg/lookup/hidden-class3.C: Likewise. * g++.dg/lookup/hidden-class4.C: Likewise. * g++.dg/lookup/hidden-class5.C: Likewise. * g++.dg/lookup/hidden-class6.C: Likewise. * g++.dg/lookup/hidden-class7.C: Likewise. * g++.dg/lookup/hidden-class8.C: Likewise. * g++.dg/lookup/hidden-class9.C: Likewise. * g++.dg/lookup/hidden-temp-class1.C: Likewise. * g++.dg/lookup/hidden-temp-class2.C: Likewise. * g++.dg/lookup/hidden-temp-class3.C: Likewise. * g++.dg/lookup/hidden-temp-class4.C: Likewise. * g++.dg/lookup/hidden-temp-class5.C: Likewise. * g++.dg/lookup/hidden-temp-class6.C: Likewise. * g++.dg/lookup/hidden-temp-class7.C: Likewise. * g++.dg/lookup/hidden-temp-class8.C: Likewise. * g++.dg/lookup/hidden-temp-class9.C: Likewise. * g++.dg/lookup/hidden-temp-class10.C: Likewise. * g++.dg/lookup/hidden-temp-class11.C: Likewise. From-SVN: r96430
2005-03-14 15:33:54 +01:00
extern bool hidden_name_p (tree);
re PR c++/7874 (g++ finds friend functions defined in class-definition but not declared in the enclosing namespace) ./ PR g++/7874 * c.opt (ffriend-injection): New C++ option. * doc/invoke.texi (Option Summary): Mention -ffriend-injection. (C++ Dialect Options): Document -ffriend-injection. cp/ PR g++/7874 * cp-tree.h (struct lang_decl_flags): Add hidden_friend_p bitfield. Make dummy bitfield one bit smaller. (DECL_HIDDEN_FRIEND_P): Define. (pushdecl_maybe_friend): Declare. (pushdecl_top_level_maybe_friend): Declare. * decl.c (duplicate_decls): Add newdecl_is_friend parameter. Change prototype and all callers. Add assertion that a DECL_ARTIFICIAL FUNCTION_DECL is not DECL_HIDDEN_FRIEND_P. Set DECL_ANTICIPATED and DECL_HIDDEN_FRIEND_P in duplicated decl if appropriate. * name-lookup.c (supplement_binding): Don't ignore a DECL_HIDDEN_FRIEND_P. (pushdecl_maybe_friend): Break out contents of pushdecl. Add is_friend parameter. Set DECL_ANTICIPATED and DECL_HIDDEN_FRIEND_P for a friend function. (pushdecl): Just call pushdecl_maybe_friend. (pushdecl_with_scope): Add is_friend parameter. Change prototype and all callers. (pushdecl_namespace_level): Likewise. (push_overloaded_decl): Likewise. Check DECL_HIDDEN_FRIEND_P as well as DECL_ANTICIPATED when checking for a builtin. (do_nonmember_using_decl): Check DECL_HIDDEN_FRIEND_P as well as DECL_ANTICIPATED when checking for a builtin. (do_nonmember_using_decl): Likewise. (pushdecl_top_level_1): Add is_friend parameter. Change all callers. (pushdecl_top_level_maybe_friend): New function. (remove_hidden_names): New function. (struct arg_lookup): Add args field. (friend_of_associated_class_p): New static function. (arg_assoc_namespace): Ignore hidden functions which are not friends of an associated class of some argument. (lookup_arg_dependent): Remove hidden functions from list passed in. Initialize k.args. * name-lookup.h (remove_hidden_names): Declare. * friend.c (do_friend): Call pushdecl_maybe_friend instead of pushdecl. * call.c (add_function_candidate): Change DECL_ANTICIPATED test to an assertion, with a check for DECL_HIDDEN_FRIEND_P. (build_new_function_call): Add koenig_p parameter. Change prototype and callers. * pt.c (register_specialization): Add is_friend parameter. Change all callers. (push_template_decl_real): Change is_friend parameter to bool. Change prototype and all callers. (tsubst_friend_class): Call pushdecl_top_level_maybe_friend instead of pushdecl_top_level. testsuite/ PR g++/7874 * g++.dg/lookup/friend7.C: New test. * g++.dg/lookup/friend8.C: New test. * g++.dg/parse/defarg4.C: Add a parameter to the friend function, so that it will be found via argument dependent lookup. * g++.old-deja/g++.brendan/crash56.C: Don't expect errors for friend functions which will no longer be found. * g++.old-deja/g++.jason/friend.C: Add a parameter to the friend function g, so that it will be found via argument dependent lookup. * g++.old-deja/g++.jason/scoping15.C: Use -ffriend-injection. * g++.old-deja/g++.mike/net43.C: Likewise. From-SVN: r104188
2005-09-12 21:54:23 +02:00
extern tree remove_hidden_names (tree);
extern tree lookup_qualified_name (tree, tree, int, bool, /*hidden*/bool = false);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern tree lookup_name_nonclass (tree);
extern tree lookup_name_innermost_nonclass_level (tree);
extern bool is_local_extern (tree);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
extern tree lookup_function_nonclass (tree, vec<tree, va_gc> *, bool);
extern void push_local_binding (tree, tree, int);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern bool pushdecl_class_level (tree);
re PR c++/7874 (g++ finds friend functions defined in class-definition but not declared in the enclosing namespace) ./ PR g++/7874 * c.opt (ffriend-injection): New C++ option. * doc/invoke.texi (Option Summary): Mention -ffriend-injection. (C++ Dialect Options): Document -ffriend-injection. cp/ PR g++/7874 * cp-tree.h (struct lang_decl_flags): Add hidden_friend_p bitfield. Make dummy bitfield one bit smaller. (DECL_HIDDEN_FRIEND_P): Define. (pushdecl_maybe_friend): Declare. (pushdecl_top_level_maybe_friend): Declare. * decl.c (duplicate_decls): Add newdecl_is_friend parameter. Change prototype and all callers. Add assertion that a DECL_ARTIFICIAL FUNCTION_DECL is not DECL_HIDDEN_FRIEND_P. Set DECL_ANTICIPATED and DECL_HIDDEN_FRIEND_P in duplicated decl if appropriate. * name-lookup.c (supplement_binding): Don't ignore a DECL_HIDDEN_FRIEND_P. (pushdecl_maybe_friend): Break out contents of pushdecl. Add is_friend parameter. Set DECL_ANTICIPATED and DECL_HIDDEN_FRIEND_P for a friend function. (pushdecl): Just call pushdecl_maybe_friend. (pushdecl_with_scope): Add is_friend parameter. Change prototype and all callers. (pushdecl_namespace_level): Likewise. (push_overloaded_decl): Likewise. Check DECL_HIDDEN_FRIEND_P as well as DECL_ANTICIPATED when checking for a builtin. (do_nonmember_using_decl): Check DECL_HIDDEN_FRIEND_P as well as DECL_ANTICIPATED when checking for a builtin. (do_nonmember_using_decl): Likewise. (pushdecl_top_level_1): Add is_friend parameter. Change all callers. (pushdecl_top_level_maybe_friend): New function. (remove_hidden_names): New function. (struct arg_lookup): Add args field. (friend_of_associated_class_p): New static function. (arg_assoc_namespace): Ignore hidden functions which are not friends of an associated class of some argument. (lookup_arg_dependent): Remove hidden functions from list passed in. Initialize k.args. * name-lookup.h (remove_hidden_names): Declare. * friend.c (do_friend): Call pushdecl_maybe_friend instead of pushdecl. * call.c (add_function_candidate): Change DECL_ANTICIPATED test to an assertion, with a check for DECL_HIDDEN_FRIEND_P. (build_new_function_call): Add koenig_p parameter. Change prototype and callers. * pt.c (register_specialization): Add is_friend parameter. Change all callers. (push_template_decl_real): Change is_friend parameter to bool. Change prototype and all callers. (tsubst_friend_class): Call pushdecl_top_level_maybe_friend instead of pushdecl_top_level. testsuite/ PR g++/7874 * g++.dg/lookup/friend7.C: New test. * g++.dg/lookup/friend8.C: New test. * g++.dg/parse/defarg4.C: Add a parameter to the friend function, so that it will be found via argument dependent lookup. * g++.old-deja/g++.brendan/crash56.C: Don't expect errors for friend functions which will no longer be found. * g++.old-deja/g++.jason/friend.C: Add a parameter to the friend function g, so that it will be found via argument dependent lookup. * g++.old-deja/g++.jason/scoping15.C: Use -ffriend-injection. * g++.old-deja/g++.mike/net43.C: Likewise. From-SVN: r104188
2005-09-12 21:54:23 +02:00
extern tree pushdecl_namespace_level (tree, bool);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern bool push_class_level_binding (tree, tree);
extern tree getdecls (void);
extern int function_parm_depth (void);
Break out decl.c (2/n) Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-13 12:26:36 +02:00
extern tree cp_namespace_decls (tree);
extern void set_decl_namespace (tree, tree, bool);
extern void push_decl_namespace (tree);
extern void pop_decl_namespace (void);
extern void do_namespace_alias (tree, tree);
extern void do_toplevel_using_decl (tree, tree, tree);
extern void do_local_using_decl (tree, tree, tree);
extern tree do_class_using_decl (tree, tree);
extern void do_using_directive (tree);
C++ FE: expression ranges gcc/ChangeLog: * convert.c (convert_to_real_1): When converting from a REAL_TYPE, preserve the location of EXPR in the result. * tree.c (get_pure_location): Make non-static. (set_source_range): Return the resulting location_t. (make_location): New function. * tree.h (get_pure_location): New decl. (get_finish): New inline function. (set_source_range): Convert return type from void to location_t. (make_location): New decl. gcc/cp/ChangeLog: * cp-tree.h (class cp_expr): New class. (finish_parenthesized_expr): Convert return type and param to cp_expr. (perform_koenig_lookup): Convert return type and param from tree to cp_expr. (finish_increment_expr): Likewise. (finish_unary_op_expr): Likewise. (finish_id_expression): Likewise for return type. (build_class_member_access_expr): Likewise for param. (finish_class_member_access_expr): Likewise. (build_x_unary_op): Likewise. (build_c_cast): New decl. (build_x_modify_expr): Convert return type from tree to cp_expr. * cvt.c (cp_convert_and_check): When warning about conversions, attempt to use the location of "expr" if available, otherwise falling back to the old behavior of using input_location. * name-lookup.c (lookup_arg_dependent_1): Convert return type from tree to cp_expr. (lookup_arg_dependent): Likewise; also for local "ret". * name-lookup.h (lookup_arg_dependent): Likewise for return type. * parser.c (cp_lexer_previous_token): Skip past purged tokens. (struct cp_parser_expression_stack_entry): Convert field "lhs" to cp_expr. (cp_parser_identifier): Likewise for return type. Use cp_expr ctor to preserve the token's location. (cp_parser_string_literal): Likewise, building up a meaningful location for the case where a compound string literal is built by concatentation. (cp_parser_userdef_char_literal): Likewise for return type. (cp_parser_userdef_numeric_literal): Likewise. (cp_parser_statement_expr): Convert return type to cp_expr. Generate a suitable location for the expr and return it via the cp_expr ctor. (cp_parser_fold_expression): Convert return type to cp_expr. (cp_parser_primary_expression): Likewise, and for locals "expr", "lam", "id_expression", "decl". Use cp_expr ctor when parsing literals, to preserve the spelling location of the token. Preserve the locations of parentheses. Preserve location when calling objc_lookup_ivar. Preserve the location for "this" tokens. Generate suitable locations for "__builtin_va_arg" constructs and for Objective C 2.0 dot-syntax. Set the location for the result of finish_id_expression. (cp_parser_primary_expression): Convert return type from tree to cp_expr. (cp_parser_id_expression): Likewise. (cp_parser_unqualified_id): Likewise. Also for local "id". (cp_parser_postfix_expression): Likewise, also for local "postfix_expression". Generate suitable locations for C++-style casts, "_Cilk_spawn" constructs. Convert local "initializer" to cp_expr and use it to preserve the location of compound literals. Capture the location of the closing parenthesis of a call site via cp_parser_parenthesized_expression_list, and use it to build a source range for a call. Use cp_expr in ternary expression. (cp_parser_postfix_dot_deref_expression): Convert param from tree to cp_expr. Generate and set a location. (cp_parser_parenthesized_expression_list): Add "close_paren_loc" out-param, and write back to it. (cp_parser_unary_expression): Convert return type from tree to cp_expr. Also for locals "cast_expression" and "expression". Generate and use suitable locations for addresses of labels and for cast expressions. Call cp_expr::set_location where necessary. Preserve the locations of negated numeric literals. (cp_parser_new_expression): Generate meaningful locations/ranges. (cp_parser_cast_expression): Convert return type from tree to cp_expr; also for local "expr". Use the paren location to generate a meaningful range for the expression. (cp_parser_binary_expression): Convert return type from tree to cp_expr; also for local "rhs". Generate a meaningful location for the expression, and use it. Replace call to protected_set_expr_location by converting a build2 to a build2_loc and using the location in the call to build_x_binary_op, adding a cp_expr::set_location to the latter case. (cp_parser_question_colon_clause): Convert param from tree to cp_expr; also for local "assignment_expr". Set the spelling range of the expression. (cp_parser_assignment_expression): Likewise for return type and locals "expr" and "rhs". Build a meaningful spelling range for the expression. Remove saving of input_location in favor of a call to cp_expr::set_location. (cp_parser_expression): Convert return type and locals "expression" and "assignment_expression" to cp_expr. Build a meaningful spelling range for assignment expressions. (cp_parser_constant_expression): Likewise for return type and local "expression". (cp_parser_builtin_offsetof): Convert return type and local "expr" to cp_expr. Generate suitable locations. (cp_parser_lambda_expression): Convert return return type to cp_expr. (cp_parser_operator_function_id): Likewise. (cp_parser_operator): Likewise. Generate a meaningful range, using cp_expr's ctor to return it. (cp_parser_template_id): When converting a token to CPP_TEMPLATE_ID, update the location. (cp_parser_initializer_clause): Convert return type and local "initializer" to cp_expr. (cp_parser_braced_list): Likewise for return type. Generate suitable locations. (cp_parser_lookup_name): Likewise for return type. Use cp_expr's ctor to preserve the location_t of the name. (cp_parser_simple_cast_expression): Likewise for return type. (cp_parser_functional_cast): Convert return type and local "cast" to cp_expr. Generate suitable locations. (cp_parser_objc_expression): Convert return type to cp_expr.k Generate (cp_parser_objc_message_expression): Generate suitable locations. (cp_parser_objc_encode_expression): Convert return type to cp_expr. Generate suitable locations. (cp_parser_objc_protocol_expression): Generate suitable locations. (cp_parser_objc_selector_expression): Generate suitable locations. (cp_parser_omp_for_cond): Attempt to use the location of "cond" for the binary op. (cp_parser_transaction_expression): Issue the tm-not-enabled error at the location of the __transaction_foo token, rather than at input_location. * semantics.c (finish_parenthesized_expr): Convert return type and param to cp_expr. Preserve location. (perform_koenig_lookup): Likewise for return type and param. (finish_increment_expr): Likewise. Generate suitable locations. (finish_unary_op_expr): Likewise for return type and local "result". Generate suitable locations. (finish_id_expression): Convert return type to cp_expr and use cp_expr ctor to preserve location information. * typeck.c (build_class_member_access_expr): Convert param to cp_expr. (finish_class_member_access_expr): Likewise. (cp_build_binary_op): Convert a build2 to a build2_loc. (build_x_unary_op): Convert param from tree to cp_expr. (build_nop): Preserve the location of EXPR. (build_c_cast): Provide an overloaded variant that takes a cp_expr and returns a cp_expr. (build_x_modify_expr): Convert return type from tree to cp_expr. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nsdmi-template14.C: Move dg-error directive. * g++.dg/gomp/loop-1.C: Update dg-error locations. * g++.dg/plugin/diagnostic-test-expressions-1.C: New file, adapted from gcc.dg/plugin/diagnostic-test-expressions-1.c. * g++.dg/plugin/plugin.exp (plugin_test_list): Add the above. * g++.dg/template/crash55.C: Update dg-error directives. * g++.dg/template/pseudodtor3.C: Update column numbers in dg-error directives. * g++.dg/template/pr64100.C: Update location of dg-error directive. * g++.dg/template/ref3.C: Add XFAIL (PR c++/68699). * g++.dg/ubsan/pr63956.C: Update dg directives to reflect improved location information. * g++.dg/warn/pr35635.C (func3): Update location of a dg-warning. * g++.dg/warn/Wconversion-real-integer2.C: Update location of dg-warning; add a dg-message. * obj-c++.dg/plugin/diagnostic-test-expressions-1.mm: New file, based on objc.dg/plugin/diagnostic-test-expressions-1.m. * obj-c++.dg/plugin/plugin.exp: New file, based on objc.dg/plugin/plugin.exp. From-SVN: r231293
2015-12-04 19:09:54 +01:00
extern cp_expr lookup_arg_dependent (tree, tree, vec<tree, va_gc> *);
extern bool is_associated_namespace (tree, tree);
extern void parse_using_directive (tree, tree);
cp-tree.h (IDENTIFIER_VALUE): Remove. * cp-tree.h (IDENTIFIER_VALUE): Remove. (BINFO_PUSHDECLS_MARKED): Likewise. (maybe_inject_for_scope_var): Likewise. (push_class_decls): Likewise. * name-lookup.h (push_class_binding): Remove. (innermost_non_namespace_value): New function. (outer_binding): Likewise. * class.c (add_method): Push bindings before adding to TYPE_METHODS. (restore_class_cache): Do not restore class_shadowed. (pushclass): Do not add USING_DECLs. Do not call push_class_decls. * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c. * decl.c (pushdecl): Use outer_binding. (poplevel): Set the scope for an out-of-scope for-loop declaration appropriately. (cp_finish_decl): Don't call maybe_inject_for_scope_var. * name-lookup.c (new_class_binding): New function. (push_binding): Use it. (pushdecl): Use innermost_non_namespace_value. (maybe_inject_for_scope_var): Remove. (push_class_binding): Remove. (set_inherited_value_binding_p): New function. (get_class_binding): New function. (push_class_level_binding): Assert that the current_class_type is being defined. (outer_binding): New function. (innermost_non_namespace_value): Likewise. (lookup_name_real): Use outer_binding. (lookup_name_current_level): Ignore out-of-scope variables. * pt.c (check_template_shadow): Use innermost_non_namespace_value. (lookup_template_class): Likewise. * search.c (dfs_push_type_decls): Remove. (dfs_push_decls): Likewise. (setup_class_bindings): Likewise. (lookup_field_1): Handle USING_DECLs from dependent scopes. (marked_pushdecls_p): Remove. (unmarked_pushdecls_p): Remove. (marked_identifiers): Remove. (setup_class_bindings): Remove. (dfs_push_type_decls): Remove. (dfs_push_decls): Remove. (push_class_decls): Remove. From-SVN: r84689
2004-07-14 17:34:30 +02:00
extern tree innermost_non_namespace_value (tree);
extern cxx_binding *outer_binding (tree, cxx_binding *, bool);
extern void cp_emit_debug_info_for_using (tree, tree);
/* Set *DECL to the (non-hidden) declaration for ID at global scope,
if present and return true; otherwise return false. */
inline bool
get_global_value_if_present (tree id, tree *decl)
{
tree global_value = namespace_binding (id, global_namespace);
if (global_value)
*decl = global_value;
return global_value != NULL;
}
/* True is the binding of IDENTIFIER at global scope names a type. */
inline bool
is_typename_at_global_scope (tree id)
{
tree global_value = namespace_binding (id, global_namespace);
return global_value && TREE_CODE (global_value) == TYPE_DECL;
}
#endif /* GCC_CP_NAME_LOOKUP_H */