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
This commit is contained in:
parent
0f41191580
commit
9771b26396
498
gcc/ChangeLog
498
gcc/ChangeLog
|
@ -1,3 +1,501 @@
|
|||
2012-11-17 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.
|
||||
|
||||
2012-11-17 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/55236
|
||||
|
|
|
@ -835,9 +835,9 @@ REVISION_s := "\"\""
|
|||
endif
|
||||
|
||||
# Shorthand variables for dependency lists.
|
||||
VEC_H = vec.h statistics.h
|
||||
VEC_H = vec.h statistics.h $(GGC_H)
|
||||
HASH_TABLE_H = $(HASHTAB_H) hash-table.h
|
||||
EXCEPT_H = except.h $(HASHTAB_H) vecprim.h vecir.h
|
||||
EXCEPT_H = except.h $(HASHTAB_H)
|
||||
TARGET_DEF = target.def target-hooks-macros.h
|
||||
C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h
|
||||
COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h
|
||||
|
@ -857,7 +857,7 @@ RTL_BASE_H = coretypes.h rtl.h rtl.def $(MACHMODE_H) reg-notes.def \
|
|||
insn-notes.def $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) \
|
||||
$(FIXED_VALUE_H) alias.h $(HASHTAB_H)
|
||||
FIXED_VALUE_H = fixed-value.h $(MACHMODE_H) double-int.h
|
||||
RTL_H = $(RTL_BASE_H) $(FLAGS_H) genrtl.h vecir.h
|
||||
RTL_H = $(RTL_BASE_H) $(FLAGS_H) genrtl.h
|
||||
RTL_ERROR_H = rtl-error.h $(RTL_H) $(DIAGNOSTIC_CORE_H)
|
||||
READ_MD_H = $(OBSTACK_H) $(HASHTAB_H) read-md.h
|
||||
PARAMS_H = params.h params.def
|
||||
|
@ -868,13 +868,13 @@ INTERNAL_FN_H = internal-fn.h $(INTERNAL_FN_DEF)
|
|||
TREE_H = coretypes.h tree.h all-tree.def tree.def c-family/c-common.def \
|
||||
$(lang_tree_files) $(MACHMODE_H) tree-check.h $(BUILTINS_DEF) \
|
||||
$(INPUT_H) statistics.h $(VEC_H) treestruct.def $(HASHTAB_H) \
|
||||
double-int.h alias.h $(SYMTAB_H) $(FLAGS_H) vecir.h \
|
||||
double-int.h alias.h $(SYMTAB_H) $(FLAGS_H) \
|
||||
$(REAL_H) $(FIXED_VALUE_H)
|
||||
REGSET_H = regset.h $(BITMAP_H) hard-reg-set.h
|
||||
BASIC_BLOCK_H = basic-block.h $(PREDICT_H) $(VEC_H) $(FUNCTION_H) \
|
||||
cfg-flags.def cfghooks.h
|
||||
GIMPLE_H = gimple.h gimple.def gsstruct.def pointer-set.h $(VEC_H) \
|
||||
vecir.h $(GGC_H) $(BASIC_BLOCK_H) $(TREE_H) tree-ssa-operands.h \
|
||||
$(GGC_H) $(BASIC_BLOCK_H) $(TREE_H) tree-ssa-operands.h \
|
||||
tree-ssa-alias.h $(INTERNAL_FN_H)
|
||||
TRANS_MEM_H = trans-mem.h
|
||||
GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h
|
||||
|
@ -885,17 +885,17 @@ ALIAS_H = alias.h
|
|||
EMIT_RTL_H = emit-rtl.h
|
||||
FLAGS_H = flags.h flag-types.h $(OPTIONS_H)
|
||||
OPTIONS_H = options.h flag-types.h $(OPTIONS_H_EXTRA)
|
||||
FUNCTION_H = function.h $(HASHTAB_H) vecprim.h $(TM_H) hard-reg-set.h \
|
||||
$(VEC_H) vecir.h $(INPUT_H) $(MACHMODE_H)
|
||||
FUNCTION_H = function.h $(HASHTAB_H) $(TM_H) hard-reg-set.h \
|
||||
$(VEC_H) $(INPUT_H) $(MACHMODE_H)
|
||||
EXPR_H = expr.h insn-config.h $(FUNCTION_H) $(RTL_H) $(FLAGS_H) $(TREE_H) $(MACHMODE_H) $(EMIT_RTL_H)
|
||||
OPTABS_H = optabs.h insn-codes.h insn-opinit.h
|
||||
REGS_H = regs.h $(MACHMODE_H) hard-reg-set.h
|
||||
SCHED_INT_H = sched-int.h $(INSN_ATTR_H) $(BASIC_BLOCK_H) $(RTL_H) $(DF_H) \
|
||||
vecprim.h $(REGSET_H)
|
||||
$(REGSET_H)
|
||||
SEL_SCHED_IR_H = sel-sched-ir.h $(INSN_ATTR_H) $(BASIC_BLOCK_H) $(RTL_H) \
|
||||
$(GGC_H) $(BITMAP_H) vecprim.h $(SCHED_INT_H) $(CFGLOOP_H) $(REGSET_H)
|
||||
$(GGC_H) $(BITMAP_H) $(SCHED_INT_H) $(CFGLOOP_H) $(REGSET_H)
|
||||
SEL_SCHED_DUMP_H = sel-sched-dump.h $(SEL_SCHED_IR_H)
|
||||
CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) vecprim.h double-int.h \
|
||||
CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) double-int.h \
|
||||
$(BITMAP_H) sbitmap.h
|
||||
IPA_UTILS_H = ipa-utils.h $(TREE_H) $(CGRAPH_H)
|
||||
IPA_REFERENCE_H = ipa-reference.h $(BITMAP_H) $(TREE_H)
|
||||
|
@ -912,7 +912,7 @@ GGC_H = ggc.h gtype-desc.h statistics.h
|
|||
GGC_INTERNAL_H = ggc-internal.h $(GGC_H)
|
||||
TIMEVAR_H = timevar.h timevar.def
|
||||
INSN_ATTR_H = insn-attr.h insn-attr-common.h $(INSN_ADDR_H)
|
||||
INSN_ADDR_H = $(srcdir)/insn-addr.h vecprim.h
|
||||
INSN_ADDR_H = $(srcdir)/insn-addr.h
|
||||
C_COMMON_H = c-family/c-common.h c-family/c-common.def $(TREE_H) \
|
||||
$(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H) $(DIAGNOSTIC_CORE_H)
|
||||
C_PRAGMA_H = c-family/c-pragma.h $(CPPLIB_H)
|
||||
|
@ -938,7 +938,7 @@ TREE_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \
|
|||
$(BITMAP_H) sbitmap.h $(BASIC_BLOCK_H) $(GIMPLE_H) \
|
||||
$(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H) \
|
||||
tree-ssa-alias.h
|
||||
TREE_SSA_LIVE_H = tree-ssa-live.h $(PARTITION_H) vecprim.h
|
||||
TREE_SSA_LIVE_H = tree-ssa-live.h $(PARTITION_H)
|
||||
SSAEXPAND_H = ssaexpand.h $(TREE_SSA_LIVE_H)
|
||||
PRETTY_PRINT_H = pretty-print.h $(INPUT_H) $(OBSTACK_H)
|
||||
TREE_PRETTY_PRINT_H = tree-pretty-print.h $(PRETTY_PRINT_H)
|
||||
|
@ -951,13 +951,13 @@ C_PRETTY_PRINT_H = c-family/c-pretty-print.h $(PRETTY_PRINT_H) \
|
|||
SCEV_H = tree-scalar-evolution.h $(GGC_H) tree-chrec.h $(PARAMS_H)
|
||||
OMEGA_H = omega.h $(PARAMS_H)
|
||||
TREE_DATA_REF_H = tree-data-ref.h $(OMEGA_H) graphds.h $(SCEV_H)
|
||||
TREE_INLINE_H = tree-inline.h vecir.h
|
||||
TREE_INLINE_H = tree-inline.h
|
||||
REAL_H = real.h $(MACHMODE_H)
|
||||
IRA_INT_H = ira.h ira-int.h $(CFGLOOP_H) alloc-pool.h
|
||||
LRA_INT_H = lra.h $(BITMAP_H) $(RECOG_H) $(INSN_ATTR_H) insn-codes.h lra-int.h
|
||||
DBGCNT_H = dbgcnt.h dbgcnt.def
|
||||
LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \
|
||||
$(CGRAPH_H) $(VEC_H) vecprim.h $(TREE_H) $(GIMPLE_H) \
|
||||
$(CGRAPH_H) $(VEC_H) $(TREE_H) $(GIMPLE_H) \
|
||||
$(GCOV_IO_H) $(DIAGNOSTIC_H) alloc-pool.h
|
||||
DATA_STREAMER_H = data-streamer.h $(VEC_H) $(LTO_STREAMER_H)
|
||||
GIMPLE_STREAMER_H = gimple-streamer.h $(LTO_STREAMER_H) $(BASIC_BLOCK_H) \
|
||||
|
@ -2258,8 +2258,7 @@ tree-into-ssa.o : tree-into-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
|
|||
$(FUNCTION_H) $(TM_H) coretypes.h \
|
||||
langhooks.h domwalk.h $(TREE_PASS_H) $(PARAMS_H) $(BASIC_BLOCK_H) \
|
||||
$(BITMAP_H) $(CFGLOOP_H) $(FLAGS_H) $(HASHTAB_H) \
|
||||
$(GIMPLE_H) $(TREE_INLINE_H) vecprim.h \
|
||||
$(GIMPLE_PRETTY_PRINT_H)
|
||||
$(GIMPLE_H) $(TREE_INLINE_H) $(GIMPLE_PRETTY_PRINT_H)
|
||||
tree-ssa-ter.o : tree-ssa-ter.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
|
||||
$(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h dumpfile.h \
|
||||
$(TREE_SSA_LIVE_H) $(BITMAP_H) $(FLAGS_H) \
|
||||
|
@ -2488,7 +2487,7 @@ tree-ssa-alias.o : tree-ssa-alias.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
|
|||
langhooks.h \
|
||||
$(PARAMS_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
|
||||
$(GIMPLE_H) $(VEC_H) $(TARGET_H) \
|
||||
vecprim.h pointer-set.h alloc-pool.h \
|
||||
pointer-set.h alloc-pool.h \
|
||||
$(TREE_PRETTY_PRINT_H)
|
||||
tree-ssa-reassoc.o : tree-ssa-reassoc.c $(TREE_FLOW_H) $(CONFIG_H) \
|
||||
$(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) \
|
||||
|
@ -2740,7 +2739,7 @@ function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_
|
|||
$(OPTABS_H) $(LIBFUNCS_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
|
||||
output.h $(EXCEPT_H) $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \
|
||||
gt-function.h $(TARGET_H) $(BASIC_BLOCK_H) $(PREDICT_H) \
|
||||
$(TREE_PASS_H) $(DF_H) vecprim.h $(PARAMS_H) bb-reorder.h \
|
||||
$(TREE_PASS_H) $(DF_H) $(PARAMS_H) bb-reorder.h \
|
||||
$(COMMON_TARGET_H)
|
||||
statistics.o : statistics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||
$(TREE_PASS_H) $(TREE_DUMP_H) $(HASHTAB_H) statistics.h $(FUNCTION_H)
|
||||
|
@ -2763,12 +2762,12 @@ expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
|
|||
typeclass.h hard-reg-set.h toplev.h $(DIAGNOSTIC_CORE_H) hard-reg-set.h $(EXCEPT_H) \
|
||||
reload.h langhooks.h intl.h $(TM_P_H) $(TARGET_H) \
|
||||
tree-iterator.h gt-expr.h $(MACHMODE_H) $(TIMEVAR_H) $(TREE_FLOW_H) \
|
||||
$(TREE_PASS_H) $(DF_H) $(DIAGNOSTIC_H) vecprim.h $(SSAEXPAND_H) \
|
||||
$(TREE_PASS_H) $(DF_H) $(DIAGNOSTIC_H) $(SSAEXPAND_H) \
|
||||
$(PARAMS_H) $(COMMON_TARGET_H) target-globals.h
|
||||
dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TM_P_H) \
|
||||
$(RTL_H) $(TREE_H) \
|
||||
$(FLAGS_H) $(FUNCTION_H) $(EXPR_H) $(OPTABS_H) $(INSN_ATTR_H) insn-config.h \
|
||||
langhooks.h $(GGC_H) gt-dojump.h vecprim.h $(BASIC_BLOCK_H)
|
||||
langhooks.h $(GGC_H) gt-dojump.h $(BASIC_BLOCK_H)
|
||||
builtins.o : builtins.c builtins.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
|
||||
$(RTL_H) $(TREE_H) $(GIMPLE_H) $(FLAGS_H) $(TARGET_H) $(FUNCTION_H) $(REGS_H) \
|
||||
$(EXPR_H) $(OPTABS_H) insn-config.h $(RECOG_H) output.h typeclass.h \
|
||||
|
@ -2826,7 +2825,7 @@ xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
|
|||
godump.o : godump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) \
|
||||
$(TREE_H) $(GGC_H) pointer-set.h $(OBSTACK_H) debug.h gt-godump.h
|
||||
emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
|
||||
$(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) insn-config.h $(RECOG_H) vecprim.h \
|
||||
$(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) insn-config.h $(RECOG_H) \
|
||||
$(GGC_H) $(EXPR_H) hard-reg-set.h $(BITMAP_H) $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) \
|
||||
$(HASHTAB_H) $(TM_P_H) debug.h langhooks.h $(TREE_PASS_H) gt-emit-rtl.h \
|
||||
$(DF_H) $(PARAMS_H) $(TARGET_H)
|
||||
|
@ -3045,7 +3044,7 @@ df-core.o : df-core.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
|
|||
df-problems.o : df-problems.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h $(TM_H) \
|
||||
$(RTL_H) insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \
|
||||
hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) $(BITMAP_H) sbitmap.h $(TIMEVAR_H) \
|
||||
$(TM_P_H) $(TARGET_H) $(FLAGS_H) $(EXCEPT_H) dce.h vecprim.h $(VALTRACK_H)
|
||||
$(TM_P_H) $(TARGET_H) $(FLAGS_H) $(EXCEPT_H) dce.h $(VALTRACK_H)
|
||||
df-scan.o : df-scan.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h $(TM_H) $(RTL_H) \
|
||||
insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \
|
||||
hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) $(BITMAP_H) sbitmap.h \
|
||||
|
@ -3105,7 +3104,7 @@ cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
|
|||
$(CFGLOOP_H) $(OBSTACK_H) $(TARGET_H) $(TREE_H) \
|
||||
$(TREE_PASS_H) $(DF_H) $(GGC_H) $(COMMON_TARGET_H) gt-cfgrtl.h
|
||||
cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(BASIC_BLOCK_H) \
|
||||
$(TIMEVAR_H) vecprim.h sbitmap.h $(BITMAP_H)
|
||||
$(TIMEVAR_H) sbitmap.h $(BITMAP_H)
|
||||
cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
|
||||
$(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h $(DIAGNOSTIC_CORE_H) \
|
||||
$(FUNCTION_H) $(EXCEPT_H) $(TIMEVAR_H) $(TREE_H) $(EXPR_H) sbitmap.h
|
||||
|
@ -3122,7 +3121,7 @@ cfgloopanal.o : cfgloopanal.c coretypes.h dumpfile.h $(CONFIG_H) $(SYSTEM_H) $(R
|
|||
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) $(TM_H) \
|
||||
$(OBSTACK_H) graphds.h $(PARAMS_H)
|
||||
graphds.o : graphds.c graphds.h $(CONFIG_H) $(SYSTEM_H) $(BITMAP_H) $(OBSTACK_H) \
|
||||
coretypes.h $(VEC_H) vecprim.h
|
||||
coretypes.h $(VEC_H)
|
||||
loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h \
|
||||
$(RTL_H) $(BASIC_BLOCK_H) \
|
||||
hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) $(TM_H) $(OBSTACK_H) \
|
||||
|
@ -3147,7 +3146,7 @@ loop-unroll.o: loop-unroll.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h \
|
|||
$(OBSTACK_H)
|
||||
dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
|
||||
hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h $(OBSTACK_H) $(DIAGNOSTIC_CORE_H) \
|
||||
$(TIMEVAR_H) graphds.h vecprim.h pointer-set.h $(BITMAP_H)
|
||||
$(TIMEVAR_H) graphds.h pointer-set.h $(BITMAP_H)
|
||||
et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||
et-forest.h alloc-pool.h $(BASIC_BLOCK_H)
|
||||
combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
|
||||
|
@ -3156,7 +3155,7 @@ combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
|
|||
$(DIAGNOSTIC_CORE_H) $(TM_P_H) $(TREE_H) $(TARGET_H) \
|
||||
output.h $(PARAMS_H) $(OPTABS_H) \
|
||||
insn-codes.h $(TREE_PASS_H) $(DF_H) $(VALTRACK_H) \
|
||||
vecprim.h $(CGRAPH_H) $(OBSTACK_H)
|
||||
$(CGRAPH_H) $(OBSTACK_H)
|
||||
reginfo.o : reginfo.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
|
||||
hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) addresses.h $(REGS_H) \
|
||||
insn-config.h $(RECOG_H) reload.h $(DIAGNOSTIC_CORE_H) \
|
||||
|
@ -3198,7 +3197,7 @@ caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h \
|
|||
bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(EXCEPT_H) \
|
||||
$(RTL_H) hard-reg-set.h $(REGS_H) $(TM_P_H) $(FIBHEAP_H) $(EXPR_H) \
|
||||
$(TARGET_H) $(FLAGS_H) $(INSN_ATTR_H) $(FUNCTION_H) $(TREE_PASS_H) \
|
||||
$(DIAGNOSTIC_CORE_H) $(DF_H) vecprim.h $(RECOG_H) $(CFGLOOP_H)
|
||||
$(DIAGNOSTIC_CORE_H) $(DF_H) $(RECOG_H) $(CFGLOOP_H)
|
||||
reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
|
||||
conditions.h hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \
|
||||
$(INSN_ATTR_H) $(EXCEPT_H) $(RECOG_H) $(FUNCTION_H) $(FLAGS_H) output.h \
|
||||
|
@ -3350,7 +3349,7 @@ final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
|
|||
$(EXCEPT_H) debug.h xcoffout.h toplev.h $(DIAGNOSTIC_CORE_H) reload.h $(DWARF2OUT_H) \
|
||||
$(TREE_PASS_H) $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H) \
|
||||
dbxout.h $(CGRAPH_H) $(COVERAGE_H) \
|
||||
$(DF_H) vecprim.h $(GGC_H) $(CFGLOOP_H) $(PARAMS_H) $(TREE_FLOW_H) \
|
||||
$(DF_H) $(GGC_H) $(CFGLOOP_H) $(PARAMS_H) $(TREE_FLOW_H) \
|
||||
$(TARGET_DEF_H) $(TREE_PRETTY_PRINT_H)
|
||||
recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
|
||||
$(FUNCTION_H) $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) \
|
||||
|
@ -3361,7 +3360,7 @@ reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
|
|||
$(RTL_ERROR_H) $(TREE_H) $(RECOG_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
|
||||
insn-config.h reload.h $(FUNCTION_H) $(TM_P_H) $(GGC_H) \
|
||||
$(BASIC_BLOCK_H) \
|
||||
$(TREE_PASS_H) $(TARGET_H) vecprim.h $(DF_H) $(EMIT_RTL_H)
|
||||
$(TREE_PASS_H) $(TARGET_H) $(DF_H) $(EMIT_RTL_H)
|
||||
sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h sreal.h
|
||||
predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
|
||||
$(TREE_H) $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) \
|
||||
|
@ -3689,7 +3688,6 @@ s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in
|
|||
fi
|
||||
|
||||
GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
|
||||
$(srcdir)/vecprim.h $(srcdir)/vecir.h \
|
||||
$(host_xm_file_list) \
|
||||
$(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
|
||||
$(srcdir)/alias.h $(srcdir)/coverage.c $(srcdir)/rtl.h \
|
||||
|
@ -3851,7 +3849,7 @@ build/genattr-common.o : genattr-common.c $(RTL_BASE_H) $(BCONFIG_H) \
|
|||
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
|
||||
build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \
|
||||
$(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) \
|
||||
$(READ_MD_H) gensupport.h vecprim.h $(FNMATCH_H)
|
||||
$(READ_MD_H) gensupport.h $(FNMATCH_H)
|
||||
build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \
|
||||
$(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(VEC_H) \
|
||||
$(HASHTAB_H) gensupport.h $(FNMATCH_H)
|
||||
|
@ -3873,8 +3871,7 @@ build/genemit.o : genemit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
|
|||
build/genenums.o : genenums.c $(BCONFIG_H) $(SYSTEM_H) \
|
||||
coretypes.h errors.h $(READ_MD_H)
|
||||
build/genextract.o : genextract.c $(RTL_BASE_H) $(BCONFIG_H) \
|
||||
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h \
|
||||
vecprim.h
|
||||
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
|
||||
build/genflags.o : genflags.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \
|
||||
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
|
||||
build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
2012-11-16 Diego Novillo <dnovillo@google.com>
|
||||
|
||||
Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
|
||||
|
||||
* gcc-interface/decl.c: Use new vec API in vec.h.
|
||||
* gcc-interface/gigi.h: Likewise.
|
||||
* gcc-interface/trans.c: Likewise.
|
||||
* gcc-interface/utils.c: Likewise.
|
||||
* gcc-interface/utils2.c: Likewise.
|
||||
|
||||
2012-11-09 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
PR other/52438
|
||||
|
|
|
@ -106,8 +106,6 @@ typedef struct subst_pair_d {
|
|||
tree replacement;
|
||||
} subst_pair;
|
||||
|
||||
DEF_VEC_O(subst_pair);
|
||||
DEF_VEC_ALLOC_O(subst_pair,heap);
|
||||
|
||||
typedef struct variant_desc_d {
|
||||
/* The type of the variant. */
|
||||
|
@ -123,8 +121,6 @@ typedef struct variant_desc_d {
|
|||
tree new_type;
|
||||
} variant_desc;
|
||||
|
||||
DEF_VEC_O(variant_desc);
|
||||
DEF_VEC_ALLOC_O(variant_desc,heap);
|
||||
|
||||
/* A hash table used to cache the result of annotate_value. */
|
||||
static GTY ((if_marked ("tree_int_map_marked_p"),
|
||||
|
@ -153,21 +149,21 @@ static void components_to_record (tree, Node_Id, tree, int, bool, bool, bool,
|
|||
static Uint annotate_value (tree);
|
||||
static void annotate_rep (Entity_Id, tree);
|
||||
static tree build_position_list (tree, bool, tree, tree, unsigned int, tree);
|
||||
static VEC(subst_pair,heap) *build_subst_list (Entity_Id, Entity_Id, bool);
|
||||
static VEC(variant_desc,heap) *build_variant_list (tree,
|
||||
VEC(subst_pair,heap) *,
|
||||
VEC(variant_desc,heap) *);
|
||||
static vec<subst_pair> build_subst_list (Entity_Id, Entity_Id, bool);
|
||||
static vec<variant_desc> build_variant_list (tree,
|
||||
vec<subst_pair> ,
|
||||
vec<variant_desc> );
|
||||
static tree validate_size (Uint, tree, Entity_Id, enum tree_code, bool, bool);
|
||||
static void set_rm_size (Uint, tree, Entity_Id);
|
||||
static unsigned int validate_alignment (Uint, Entity_Id, unsigned int);
|
||||
static void check_ok_for_atomic (tree, Entity_Id, bool);
|
||||
static tree create_field_decl_from (tree, tree, tree, tree, tree,
|
||||
VEC(subst_pair,heap) *);
|
||||
vec<subst_pair> );
|
||||
static tree create_rep_part (tree, tree, tree);
|
||||
static tree get_rep_part (tree);
|
||||
static tree create_variant_part_from (tree, VEC(variant_desc,heap) *, tree,
|
||||
tree, VEC(subst_pair,heap) *);
|
||||
static void copy_and_substitute_in_size (tree, tree, VEC(subst_pair,heap) *);
|
||||
static tree create_variant_part_from (tree, vec<variant_desc> , tree,
|
||||
tree, vec<subst_pair> );
|
||||
static void copy_and_substitute_in_size (tree, tree, vec<subst_pair> );
|
||||
|
||||
/* The relevant constituents of a subprogram binding to a GCC builtin. Used
|
||||
to pass around calls performing profile compatibility checks. */
|
||||
|
@ -1157,7 +1153,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
|||
= TYPE_PADDING_P (gnu_type)
|
||||
? TYPE_FIELDS (TREE_TYPE (TYPE_FIELDS (gnu_type)))
|
||||
: TYPE_FIELDS (gnu_type);
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 1);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, 1);
|
||||
tree t = build_template (TREE_TYPE (template_field),
|
||||
TREE_TYPE (DECL_CHAIN (template_field)),
|
||||
NULL_TREE);
|
||||
|
@ -1329,8 +1326,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
|||
= TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_alloc_type)));
|
||||
|
||||
if (TREE_CODE (gnu_expr) == CONSTRUCTOR
|
||||
&& 1 == VEC_length (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (gnu_expr)))
|
||||
&& 1 == vec_safe_length (CONSTRUCTOR_ELTS (gnu_expr)))
|
||||
gnu_expr = 0;
|
||||
else
|
||||
gnu_expr
|
||||
|
@ -3293,13 +3289,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
|||
&& Present (Discriminant_Constraint (gnat_entity))
|
||||
&& Stored_Constraint (gnat_entity) != No_Elist)
|
||||
{
|
||||
VEC(subst_pair,heap) *gnu_subst_list
|
||||
vec<subst_pair> gnu_subst_list
|
||||
= build_subst_list (gnat_entity, gnat_base_type, definition);
|
||||
tree gnu_unpad_base_type, gnu_rep_part, gnu_variant_part, t;
|
||||
tree gnu_pos_list, gnu_field_list = NULL_TREE;
|
||||
bool selected_variant = false;
|
||||
Entity_Id gnat_field;
|
||||
VEC(variant_desc,heap) *gnu_variant_list;
|
||||
vec<variant_desc> gnu_variant_list;
|
||||
|
||||
gnu_type = make_node (RECORD_TYPE);
|
||||
TYPE_NAME (gnu_type) = gnu_entity_name;
|
||||
|
@ -3330,12 +3326,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
|||
|
||||
gnu_variant_list
|
||||
= build_variant_list (TREE_TYPE (gnu_variant_part),
|
||||
gnu_subst_list, NULL);
|
||||
gnu_subst_list,
|
||||
vec<variant_desc>());
|
||||
|
||||
/* If all the qualifiers are unconditionally true, the
|
||||
innermost variant is statically selected. */
|
||||
selected_variant = true;
|
||||
FOR_EACH_VEC_ELT (variant_desc, gnu_variant_list, i, v)
|
||||
FOR_EACH_VEC_ELT (gnu_variant_list, i, v)
|
||||
if (!integer_onep (v->qual))
|
||||
{
|
||||
selected_variant = false;
|
||||
|
@ -3344,7 +3341,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
|||
|
||||
/* Otherwise, create the new variants. */
|
||||
if (!selected_variant)
|
||||
FOR_EACH_VEC_ELT (variant_desc, gnu_variant_list, i, v)
|
||||
FOR_EACH_VEC_ELT (gnu_variant_list, i, v)
|
||||
{
|
||||
tree old_variant = v->type;
|
||||
tree new_variant = make_node (RECORD_TYPE);
|
||||
|
@ -3362,13 +3359,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
|||
}
|
||||
else
|
||||
{
|
||||
gnu_variant_list = NULL;
|
||||
gnu_variant_list.create (0);
|
||||
selected_variant = false;
|
||||
}
|
||||
|
||||
gnu_pos_list
|
||||
= build_position_list (gnu_unpad_base_type,
|
||||
gnu_variant_list && !selected_variant,
|
||||
gnu_variant_list.exists ()
|
||||
&& !selected_variant,
|
||||
size_zero_node, bitsize_zero_node,
|
||||
BIGGEST_ALIGNMENT, NULL_TREE);
|
||||
|
||||
|
@ -3449,7 +3447,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
|||
unsigned int i;
|
||||
|
||||
t = NULL_TREE;
|
||||
FOR_EACH_VEC_ELT (variant_desc, gnu_variant_list, i, v)
|
||||
FOR_EACH_VEC_ELT (gnu_variant_list, i, v)
|
||||
if (gnu_context == v->type
|
||||
|| ((gnu_rep_part = get_rep_part (v->type))
|
||||
&& gnu_context == TREE_TYPE (gnu_rep_part)))
|
||||
|
@ -3515,7 +3513,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
|||
|
||||
/* If there is a variant list and no selected variant, we need
|
||||
to create the nest of variant parts from the old nest. */
|
||||
if (gnu_variant_list && !selected_variant)
|
||||
if (gnu_variant_list.exists () && !selected_variant)
|
||||
{
|
||||
tree new_variant_part
|
||||
= create_variant_part_from (gnu_variant_part,
|
||||
|
@ -3587,8 +3585,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
|||
gnat_entity);
|
||||
}
|
||||
|
||||
VEC_free (variant_desc, heap, gnu_variant_list);
|
||||
VEC_free (subst_pair, heap, gnu_subst_list);
|
||||
gnu_variant_list.release ();
|
||||
gnu_subst_list.release ();
|
||||
|
||||
/* Now we can finalize it. */
|
||||
rest_of_record_type_compilation (gnu_type);
|
||||
|
@ -7551,10 +7549,10 @@ build_position_list (tree gnu_type, bool do_not_flatten_variant, tree gnu_pos,
|
|||
of operands to SUBSTITUTE_IN_EXPR. DEFINITION is true if this is for
|
||||
a definition of GNAT_SUBTYPE. */
|
||||
|
||||
static VEC(subst_pair,heap) *
|
||||
static vec<subst_pair>
|
||||
build_subst_list (Entity_Id gnat_subtype, Entity_Id gnat_type, bool definition)
|
||||
{
|
||||
VEC(subst_pair,heap) *gnu_list = NULL;
|
||||
vec<subst_pair> gnu_list = vec<subst_pair>();
|
||||
Entity_Id gnat_discrim;
|
||||
Node_Id gnat_value;
|
||||
|
||||
|
@ -7573,7 +7571,7 @@ build_subst_list (Entity_Id gnat_subtype, Entity_Id gnat_type, bool definition)
|
|||
get_entity_name (gnat_discrim),
|
||||
definition, true, false));
|
||||
subst_pair s = {gnu_field, replacement};
|
||||
VEC_safe_push (subst_pair, heap, gnu_list, s);
|
||||
gnu_list.safe_push (s);
|
||||
}
|
||||
|
||||
return gnu_list;
|
||||
|
@ -7584,9 +7582,9 @@ build_subst_list (Entity_Id gnat_subtype, Entity_Id gnat_type, bool definition)
|
|||
the substitutions described in SUBST_LIST. GNU_LIST is a pre-existing
|
||||
list to be prepended to the newly created entries. */
|
||||
|
||||
static VEC(variant_desc,heap) *
|
||||
build_variant_list (tree qual_union_type, VEC(subst_pair,heap) *subst_list,
|
||||
VEC(variant_desc,heap) *gnu_list)
|
||||
static vec<variant_desc>
|
||||
build_variant_list (tree qual_union_type, vec<subst_pair> subst_list,
|
||||
vec<variant_desc> gnu_list)
|
||||
{
|
||||
tree gnu_field;
|
||||
|
||||
|
@ -7598,7 +7596,7 @@ build_variant_list (tree qual_union_type, VEC(subst_pair,heap) *subst_list,
|
|||
unsigned int i;
|
||||
subst_pair *s;
|
||||
|
||||
FOR_EACH_VEC_ELT (subst_pair, subst_list, i, s)
|
||||
FOR_EACH_VEC_ELT (subst_list, i, s)
|
||||
qual = SUBSTITUTE_IN_EXPR (qual, s->discriminant, s->replacement);
|
||||
|
||||
/* If the new qualifier is not unconditionally false, its variant may
|
||||
|
@ -7608,7 +7606,7 @@ build_variant_list (tree qual_union_type, VEC(subst_pair,heap) *subst_list,
|
|||
tree variant_type = TREE_TYPE (gnu_field), variant_subpart;
|
||||
variant_desc v = {variant_type, gnu_field, qual, NULL_TREE};
|
||||
|
||||
VEC_safe_push (variant_desc, heap, gnu_list, v);
|
||||
gnu_list.safe_push (v);
|
||||
|
||||
/* Recurse on the variant subpart of the variant, if any. */
|
||||
variant_subpart = get_variant_part (variant_type);
|
||||
|
@ -8170,7 +8168,7 @@ intrin_profiles_compatible_p (intrin_binding_t * inb)
|
|||
static tree
|
||||
create_field_decl_from (tree old_field, tree field_type, tree record_type,
|
||||
tree size, tree pos_list,
|
||||
VEC(subst_pair,heap) *subst_list)
|
||||
vec<subst_pair> subst_list)
|
||||
{
|
||||
tree t = TREE_VALUE (purpose_member (old_field, pos_list));
|
||||
tree pos = TREE_VEC_ELT (t, 0), bitpos = TREE_VEC_ELT (t, 2);
|
||||
|
@ -8180,7 +8178,7 @@ create_field_decl_from (tree old_field, tree field_type, tree record_type,
|
|||
subst_pair *s;
|
||||
|
||||
if (CONTAINS_PLACEHOLDER_P (pos))
|
||||
FOR_EACH_VEC_ELT (subst_pair, subst_list, i, s)
|
||||
FOR_EACH_VEC_ELT (subst_list, i, s)
|
||||
pos = SUBSTITUTE_IN_EXPR (pos, s->discriminant, s->replacement);
|
||||
|
||||
/* If the position is now a constant, we can set it as the position of the
|
||||
|
@ -8276,9 +8274,9 @@ get_variant_part (tree record_type)
|
|||
|
||||
static tree
|
||||
create_variant_part_from (tree old_variant_part,
|
||||
VEC(variant_desc,heap) *variant_list,
|
||||
vec<variant_desc> variant_list,
|
||||
tree record_type, tree pos_list,
|
||||
VEC(subst_pair,heap) *subst_list)
|
||||
vec<subst_pair> subst_list)
|
||||
{
|
||||
tree offset = DECL_FIELD_OFFSET (old_variant_part);
|
||||
tree old_union_type = TREE_TYPE (old_variant_part);
|
||||
|
@ -8315,7 +8313,7 @@ create_variant_part_from (tree old_variant_part,
|
|||
copy_and_substitute_in_size (new_union_type, old_union_type, subst_list);
|
||||
|
||||
/* Now finish up the new variants and populate the union type. */
|
||||
FOR_EACH_VEC_ELT_REVERSE (variant_desc, variant_list, i, v)
|
||||
FOR_EACH_VEC_ELT_REVERSE (variant_list, i, v)
|
||||
{
|
||||
tree old_field = v->field, new_field;
|
||||
tree old_variant, old_variant_subpart, new_variant, field_list;
|
||||
|
@ -8397,7 +8395,7 @@ create_variant_part_from (tree old_variant_part,
|
|||
|
||||
static void
|
||||
copy_and_substitute_in_size (tree new_type, tree old_type,
|
||||
VEC(subst_pair,heap) *subst_list)
|
||||
vec<subst_pair> subst_list)
|
||||
{
|
||||
unsigned int i;
|
||||
subst_pair *s;
|
||||
|
@ -8409,19 +8407,19 @@ copy_and_substitute_in_size (tree new_type, tree old_type,
|
|||
relate_alias_sets (new_type, old_type, ALIAS_SET_COPY);
|
||||
|
||||
if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (new_type)))
|
||||
FOR_EACH_VEC_ELT (subst_pair, subst_list, i, s)
|
||||
FOR_EACH_VEC_ELT (subst_list, i, s)
|
||||
TYPE_SIZE (new_type)
|
||||
= SUBSTITUTE_IN_EXPR (TYPE_SIZE (new_type),
|
||||
s->discriminant, s->replacement);
|
||||
|
||||
if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE_UNIT (new_type)))
|
||||
FOR_EACH_VEC_ELT (subst_pair, subst_list, i, s)
|
||||
FOR_EACH_VEC_ELT (subst_list, i, s)
|
||||
TYPE_SIZE_UNIT (new_type)
|
||||
= SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (new_type),
|
||||
s->discriminant, s->replacement);
|
||||
|
||||
if (CONTAINS_PLACEHOLDER_P (TYPE_ADA_SIZE (new_type)))
|
||||
FOR_EACH_VEC_ELT (subst_pair, subst_list, i, s)
|
||||
FOR_EACH_VEC_ELT (subst_list, i, s)
|
||||
SET_TYPE_ADA_SIZE
|
||||
(new_type, SUBSTITUTE_IN_EXPR (TYPE_ADA_SIZE (new_type),
|
||||
s->discriminant, s->replacement));
|
||||
|
|
|
@ -884,7 +884,7 @@ extern tree build_call_raise_column (int msg, Node_Id gnat_node);
|
|||
|
||||
/* Return a CONSTRUCTOR of TYPE whose elements are V. This is not the
|
||||
same as build_constructor in the language-independent tree.c. */
|
||||
extern tree gnat_build_constructor (tree type, VEC(constructor_elt,gc) *v);
|
||||
extern tree gnat_build_constructor (tree type, vec<constructor_elt, va_gc> *v);
|
||||
|
||||
/* Return a COMPONENT_REF to access a field that is given by COMPONENT,
|
||||
an IDENTIFIER_NODE giving the name of the field, FIELD, a FIELD_DECL,
|
||||
|
|
|
@ -110,11 +110,9 @@ bool type_annotate_only;
|
|||
/* Current filename without path. */
|
||||
const char *ref_filename;
|
||||
|
||||
DEF_VEC_I(Node_Id);
|
||||
DEF_VEC_ALLOC_I(Node_Id,heap);
|
||||
|
||||
/* List of N_Validate_Unchecked_Conversion nodes in the unit. */
|
||||
static VEC(Node_Id,heap) *gnat_validate_uc_list;
|
||||
static vec<Node_Id> gnat_validate_uc_list;
|
||||
|
||||
/* When not optimizing, we cache the 'First, 'Last and 'Length attributes
|
||||
of unconstrained array IN parameters to avoid emitting a great deal of
|
||||
|
@ -129,13 +127,11 @@ struct GTY (()) parm_attr_d {
|
|||
|
||||
typedef struct parm_attr_d *parm_attr;
|
||||
|
||||
DEF_VEC_P(parm_attr);
|
||||
DEF_VEC_ALLOC_P(parm_attr,gc);
|
||||
|
||||
struct GTY(()) language_function {
|
||||
VEC(parm_attr,gc) *parm_attr_cache;
|
||||
vec<parm_attr, va_gc> *parm_attr_cache;
|
||||
bitmap named_ret_val;
|
||||
VEC(tree,gc) *other_ret_val;
|
||||
vec<tree, va_gc> *other_ret_val;
|
||||
int gnat_ret;
|
||||
};
|
||||
|
||||
|
@ -184,21 +180,21 @@ static GTY(()) struct elab_info *elab_info_list;
|
|||
/* Stack of exception pointer variables. Each entry is the VAR_DECL
|
||||
that stores the address of the raised exception. Nonzero means we
|
||||
are in an exception handler. Not used in the zero-cost case. */
|
||||
static GTY(()) VEC(tree,gc) *gnu_except_ptr_stack;
|
||||
static GTY(()) vec<tree, va_gc> *gnu_except_ptr_stack;
|
||||
|
||||
/* In ZCX case, current exception pointer. Used to re-raise it. */
|
||||
static GTY(()) tree gnu_incoming_exc_ptr;
|
||||
|
||||
/* Stack for storing the current elaboration procedure decl. */
|
||||
static GTY(()) VEC(tree,gc) *gnu_elab_proc_stack;
|
||||
static GTY(()) vec<tree, va_gc> *gnu_elab_proc_stack;
|
||||
|
||||
/* Stack of labels to be used as a goto target instead of a return in
|
||||
some functions. See processing for N_Subprogram_Body. */
|
||||
static GTY(()) VEC(tree,gc) *gnu_return_label_stack;
|
||||
static GTY(()) vec<tree, va_gc> *gnu_return_label_stack;
|
||||
|
||||
/* Stack of variable for the return value of a function with copy-in/copy-out
|
||||
parameters. See processing for N_Subprogram_Body. */
|
||||
static GTY(()) VEC(tree,gc) *gnu_return_var_stack;
|
||||
static GTY(()) vec<tree, va_gc> *gnu_return_var_stack;
|
||||
|
||||
/* Structure used to record information for a range check. */
|
||||
struct GTY(()) range_check_info_d {
|
||||
|
@ -210,28 +206,24 @@ struct GTY(()) range_check_info_d {
|
|||
|
||||
typedef struct range_check_info_d *range_check_info;
|
||||
|
||||
DEF_VEC_P(range_check_info);
|
||||
DEF_VEC_ALLOC_P(range_check_info,gc);
|
||||
|
||||
/* Structure used to record information for a loop. */
|
||||
struct GTY(()) loop_info_d {
|
||||
tree label;
|
||||
tree loop_var;
|
||||
VEC(range_check_info,gc) *checks;
|
||||
vec<range_check_info, va_gc> *checks;
|
||||
};
|
||||
|
||||
typedef struct loop_info_d *loop_info;
|
||||
|
||||
DEF_VEC_P(loop_info);
|
||||
DEF_VEC_ALLOC_P(loop_info,gc);
|
||||
|
||||
/* Stack of loop_info structures associated with LOOP_STMT nodes. */
|
||||
static GTY(()) VEC(loop_info,gc) *gnu_loop_stack;
|
||||
static GTY(()) vec<loop_info, va_gc> *gnu_loop_stack;
|
||||
|
||||
/* The stacks for N_{Push,Pop}_*_Label. */
|
||||
static GTY(()) VEC(tree,gc) *gnu_constraint_error_label_stack;
|
||||
static GTY(()) VEC(tree,gc) *gnu_storage_error_label_stack;
|
||||
static GTY(()) VEC(tree,gc) *gnu_program_error_label_stack;
|
||||
static GTY(()) vec<tree, va_gc> *gnu_constraint_error_label_stack;
|
||||
static GTY(()) vec<tree, va_gc> *gnu_storage_error_label_stack;
|
||||
static GTY(()) vec<tree, va_gc> *gnu_program_error_label_stack;
|
||||
|
||||
/* Map GNAT tree codes to GCC tree codes for simple expressions. */
|
||||
static enum tree_code gnu_codes[Number_Node_Kinds];
|
||||
|
@ -242,7 +234,7 @@ static void record_code_position (Node_Id);
|
|||
static void insert_code_for (Node_Id);
|
||||
static void add_cleanup (tree, Node_Id);
|
||||
static void add_stmt_list (List_Id);
|
||||
static void push_exception_label_stack (VEC(tree,gc) **, Entity_Id);
|
||||
static void push_exception_label_stack (vec<tree, va_gc> **, Entity_Id);
|
||||
static tree build_stmt_group (List_Id, bool);
|
||||
static inline bool stmt_group_may_fallthru (void);
|
||||
static enum gimplify_status gnat_gimplify_stmt (tree *);
|
||||
|
@ -588,14 +580,12 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED,
|
|||
tree null_node = fold_convert (ptr_void_ftype, null_pointer_node);
|
||||
tree field_list = NULL_TREE;
|
||||
int j;
|
||||
VEC(constructor_elt,gc) *null_vec = NULL;
|
||||
vec<constructor_elt, va_gc> *null_vec = NULL;
|
||||
constructor_elt *elt;
|
||||
|
||||
fdesc_type_node = make_node (RECORD_TYPE);
|
||||
VEC_safe_grow (constructor_elt, gc, null_vec,
|
||||
TARGET_VTABLE_USES_DESCRIPTORS);
|
||||
elt = (VEC_address (constructor_elt,null_vec)
|
||||
+ TARGET_VTABLE_USES_DESCRIPTORS - 1);
|
||||
vec_safe_grow (null_vec, TARGET_VTABLE_USES_DESCRIPTORS);
|
||||
elt = (null_vec->address () + TARGET_VTABLE_USES_DESCRIPTORS - 1);
|
||||
|
||||
for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; j++)
|
||||
{
|
||||
|
@ -651,10 +641,10 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED,
|
|||
user available facilities for Intrinsic imports. */
|
||||
gnat_install_builtins ();
|
||||
|
||||
VEC_safe_push (tree, gc, gnu_except_ptr_stack, NULL_TREE);
|
||||
VEC_safe_push (tree, gc, gnu_constraint_error_label_stack, NULL_TREE);
|
||||
VEC_safe_push (tree, gc, gnu_storage_error_label_stack, NULL_TREE);
|
||||
VEC_safe_push (tree, gc, gnu_program_error_label_stack, NULL_TREE);
|
||||
vec_safe_push (gnu_except_ptr_stack, NULL_TREE);
|
||||
vec_safe_push (gnu_constraint_error_label_stack, NULL_TREE);
|
||||
vec_safe_push (gnu_storage_error_label_stack, NULL_TREE);
|
||||
vec_safe_push (gnu_program_error_label_stack, NULL_TREE);
|
||||
|
||||
/* Process any Pragma Ident for the main unit. */
|
||||
if (Present (Ident_String (Main_Unit)))
|
||||
|
@ -671,9 +661,9 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED,
|
|||
/* Then process the N_Validate_Unchecked_Conversion nodes. We do this at
|
||||
the very end to avoid having to second-guess the front-end when we run
|
||||
into dummy nodes during the regular processing. */
|
||||
for (i = 0; VEC_iterate (Node_Id, gnat_validate_uc_list, i, gnat_iter); i++)
|
||||
for (i = 0; gnat_validate_uc_list.iterate (i, &gnat_iter); i++)
|
||||
validate_unchecked_conversion (gnat_iter);
|
||||
VEC_free (Node_Id, heap, gnat_validate_uc_list);
|
||||
gnat_validate_uc_list.release ();
|
||||
|
||||
/* Finally see if we have any elaboration procedures to deal with. */
|
||||
for (info = elab_info_list; info; info = info->next)
|
||||
|
@ -1367,7 +1357,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
|
|||
/* Descriptors can only be built here for top-level functions. */
|
||||
bool build_descriptor = (global_bindings_p () != 0);
|
||||
int i;
|
||||
VEC(constructor_elt,gc) *gnu_vec = NULL;
|
||||
vec<constructor_elt, va_gc> *gnu_vec = NULL;
|
||||
constructor_elt *elt;
|
||||
|
||||
gnu_result_type = get_unpadded_type (Etype (gnat_node));
|
||||
|
@ -1383,10 +1373,8 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
|
|||
gnu_result = build1 (INDIRECT_REF, gnu_result_type, gnu_result);
|
||||
}
|
||||
|
||||
VEC_safe_grow (constructor_elt, gc, gnu_vec,
|
||||
TARGET_VTABLE_USES_DESCRIPTORS);
|
||||
elt = (VEC_address (constructor_elt, gnu_vec)
|
||||
+ TARGET_VTABLE_USES_DESCRIPTORS - 1);
|
||||
vec_safe_grow (gnu_vec, TARGET_VTABLE_USES_DESCRIPTORS);
|
||||
elt = (gnu_vec->address () + TARGET_VTABLE_USES_DESCRIPTORS - 1);
|
||||
for (gnu_field = TYPE_FIELDS (gnu_result_type), i = 0;
|
||||
i < TARGET_VTABLE_USES_DESCRIPTORS;
|
||||
gnu_field = DECL_CHAIN (gnu_field), i++)
|
||||
|
@ -1739,7 +1727,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
|
|||
and the dimension in the cache and create a new one on failure. */
|
||||
if (!optimize && Present (gnat_param))
|
||||
{
|
||||
FOR_EACH_VEC_ELT (parm_attr, f_parm_attr_cache, i, pa)
|
||||
FOR_EACH_VEC_SAFE_ELT (f_parm_attr_cache, i, pa)
|
||||
if (pa->id == gnat_param && pa->dim == Dimension)
|
||||
break;
|
||||
|
||||
|
@ -1748,7 +1736,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
|
|||
pa = ggc_alloc_cleared_parm_attr_d ();
|
||||
pa->id = gnat_param;
|
||||
pa->dim = Dimension;
|
||||
VEC_safe_push (parm_attr, gc, f_parm_attr_cache, pa);
|
||||
vec_safe_push (f_parm_attr_cache, pa);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2210,7 +2198,7 @@ push_range_check_info (tree var)
|
|||
struct loop_info_d *iter = NULL;
|
||||
unsigned int i;
|
||||
|
||||
if (VEC_empty (loop_info, gnu_loop_stack))
|
||||
if (vec_safe_is_empty (gnu_loop_stack))
|
||||
return NULL;
|
||||
|
||||
var = remove_conversions (var, false);
|
||||
|
@ -2221,8 +2209,8 @@ push_range_check_info (tree var)
|
|||
if (decl_function_context (var) != current_function_decl)
|
||||
return NULL;
|
||||
|
||||
for (i = VEC_length (loop_info, gnu_loop_stack) - 1;
|
||||
VEC_iterate (loop_info, gnu_loop_stack, i, iter);
|
||||
for (i = vec_safe_length (gnu_loop_stack) - 1;
|
||||
vec_safe_iterate (gnu_loop_stack, i, &iter);
|
||||
i--)
|
||||
if (var == iter->loop_var)
|
||||
break;
|
||||
|
@ -2230,7 +2218,7 @@ push_range_check_info (tree var)
|
|||
if (iter)
|
||||
{
|
||||
struct range_check_info_d *rci = ggc_alloc_range_check_info_d ();
|
||||
VEC_safe_push (range_check_info, gc, iter->checks, rci);
|
||||
vec_safe_push (iter->checks, rci);
|
||||
return rci;
|
||||
}
|
||||
|
||||
|
@ -2312,7 +2300,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
|
|||
tree gnu_result;
|
||||
|
||||
/* Push the loop_info structure associated with the LOOP_STMT. */
|
||||
VEC_safe_push (loop_info, gc, gnu_loop_stack, gnu_loop_info);
|
||||
vec_safe_push (gnu_loop_stack, gnu_loop_info);
|
||||
|
||||
/* Set location information for statement and end label. */
|
||||
set_expr_location_from_node (gnu_loop_stmt, gnat_node);
|
||||
|
@ -2576,7 +2564,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
|
|||
if (Present (gnat_iter_scheme) && No (Condition (gnat_iter_scheme)))
|
||||
{
|
||||
struct range_check_info_d *rci;
|
||||
unsigned n_checks = VEC_length (range_check_info, gnu_loop_info->checks);
|
||||
unsigned n_checks = vec_safe_length (gnu_loop_info->checks);
|
||||
unsigned int i;
|
||||
|
||||
/* First, if we have computed a small number of invariant conditions for
|
||||
|
@ -2593,7 +2581,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
|
|||
that can be entirely optimized away in the end. */
|
||||
if (1 <= n_checks && n_checks <= 4)
|
||||
for (i = 0;
|
||||
VEC_iterate (range_check_info, gnu_loop_info->checks, i, rci);
|
||||
vec_safe_iterate (gnu_loop_info->checks, i, &rci);
|
||||
i++)
|
||||
{
|
||||
tree low_ok
|
||||
|
@ -2636,7 +2624,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
|
|||
else
|
||||
gnu_result = gnu_loop_stmt;
|
||||
|
||||
VEC_pop (loop_info, gnu_loop_stack);
|
||||
gnu_loop_stack->pop ();
|
||||
|
||||
return gnu_result;
|
||||
}
|
||||
|
@ -2928,10 +2916,8 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
|
|||
{
|
||||
if (TYPE_IS_FAT_POINTER_P (TREE_TYPE (ret_val)))
|
||||
ret_val
|
||||
= VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS
|
||||
(TREE_OPERAND (TREE_OPERAND (ret_val, 0), 1)),
|
||||
1).value;
|
||||
= (*CONSTRUCTOR_ELTS (TREE_OPERAND (TREE_OPERAND (ret_val, 0),
|
||||
1)))[1].value;
|
||||
else
|
||||
ret_val = TREE_OPERAND (TREE_OPERAND (ret_val, 0), 1);
|
||||
}
|
||||
|
@ -2960,7 +2946,8 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
|
|||
tree saved_current_function_decl = current_function_decl;
|
||||
tree var = DECL_EXPR_DECL (t);
|
||||
tree alloc, p_array, new_var, new_ret;
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, 2);
|
||||
|
||||
/* Create an artificial context to build the allocation. */
|
||||
current_function_decl = decl_function_context (var);
|
||||
|
@ -2988,19 +2975,15 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
|
|||
DECL_INITIAL (new_var)
|
||||
= build2 (COMPOUND_EXPR, TREE_TYPE (new_var),
|
||||
TREE_OPERAND (alloc, 0),
|
||||
VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (TREE_OPERAND (alloc, 1)),
|
||||
0).value);
|
||||
(*CONSTRUCTOR_ELTS (TREE_OPERAND (alloc, 1)))[0].value);
|
||||
|
||||
/* Build a modified CONSTRUCTOR that references NEW_VAR. */
|
||||
p_array = TYPE_FIELDS (TREE_TYPE (alloc));
|
||||
CONSTRUCTOR_APPEND_ELT (v, p_array,
|
||||
fold_convert (TREE_TYPE (p_array), new_var));
|
||||
CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (p_array),
|
||||
VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS
|
||||
(TREE_OPERAND (alloc, 1)),
|
||||
1).value);
|
||||
(*CONSTRUCTOR_ELTS (
|
||||
TREE_OPERAND (alloc, 1)))[1].value);
|
||||
new_ret = build_constructor (TREE_TYPE (alloc), v);
|
||||
}
|
||||
else
|
||||
|
@ -3048,7 +3031,7 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
|
|||
the other return values. GNAT_RET is a representative return node. */
|
||||
|
||||
static void
|
||||
finalize_nrv (tree fndecl, bitmap nrv, VEC(tree,gc) *other, Node_Id gnat_ret)
|
||||
finalize_nrv (tree fndecl, bitmap nrv, vec<tree, va_gc> *other, Node_Id gnat_ret)
|
||||
{
|
||||
struct cgraph_node *node;
|
||||
struct nrv_data data;
|
||||
|
@ -3064,7 +3047,7 @@ finalize_nrv (tree fndecl, bitmap nrv, VEC(tree,gc) *other, Node_Id gnat_ret)
|
|||
data.nrv = nrv;
|
||||
data.result = NULL_TREE;
|
||||
data.visited = NULL;
|
||||
for (i = 0; VEC_iterate(tree, other, i, iter); i++)
|
||||
for (i = 0; vec_safe_iterate (other, i, &iter); i++)
|
||||
walk_tree_without_duplicates (&iter, prune_nrv_r, &data);
|
||||
if (bitmap_empty_p (nrv))
|
||||
return;
|
||||
|
@ -3186,7 +3169,7 @@ build_return_expr (tree ret_obj, tree ret_val)
|
|||
totally transparent given the read-compose-write semantics of
|
||||
assignments from CONSTRUCTORs. */
|
||||
else if (EXPR_P (ret_val))
|
||||
VEC_safe_push (tree, gc, f_other_ret_val, ret_val);
|
||||
vec_safe_push (f_other_ret_val, ret_val);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3204,7 +3187,7 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog)
|
|||
tree gnu_subprog_type, gnu_subprog_addr, gnu_subprog_call;
|
||||
tree gnu_subprog_param, gnu_stub_param, gnu_param;
|
||||
tree gnu_stub_decl = DECL_FUNCTION_STUB (gnu_subprog);
|
||||
VEC(tree,gc) *gnu_param_vec = NULL;
|
||||
vec<tree, va_gc> *gnu_param_vec = NULL;
|
||||
|
||||
gnu_subprog_type = TREE_TYPE (gnu_subprog);
|
||||
|
||||
|
@ -3238,7 +3221,7 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog)
|
|||
else
|
||||
gnu_param = gnu_stub_param;
|
||||
|
||||
VEC_safe_push (tree, gc, gnu_param_vec, gnu_param);
|
||||
vec_safe_push (gnu_param_vec, gnu_param);
|
||||
}
|
||||
|
||||
/* Invoke the internal subprogram. */
|
||||
|
@ -3286,7 +3269,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
|
|||
tree gnu_return_var_elmt = NULL_TREE;
|
||||
tree gnu_result;
|
||||
struct language_function *gnu_subprog_language;
|
||||
VEC(parm_attr,gc) *cache;
|
||||
vec<parm_attr, va_gc> *cache;
|
||||
|
||||
/* If this is a generic object or if it has been eliminated,
|
||||
ignore it. */
|
||||
|
@ -3340,7 +3323,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
|
|||
{
|
||||
tree gnu_return_var = NULL_TREE;
|
||||
|
||||
VEC_safe_push (tree, gc, gnu_return_label_stack,
|
||||
vec_safe_push (gnu_return_label_stack,
|
||||
create_artificial_label (input_location));
|
||||
|
||||
start_stmt_group ();
|
||||
|
@ -3366,7 +3349,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
|
|||
TREE_VALUE (gnu_return_var_elmt) = gnu_return_var;
|
||||
}
|
||||
|
||||
VEC_safe_push (tree, gc, gnu_return_var_stack, gnu_return_var);
|
||||
vec_safe_push (gnu_return_var_stack, gnu_return_var);
|
||||
|
||||
/* See whether there are parameters for which we don't have a GCC tree
|
||||
yet. These must be Out parameters. Make a VAR_DECL for them and
|
||||
|
@ -3392,7 +3375,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
|
|||
}
|
||||
}
|
||||
else
|
||||
VEC_safe_push (tree, gc, gnu_return_label_stack, NULL_TREE);
|
||||
vec_safe_push (gnu_return_label_stack, NULL_TREE);
|
||||
|
||||
/* Get a tree corresponding to the code for the subprogram. */
|
||||
start_stmt_group ();
|
||||
|
@ -3433,7 +3416,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
|
|||
|
||||
start_stmt_group ();
|
||||
|
||||
FOR_EACH_VEC_ELT (parm_attr, cache, i, pa)
|
||||
FOR_EACH_VEC_ELT (*cache, i, pa)
|
||||
{
|
||||
if (pa->first)
|
||||
add_stmt_with_node_force (pa->first, gnat_node);
|
||||
|
@ -3467,7 +3450,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
|
|||
|
||||
add_stmt (gnu_result);
|
||||
add_stmt (build1 (LABEL_EXPR, void_type_node,
|
||||
VEC_last (tree, gnu_return_label_stack)));
|
||||
gnu_return_label_stack->last ()));
|
||||
|
||||
if (list_length (gnu_cico_list) == 1)
|
||||
gnu_retval = TREE_VALUE (gnu_cico_list);
|
||||
|
@ -3481,7 +3464,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
|
|||
gnu_result = end_stmt_group ();
|
||||
}
|
||||
|
||||
VEC_pop (tree, gnu_return_label_stack);
|
||||
gnu_return_label_stack->pop ();
|
||||
|
||||
/* Attempt setting the end_locus of our GCC body tree, typically a
|
||||
BIND_EXPR or STATEMENT_LIST, then the end_locus of our GCC subprogram
|
||||
|
@ -3639,7 +3622,7 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
|
|||
/* The return type of the FUNCTION_TYPE. */
|
||||
tree gnu_result_type = TREE_TYPE (gnu_subprog_type);
|
||||
tree gnu_subprog_addr = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_subprog);
|
||||
VEC(tree,gc) *gnu_actual_vec = NULL;
|
||||
vec<tree, va_gc> *gnu_actual_vec = NULL;
|
||||
tree gnu_name_list = NULL_TREE;
|
||||
tree gnu_stmt_list = NULL_TREE;
|
||||
tree gnu_after_list = NULL_TREE;
|
||||
|
@ -4042,7 +4025,7 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
|
|||
gnu_actual = convert (DECL_ARG_TYPE (gnu_formal), gnu_actual);
|
||||
}
|
||||
|
||||
VEC_safe_push (tree, gc, gnu_actual_vec, gnu_actual);
|
||||
vec_safe_push (gnu_actual_vec, gnu_actual);
|
||||
}
|
||||
|
||||
gnu_call
|
||||
|
@ -4402,7 +4385,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
|
|||
start_stmt_group ();
|
||||
gnat_pushlevel ();
|
||||
|
||||
VEC_safe_push (tree, gc, gnu_except_ptr_stack,
|
||||
vec_safe_push (gnu_except_ptr_stack,
|
||||
create_var_decl (get_identifier ("EXCEPT_PTR"), NULL_TREE,
|
||||
build_pointer_type (except_type_node),
|
||||
build_call_n_expr (get_excptr_decl, 0),
|
||||
|
@ -4431,7 +4414,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
|
|||
/* If none of the exception handlers did anything, re-raise but do not
|
||||
defer abortion. */
|
||||
gnu_expr = build_call_n_expr (raise_nodefer_decl, 1,
|
||||
VEC_last (tree, gnu_except_ptr_stack));
|
||||
gnu_except_ptr_stack->last ());
|
||||
set_expr_location_from_node
|
||||
(gnu_expr,
|
||||
Present (End_Label (gnat_node)) ? End_Label (gnat_node) : gnat_node);
|
||||
|
@ -4443,7 +4426,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
|
|||
|
||||
/* End the binding level dedicated to the exception handlers and get the
|
||||
whole statement group. */
|
||||
VEC_pop (tree, gnu_except_ptr_stack);
|
||||
gnu_except_ptr_stack->pop ();
|
||||
gnat_poplevel ();
|
||||
gnu_handler = end_stmt_group ();
|
||||
|
||||
|
@ -4536,7 +4519,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node)
|
|||
build_component_ref
|
||||
(build_unary_op
|
||||
(INDIRECT_REF, NULL_TREE,
|
||||
VEC_last (tree, gnu_except_ptr_stack)),
|
||||
gnu_except_ptr_stack->last ()),
|
||||
get_identifier ("not_handled_by_others"), NULL_TREE,
|
||||
false)),
|
||||
integer_zero_node);
|
||||
|
@ -4558,8 +4541,8 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node)
|
|||
this_choice
|
||||
= build_binary_op
|
||||
(EQ_EXPR, boolean_type_node,
|
||||
VEC_last (tree, gnu_except_ptr_stack),
|
||||
convert (TREE_TYPE (VEC_last (tree, gnu_except_ptr_stack)),
|
||||
gnu_except_ptr_stack->last (),
|
||||
convert (TREE_TYPE (gnu_except_ptr_stack->last ()),
|
||||
build_unary_op (ADDR_EXPR, NULL_TREE, gnu_expr)));
|
||||
|
||||
/* If this is the distinguished exception "Non_Ada_Error" (and we are
|
||||
|
@ -4570,7 +4553,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node)
|
|||
tree gnu_comp
|
||||
= build_component_ref
|
||||
(build_unary_op (INDIRECT_REF, NULL_TREE,
|
||||
VEC_last (tree, gnu_except_ptr_stack)),
|
||||
gnu_except_ptr_stack->last ()),
|
||||
get_identifier ("lang"), NULL_TREE, false);
|
||||
|
||||
this_choice
|
||||
|
@ -4711,7 +4694,7 @@ Compilation_Unit_to_gnu (Node_Id gnat_node)
|
|||
gnat_unit);
|
||||
struct elab_info *info;
|
||||
|
||||
VEC_safe_push (tree, gc, gnu_elab_proc_stack, gnu_elab_proc_decl);
|
||||
vec_safe_push (gnu_elab_proc_stack, gnu_elab_proc_decl);
|
||||
DECL_ELABORATION_PROC_P (gnu_elab_proc_decl) = 1;
|
||||
|
||||
/* Initialize the information structure for the function. */
|
||||
|
@ -4792,7 +4775,7 @@ Compilation_Unit_to_gnu (Node_Id gnat_node)
|
|||
|
||||
/* Generate elaboration code for this unit, if necessary, and say whether
|
||||
we did or not. */
|
||||
VEC_pop (tree, gnu_elab_proc_stack);
|
||||
gnu_elab_proc_stack->pop ();
|
||||
|
||||
/* Invalidate the global renaming pointers. This is necessary because
|
||||
stabilization of the renamed entities may create SAVE_EXPRs which
|
||||
|
@ -5235,8 +5218,8 @@ gnat_to_gnu (Node_Id gnat_node)
|
|||
int length = String_Length (gnat_string);
|
||||
int i;
|
||||
tree gnu_idx = TYPE_MIN_VALUE (TYPE_DOMAIN (gnu_result_type));
|
||||
VEC(constructor_elt,gc) *gnu_vec
|
||||
= VEC_alloc (constructor_elt, gc, length);
|
||||
vec<constructor_elt, va_gc> *gnu_vec;
|
||||
vec_alloc (gnu_vec, length);
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
|
@ -5658,7 +5641,8 @@ gnat_to_gnu (Node_Id gnat_node)
|
|||
gnu_aggr_type = TYPE_REPRESENTATIVE_ARRAY (gnu_result_type);
|
||||
|
||||
if (Null_Record_Present (gnat_node))
|
||||
gnu_result = gnat_build_constructor (gnu_aggr_type, NULL);
|
||||
gnu_result = gnat_build_constructor (gnu_aggr_type,
|
||||
NULL);
|
||||
|
||||
else if (TREE_CODE (gnu_aggr_type) == RECORD_TYPE
|
||||
|| TREE_CODE (gnu_aggr_type) == UNION_TYPE)
|
||||
|
@ -6231,7 +6215,7 @@ gnat_to_gnu (Node_Id gnat_node)
|
|||
? gnat_to_gnu (Condition (gnat_node)) : NULL_TREE),
|
||||
(Present (Name (gnat_node))
|
||||
? get_gnu_tree (Entity (Name (gnat_node)))
|
||||
: VEC_last (loop_info, gnu_loop_stack)->label));
|
||||
: gnu_loop_stack->last ()->label));
|
||||
break;
|
||||
|
||||
case N_Simple_Return_Statement:
|
||||
|
@ -6246,7 +6230,7 @@ gnat_to_gnu (Node_Id gnat_node)
|
|||
/* If this function has copy-in/copy-out parameters, get the real
|
||||
object for the return. See Subprogram_to_gnu. */
|
||||
if (TYPE_CI_CO_LIST (gnu_subprog_type))
|
||||
gnu_ret_obj = VEC_last (tree, gnu_return_var_stack);
|
||||
gnu_ret_obj = gnu_return_var_stack->last ();
|
||||
else
|
||||
gnu_ret_obj = DECL_RESULT (current_function_decl);
|
||||
|
||||
|
@ -6331,18 +6315,18 @@ gnat_to_gnu (Node_Id gnat_node)
|
|||
|
||||
/* If we have a return label defined, convert this into a branch to
|
||||
that label. The return proper will be handled elsewhere. */
|
||||
if (VEC_last (tree, gnu_return_label_stack))
|
||||
if (gnu_return_label_stack->last ())
|
||||
{
|
||||
if (gnu_ret_obj)
|
||||
add_stmt (build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_ret_obj,
|
||||
gnu_ret_val));
|
||||
|
||||
gnu_result = build1 (GOTO_EXPR, void_type_node,
|
||||
VEC_last (tree, gnu_return_label_stack));
|
||||
gnu_return_label_stack->last ());
|
||||
|
||||
/* When not optimizing, make sure the return is preserved. */
|
||||
if (!optimize && Comes_From_Source (gnat_node))
|
||||
DECL_ARTIFICIAL (VEC_last (tree, gnu_return_label_stack)) = 0;
|
||||
DECL_ARTIFICIAL (gnu_return_label_stack->last ()) = 0;
|
||||
}
|
||||
|
||||
/* Otherwise, build a regular return. */
|
||||
|
@ -6569,15 +6553,15 @@ gnat_to_gnu (Node_Id gnat_node)
|
|||
break;
|
||||
|
||||
case N_Pop_Constraint_Error_Label:
|
||||
VEC_pop (tree, gnu_constraint_error_label_stack);
|
||||
gnu_constraint_error_label_stack->pop ();
|
||||
break;
|
||||
|
||||
case N_Pop_Storage_Error_Label:
|
||||
VEC_pop (tree, gnu_storage_error_label_stack);
|
||||
gnu_storage_error_label_stack->pop ();
|
||||
break;
|
||||
|
||||
case N_Pop_Program_Error_Label:
|
||||
VEC_pop (tree, gnu_program_error_label_stack);
|
||||
gnu_program_error_label_stack->pop ();
|
||||
break;
|
||||
|
||||
/******************************/
|
||||
|
@ -6857,7 +6841,7 @@ gnat_to_gnu (Node_Id gnat_node)
|
|||
/* The only validation we currently do on an unchecked conversion is
|
||||
that of aliasing assumptions. */
|
||||
if (flag_strict_aliasing)
|
||||
VEC_safe_push (Node_Id, heap, gnat_validate_uc_list, gnat_node);
|
||||
gnat_validate_uc_list.safe_push (gnat_node);
|
||||
gnu_result = alloc_stmt_list ();
|
||||
break;
|
||||
|
||||
|
@ -7032,13 +7016,13 @@ gnat_to_gnu (Node_Id gnat_node)
|
|||
label to push onto the stack. */
|
||||
|
||||
static void
|
||||
push_exception_label_stack (VEC(tree,gc) **gnu_stack, Entity_Id gnat_label)
|
||||
push_exception_label_stack (vec<tree, va_gc> **gnu_stack, Entity_Id gnat_label)
|
||||
{
|
||||
tree gnu_label = (Present (gnat_label)
|
||||
? gnat_to_gnu_entity (gnat_label, NULL_TREE, 0)
|
||||
: NULL_TREE);
|
||||
|
||||
VEC_safe_push (tree, gc, *gnu_stack, gnu_label);
|
||||
vec_safe_push (*gnu_stack, gnu_label);
|
||||
}
|
||||
|
||||
/* Record the current code position in GNAT_NODE. */
|
||||
|
@ -8678,7 +8662,7 @@ pos_to_constructor (Node_Id gnat_expr, tree gnu_array_type,
|
|||
{
|
||||
tree gnu_index = TYPE_MIN_VALUE (TYPE_DOMAIN (gnu_array_type));
|
||||
tree gnu_expr;
|
||||
VEC(constructor_elt,gc) *gnu_expr_vec = NULL;
|
||||
vec<constructor_elt, va_gc> *gnu_expr_vec = NULL;
|
||||
|
||||
for ( ; Present (gnat_expr); gnat_expr = Next (gnat_expr))
|
||||
{
|
||||
|
@ -8719,7 +8703,7 @@ static tree
|
|||
extract_values (tree values, tree record_type)
|
||||
{
|
||||
tree field, tem;
|
||||
VEC(constructor_elt,gc) *v = NULL;
|
||||
vec<constructor_elt, va_gc> *v = NULL;
|
||||
|
||||
for (field = TYPE_FIELDS (record_type); field; field = DECL_CHAIN (field))
|
||||
{
|
||||
|
@ -8737,7 +8721,7 @@ extract_values (tree values, tree record_type)
|
|||
{
|
||||
value = extract_values (values, TREE_TYPE (field));
|
||||
if (TREE_CODE (value) == CONSTRUCTOR
|
||||
&& VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (value)))
|
||||
&& vec_safe_is_empty (CONSTRUCTOR_ELTS (value)))
|
||||
value = 0;
|
||||
}
|
||||
else
|
||||
|
@ -9126,11 +9110,11 @@ tree
|
|||
get_exception_label (char kind)
|
||||
{
|
||||
if (kind == N_Raise_Constraint_Error)
|
||||
return VEC_last (tree, gnu_constraint_error_label_stack);
|
||||
return gnu_constraint_error_label_stack->last ();
|
||||
else if (kind == N_Raise_Storage_Error)
|
||||
return VEC_last (tree, gnu_storage_error_label_stack);
|
||||
return gnu_storage_error_label_stack->last ();
|
||||
else if (kind == N_Raise_Program_Error)
|
||||
return VEC_last (tree, gnu_program_error_label_stack);
|
||||
return gnu_program_error_label_stack->last ();
|
||||
else
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
@ -9140,7 +9124,7 @@ get_exception_label (char kind)
|
|||
tree
|
||||
get_elaboration_procedure (void)
|
||||
{
|
||||
return VEC_last (tree, gnu_elab_proc_stack);
|
||||
return gnu_elab_proc_stack->last ();
|
||||
}
|
||||
|
||||
#include "gt-ada-trans.h"
|
||||
|
|
|
@ -201,13 +201,13 @@ static GTY((deletable)) struct gnat_binding_level *free_binding_level;
|
|||
static GTY(()) tree global_context;
|
||||
|
||||
/* An array of global declarations. */
|
||||
static GTY(()) VEC(tree,gc) *global_decls;
|
||||
static GTY(()) vec<tree, va_gc> *global_decls;
|
||||
|
||||
/* An array of builtin function declarations. */
|
||||
static GTY(()) VEC(tree,gc) *builtin_decls;
|
||||
static GTY(()) vec<tree, va_gc> *builtin_decls;
|
||||
|
||||
/* An array of global renaming pointers. */
|
||||
static GTY(()) VEC(tree,gc) *global_renaming_pointers;
|
||||
static GTY(()) vec<tree, va_gc> *global_renaming_pointers;
|
||||
|
||||
/* A chain of unused BLOCK nodes. */
|
||||
static GTY((deletable)) tree free_block_chain;
|
||||
|
@ -576,10 +576,10 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
|
|||
if (DECL_EXTERNAL (decl))
|
||||
{
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))
|
||||
VEC_safe_push (tree, gc, builtin_decls, decl);
|
||||
vec_safe_push (builtin_decls, decl);
|
||||
}
|
||||
else if (global_bindings_p ())
|
||||
VEC_safe_push (tree, gc, global_decls, decl);
|
||||
vec_safe_push (global_decls, decl);
|
||||
else
|
||||
{
|
||||
DECL_CHAIN (decl) = BLOCK_VARS (current_binding_level->block);
|
||||
|
@ -1953,11 +1953,11 @@ create_subprog_type (tree return_type, tree param_decl_list, tree cico_list,
|
|||
/* A list of the data type nodes of the subprogram formal parameters.
|
||||
This list is generated by traversing the input list of PARM_DECL
|
||||
nodes. */
|
||||
VEC(tree,gc) *param_type_list = NULL;
|
||||
vec<tree, va_gc> *param_type_list = NULL;
|
||||
tree t, type;
|
||||
|
||||
for (t = param_decl_list; t; t = DECL_CHAIN (t))
|
||||
VEC_safe_push (tree, gc, param_type_list, TREE_TYPE (t));
|
||||
vec_safe_push (param_type_list, TREE_TYPE (t));
|
||||
|
||||
type = build_function_type_vec (return_type, param_type_list);
|
||||
|
||||
|
@ -2517,7 +2517,7 @@ void
|
|||
record_global_renaming_pointer (tree decl)
|
||||
{
|
||||
gcc_assert (!DECL_LOOP_PARM_P (decl) && DECL_RENAMED_OBJECT (decl));
|
||||
VEC_safe_push (tree, gc, global_renaming_pointers, decl);
|
||||
vec_safe_push (global_renaming_pointers, decl);
|
||||
}
|
||||
|
||||
/* Invalidate the global renaming pointers. */
|
||||
|
@ -2528,10 +2528,13 @@ invalidate_global_renaming_pointers (void)
|
|||
unsigned int i;
|
||||
tree iter;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, global_renaming_pointers, i, iter)
|
||||
if (global_renaming_pointers == NULL)
|
||||
return;
|
||||
|
||||
FOR_EACH_VEC_ELT (*global_renaming_pointers, i, iter)
|
||||
SET_DECL_RENAMED_OBJECT (iter, NULL_TREE);
|
||||
|
||||
VEC_free (tree, gc, global_renaming_pointers);
|
||||
vec_free (global_renaming_pointers);
|
||||
}
|
||||
|
||||
/* Return true if VALUE is a known to be a multiple of FACTOR, which must be
|
||||
|
@ -3091,7 +3094,7 @@ max_size (tree exp, bool max_p)
|
|||
tree
|
||||
build_template (tree template_type, tree array_type, tree expr)
|
||||
{
|
||||
VEC(constructor_elt,gc) *template_elts = NULL;
|
||||
vec<constructor_elt, va_gc> *template_elts = NULL;
|
||||
tree bound_list = NULL_TREE;
|
||||
tree field;
|
||||
|
||||
|
@ -3755,7 +3758,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
|
|||
tree
|
||||
fill_vms_descriptor (tree gnu_type, tree gnu_expr, Node_Id gnat_actual)
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = NULL;
|
||||
vec<constructor_elt, va_gc> *v = NULL;
|
||||
tree field;
|
||||
|
||||
gnu_expr = maybe_unconstrained_array (gnu_expr);
|
||||
|
@ -3813,7 +3816,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
|
|||
/* See the head comment of build_vms_descriptor. */
|
||||
int iklass = TREE_INT_CST_LOW (DECL_INITIAL (klass));
|
||||
tree lfield, ufield;
|
||||
VEC(constructor_elt,gc) *v;
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
|
||||
/* Convert POINTER to the pointer-to-array type. */
|
||||
gnu_expr64 = convert (p_array_type, gnu_expr64);
|
||||
|
@ -3823,7 +3826,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
|
|||
case 1: /* Class S */
|
||||
case 15: /* Class SB */
|
||||
/* Build {1, LENGTH} template; LENGTH64 is the 5th field. */
|
||||
v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec_alloc (v, 2);
|
||||
t = DECL_CHAIN (DECL_CHAIN (klass));
|
||||
t = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
|
||||
CONSTRUCTOR_APPEND_ELT (v, min_field,
|
||||
|
@ -3855,7 +3858,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
|
|||
(TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (template_type))), ufield);
|
||||
|
||||
/* Build the template in the form of a constructor. */
|
||||
v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec_alloc (v, 2);
|
||||
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (template_type), lfield);
|
||||
CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (template_type)),
|
||||
ufield);
|
||||
|
@ -3903,7 +3906,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
|
|||
(TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (template_type))), ufield);
|
||||
|
||||
/* Build the template in the form of a constructor. */
|
||||
v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec_alloc (v, 2);
|
||||
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (template_type), lfield);
|
||||
CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (template_type)),
|
||||
ufield);
|
||||
|
@ -3924,7 +3927,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
|
|||
}
|
||||
|
||||
/* Build the fat pointer in the form of a constructor. */
|
||||
v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec_alloc (v, 2);
|
||||
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (gnu_type), gnu_expr64);
|
||||
CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (gnu_type)),
|
||||
template_addr);
|
||||
|
@ -3966,7 +3969,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
|
|||
tree template_tree, template_addr, aflags, dimct, t, u;
|
||||
/* See the head comment of build_vms_descriptor. */
|
||||
int iklass = TREE_INT_CST_LOW (DECL_INITIAL (klass));
|
||||
VEC(constructor_elt,gc) *v;
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
|
||||
/* Convert POINTER to the pointer-to-array type. */
|
||||
gnu_expr32 = convert (p_array_type, gnu_expr32);
|
||||
|
@ -3976,7 +3979,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
|
|||
case 1: /* Class S */
|
||||
case 15: /* Class SB */
|
||||
/* Build {1, LENGTH} template; LENGTH is the 1st field. */
|
||||
v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec_alloc (v, 2);
|
||||
t = TYPE_FIELDS (desc_type);
|
||||
t = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
|
||||
CONSTRUCTOR_APPEND_ELT (v, min_field,
|
||||
|
@ -4048,7 +4051,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
|
|||
}
|
||||
|
||||
/* Build the fat pointer in the form of a constructor. */
|
||||
v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec_alloc (v, 2);
|
||||
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (gnu_type), gnu_expr32);
|
||||
CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (gnu_type)),
|
||||
template_addr);
|
||||
|
@ -4306,7 +4309,8 @@ convert_to_fat_pointer (tree type, tree expr)
|
|||
tree p_array_type = TREE_TYPE (TYPE_FIELDS (type));
|
||||
tree etype = TREE_TYPE (expr);
|
||||
tree template_tree;
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, 2);
|
||||
|
||||
/* If EXPR is null, make a fat pointer that contains a null pointer to the
|
||||
array (compare_fat_pointers ensures that this is the full discriminant)
|
||||
|
@ -4323,7 +4327,8 @@ convert_to_fat_pointer (tree type, tree expr)
|
|||
{
|
||||
/* The template type can still be dummy at this point so we build an
|
||||
empty constructor. The middle-end will fill it in with zeros. */
|
||||
t = build_constructor (template_type, NULL);
|
||||
t = build_constructor (template_type,
|
||||
NULL);
|
||||
TREE_CONSTANT (t) = TREE_STATIC (t) = 1;
|
||||
null_bounds = build_unary_op (ADDR_EXPR, NULL_TREE, t);
|
||||
SET_TYPE_NULL_BOUNDS (ptr_template_type, null_bounds);
|
||||
|
@ -4425,7 +4430,7 @@ convert (tree type, tree expr)
|
|||
constructor to build the record, unless a variable size is involved. */
|
||||
else if (code == RECORD_TYPE && TYPE_PADDING_P (type))
|
||||
{
|
||||
VEC(constructor_elt,gc) *v;
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
|
||||
/* If we previously converted from another type and our type is
|
||||
of variable size, remove the conversion to avoid the need for
|
||||
|
@ -4478,7 +4483,7 @@ convert (tree type, tree expr)
|
|||
expr),
|
||||
false);
|
||||
|
||||
v = VEC_alloc (constructor_elt, gc, 1);
|
||||
vec_alloc (v, 1);
|
||||
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (type),
|
||||
convert (TREE_TYPE (TYPE_FIELDS (type)), expr));
|
||||
return gnat_build_constructor (type, v);
|
||||
|
@ -4495,11 +4500,9 @@ convert (tree type, tree expr)
|
|||
/* If we have just converted to this padded type, just get the
|
||||
inner expression. */
|
||||
if (TREE_CODE (expr) == CONSTRUCTOR
|
||||
&& !VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (expr))
|
||||
&& VEC_index (constructor_elt, CONSTRUCTOR_ELTS (expr), 0).index
|
||||
== TYPE_FIELDS (etype))
|
||||
unpadded
|
||||
= VEC_index (constructor_elt, CONSTRUCTOR_ELTS (expr), 0).value;
|
||||
&& !vec_safe_is_empty (CONSTRUCTOR_ELTS (expr))
|
||||
&& (*CONSTRUCTOR_ELTS (expr))[0].index == TYPE_FIELDS (etype))
|
||||
unpadded = (*CONSTRUCTOR_ELTS (expr))[0].value;
|
||||
|
||||
/* Otherwise, build an explicit component reference. */
|
||||
else
|
||||
|
@ -4533,7 +4536,8 @@ convert (tree type, tree expr)
|
|||
if (code == RECORD_TYPE && TYPE_CONTAINS_TEMPLATE_P (type))
|
||||
{
|
||||
tree obj_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (type)));
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, 2);
|
||||
|
||||
/* If the source already has a template, get a reference to the
|
||||
associated array only, as we are going to rebuild a template
|
||||
|
@ -4592,8 +4596,7 @@ convert (tree type, tree expr)
|
|||
{
|
||||
expr = copy_node (expr);
|
||||
TREE_TYPE (expr) = type;
|
||||
CONSTRUCTOR_ELTS (expr)
|
||||
= VEC_copy (constructor_elt, gc, CONSTRUCTOR_ELTS (expr));
|
||||
CONSTRUCTOR_ELTS (expr) = vec_safe_copy (CONSTRUCTOR_ELTS (expr));
|
||||
return expr;
|
||||
}
|
||||
|
||||
|
@ -4606,9 +4609,10 @@ convert (tree type, tree expr)
|
|||
|| tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (etype))))
|
||||
|
||||
{
|
||||
VEC(constructor_elt,gc) *e = CONSTRUCTOR_ELTS (expr);
|
||||
unsigned HOST_WIDE_INT len = VEC_length (constructor_elt, e);
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, len);
|
||||
vec<constructor_elt, va_gc> *e = CONSTRUCTOR_ELTS (expr);
|
||||
unsigned HOST_WIDE_INT len = vec_safe_length (e);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, len);
|
||||
tree efield = TYPE_FIELDS (etype), field = TYPE_FIELDS (type);
|
||||
unsigned HOST_WIDE_INT idx;
|
||||
tree index, value;
|
||||
|
@ -4626,7 +4630,7 @@ convert (tree type, tree expr)
|
|||
if (!SAME_FIELD_P (efield, field))
|
||||
break;
|
||||
constructor_elt elt = {field, convert (TREE_TYPE (field), value)};
|
||||
VEC_quick_push (constructor_elt, v, elt);
|
||||
v->quick_push (elt);
|
||||
|
||||
/* If packing has made this field a bitfield and the input
|
||||
value couldn't be emitted statically any more, we need to
|
||||
|
@ -4663,9 +4667,9 @@ convert (tree type, tree expr)
|
|||
&& gnat_types_compatible_p (TYPE_REPRESENTATIVE_ARRAY (type),
|
||||
etype))
|
||||
{
|
||||
VEC(constructor_elt,gc) *e = CONSTRUCTOR_ELTS (expr);
|
||||
unsigned HOST_WIDE_INT len = VEC_length (constructor_elt, e);
|
||||
VEC(constructor_elt,gc) *v;
|
||||
vec<constructor_elt, va_gc> *e = CONSTRUCTOR_ELTS (expr);
|
||||
unsigned HOST_WIDE_INT len = vec_safe_length (e);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
unsigned HOST_WIDE_INT ix;
|
||||
tree value;
|
||||
|
||||
|
@ -4689,11 +4693,11 @@ convert (tree type, tree expr)
|
|||
}
|
||||
|
||||
/* Otherwise, build a regular vector constructor. */
|
||||
v = VEC_alloc (constructor_elt, gc, len);
|
||||
vec_alloc (v, len);
|
||||
FOR_EACH_CONSTRUCTOR_VALUE (e, ix, value)
|
||||
{
|
||||
constructor_elt elt = {NULL_TREE, value};
|
||||
VEC_quick_push (constructor_elt, v, elt);
|
||||
v->quick_push (elt);
|
||||
}
|
||||
expr = copy_node (expr);
|
||||
TREE_TYPE (expr) = type;
|
||||
|
@ -4880,7 +4884,8 @@ convert (tree type, tree expr)
|
|||
case RECORD_TYPE:
|
||||
if (TYPE_JUSTIFIED_MODULAR_P (type) && !AGGREGATE_TYPE_P (etype))
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 1);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, 1);
|
||||
|
||||
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (type),
|
||||
convert (TREE_TYPE (TYPE_FIELDS (type)),
|
||||
|
@ -5048,9 +5053,7 @@ remove_conversions (tree exp, bool true_address)
|
|||
&& TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
|
||||
&& TYPE_JUSTIFIED_MODULAR_P (TREE_TYPE (exp)))
|
||||
return
|
||||
remove_conversions (VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (exp), 0).value,
|
||||
true);
|
||||
remove_conversions ((*CONSTRUCTOR_ELTS (exp))[0].value, true);
|
||||
break;
|
||||
|
||||
case COMPONENT_REF:
|
||||
|
@ -5292,7 +5295,8 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
|
|||
{
|
||||
tree rec_type = make_node (RECORD_TYPE);
|
||||
unsigned HOST_WIDE_INT prec = TREE_INT_CST_LOW (TYPE_RM_SIZE (etype));
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 1);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, 1);
|
||||
tree field_type, field;
|
||||
|
||||
if (TYPE_UNSIGNED (etype))
|
||||
|
@ -5575,7 +5579,7 @@ gnat_write_global_declarations (void)
|
|||
|
||||
/* If we have declared types as used at the global level, insert them in
|
||||
the global hash table. We use a dummy variable for this purpose. */
|
||||
if (!VEC_empty (tree, types_used_by_cur_var_decl))
|
||||
if (types_used_by_cur_var_decl && !types_used_by_cur_var_decl->is_empty ())
|
||||
{
|
||||
struct varpool_node *node;
|
||||
char *label;
|
||||
|
@ -5589,9 +5593,9 @@ gnat_write_global_declarations (void)
|
|||
node = varpool_node_for_decl (dummy_global);
|
||||
node->symbol.force_output = 1;
|
||||
|
||||
while (!VEC_empty (tree, types_used_by_cur_var_decl))
|
||||
while (!types_used_by_cur_var_decl->is_empty ())
|
||||
{
|
||||
tree t = VEC_pop (tree, types_used_by_cur_var_decl);
|
||||
tree t = types_used_by_cur_var_decl->pop ();
|
||||
types_used_by_var_decl_insert (t, dummy_global);
|
||||
}
|
||||
}
|
||||
|
@ -5600,7 +5604,7 @@ gnat_write_global_declarations (void)
|
|||
ensures that global types whose compilation hasn't been finalized yet,
|
||||
for example pointers to Taft amendment types, have their compilation
|
||||
finalized in the right context. */
|
||||
FOR_EACH_VEC_ELT (tree, global_decls, i, iter)
|
||||
FOR_EACH_VEC_SAFE_ELT (global_decls, i, iter)
|
||||
if (TREE_CODE (iter) == TYPE_DECL)
|
||||
debug_hooks->global_decl (iter);
|
||||
|
||||
|
@ -5612,7 +5616,7 @@ gnat_write_global_declarations (void)
|
|||
if (!seen_error ())
|
||||
{
|
||||
timevar_push (TV_SYMOUT);
|
||||
FOR_EACH_VEC_ELT (tree, global_decls, i, iter)
|
||||
FOR_EACH_VEC_SAFE_ELT (global_decls, i, iter)
|
||||
if (TREE_CODE (iter) != TYPE_DECL)
|
||||
debug_hooks->global_decl (iter);
|
||||
timevar_pop (TV_SYMOUT);
|
||||
|
@ -5641,7 +5645,7 @@ builtin_decl_for (tree name)
|
|||
unsigned i;
|
||||
tree decl;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, builtin_decls, i, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT (builtin_decls, i, decl)
|
||||
if (DECL_NAME (decl) == name)
|
||||
return decl;
|
||||
|
||||
|
|
|
@ -441,7 +441,7 @@ compare_fat_pointers (location_t loc, tree result_type, tree p1, tree p2)
|
|||
|
||||
/* The constant folder doesn't fold fat pointer types so we do it here. */
|
||||
if (TREE_CODE (p1) == CONSTRUCTOR)
|
||||
p1_array = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p1), 0).value;
|
||||
p1_array = (*CONSTRUCTOR_ELTS (p1))[0].value;
|
||||
else
|
||||
p1_array = build_component_ref (p1, NULL_TREE,
|
||||
TYPE_FIELDS (TREE_TYPE (p1)), true);
|
||||
|
@ -452,7 +452,7 @@ compare_fat_pointers (location_t loc, tree result_type, tree p1, tree p2)
|
|||
null_pointer_node));
|
||||
|
||||
if (TREE_CODE (p2) == CONSTRUCTOR)
|
||||
p2_array = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p2), 0).value;
|
||||
p2_array = (*CONSTRUCTOR_ELTS (p2))[0].value;
|
||||
else
|
||||
p2_array = build_component_ref (p2, NULL_TREE,
|
||||
TYPE_FIELDS (TREE_TYPE (p2)), true);
|
||||
|
@ -473,14 +473,14 @@ compare_fat_pointers (location_t loc, tree result_type, tree p1, tree p2)
|
|||
= fold_build2_loc (loc, EQ_EXPR, result_type, p1_array, p2_array);
|
||||
|
||||
if (TREE_CODE (p1) == CONSTRUCTOR)
|
||||
p1_bounds = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p1), 1).value;
|
||||
p1_bounds = (*CONSTRUCTOR_ELTS (p1))[1].value;
|
||||
else
|
||||
p1_bounds
|
||||
= build_component_ref (p1, NULL_TREE,
|
||||
DECL_CHAIN (TYPE_FIELDS (TREE_TYPE (p1))), true);
|
||||
|
||||
if (TREE_CODE (p2) == CONSTRUCTOR)
|
||||
p2_bounds = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p2), 1).value;
|
||||
p2_bounds = (*CONSTRUCTOR_ELTS (p2))[1].value;
|
||||
else
|
||||
p2_bounds
|
||||
= build_component_ref (p2, NULL_TREE,
|
||||
|
@ -1334,9 +1334,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
|
|||
a pointer to our type. */
|
||||
if (TYPE_IS_PADDING_P (type))
|
||||
{
|
||||
result = VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (operand),
|
||||
0).value;
|
||||
result = (*CONSTRUCTOR_ELTS (operand))[0].value;
|
||||
result = convert (build_pointer_type (TREE_TYPE (operand)),
|
||||
build_unary_op (ADDR_EXPR, NULL_TREE, result));
|
||||
break;
|
||||
|
@ -1831,7 +1829,7 @@ compare_elmt_bitpos (const PTR rt1, const PTR rt2)
|
|||
/* Return a CONSTRUCTOR of TYPE whose elements are V. */
|
||||
|
||||
tree
|
||||
gnat_build_constructor (tree type, VEC(constructor_elt,gc) *v)
|
||||
gnat_build_constructor (tree type, vec<constructor_elt, va_gc> *v)
|
||||
{
|
||||
bool allconstant = (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST);
|
||||
bool side_effects = false;
|
||||
|
@ -1859,7 +1857,7 @@ gnat_build_constructor (tree type, VEC(constructor_elt,gc) *v)
|
|||
by increasing bit position. This is necessary to ensure the
|
||||
constructor can be output as static data. */
|
||||
if (allconstant && TREE_CODE (type) == RECORD_TYPE && n_elmts > 1)
|
||||
VEC_qsort (constructor_elt, v, compare_elmt_bitpos);
|
||||
v->qsort (compare_elmt_bitpos);
|
||||
|
||||
result = build_constructor (type, v);
|
||||
TREE_CONSTANT (result) = TREE_STATIC (result) = allconstant;
|
||||
|
@ -1989,7 +1987,7 @@ build_simple_component_ref (tree record_variable, tree component,
|
|||
if (TREE_CODE (record_variable) == CONSTRUCTOR
|
||||
&& TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (record_variable)))
|
||||
{
|
||||
VEC(constructor_elt,gc) *elts = CONSTRUCTOR_ELTS (record_variable);
|
||||
vec<constructor_elt, va_gc> *elts = CONSTRUCTOR_ELTS (record_variable);
|
||||
unsigned HOST_WIDE_INT idx;
|
||||
tree index, value;
|
||||
FOR_EACH_CONSTRUCTOR_ELT (elts, idx, index, value)
|
||||
|
@ -2302,7 +2300,8 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
|
|||
If there is no initializing expression, just set the bounds. */
|
||||
if (init)
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, 2);
|
||||
|
||||
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (storage_type),
|
||||
build_template (template_type, type, init));
|
||||
|
@ -2673,12 +2672,10 @@ gnat_stabilize_reference (tree ref, bool force, bool *success)
|
|||
/* Constructors with 1 element are used extensively to formally
|
||||
convert objects to special wrapping types. */
|
||||
if (TREE_CODE (type) == RECORD_TYPE
|
||||
&& VEC_length (constructor_elt, CONSTRUCTOR_ELTS (ref)) == 1)
|
||||
&& vec_safe_length (CONSTRUCTOR_ELTS (ref)) == 1)
|
||||
{
|
||||
tree index
|
||||
= VEC_index (constructor_elt, CONSTRUCTOR_ELTS (ref), 0).index;
|
||||
tree value
|
||||
= VEC_index (constructor_elt, CONSTRUCTOR_ELTS (ref), 0).value;
|
||||
tree index = (*CONSTRUCTOR_ELTS (ref))[0].index;
|
||||
tree value = (*CONSTRUCTOR_ELTS (ref))[0].value;
|
||||
result
|
||||
= build_constructor_single (type, index,
|
||||
gnat_stabilize_reference_1 (value,
|
||||
|
|
67
gcc/alias.c
67
gcc/alias.c
|
@ -206,7 +206,7 @@ static void memory_modified_1 (rtx, const_rtx, void *);
|
|||
The ADDRESS in group (1) _may_ alias globals; it has VOIDmode to
|
||||
indicate this. */
|
||||
|
||||
static GTY(()) VEC(rtx,gc) *reg_base_value;
|
||||
static GTY(()) vec<rtx, va_gc> *reg_base_value;
|
||||
static rtx *new_reg_base_value;
|
||||
|
||||
/* The single VOIDmode ADDRESS that represents all argument bases.
|
||||
|
@ -219,7 +219,7 @@ static int unique_id;
|
|||
/* We preserve the copy of old array around to avoid amount of garbage
|
||||
produced. About 8% of garbage produced were attributed to this
|
||||
array. */
|
||||
static GTY((deletable)) VEC(rtx,gc) *old_reg_base_value;
|
||||
static GTY((deletable)) vec<rtx, va_gc> *old_reg_base_value;
|
||||
|
||||
/* Values of XINT (address, 0) of Pmode ADDRESS rtxes for special
|
||||
registers. */
|
||||
|
@ -231,14 +231,14 @@ static GTY((deletable)) VEC(rtx,gc) *old_reg_base_value;
|
|||
#define static_reg_base_value \
|
||||
(this_target_rtl->x_static_reg_base_value)
|
||||
|
||||
#define REG_BASE_VALUE(X) \
|
||||
(REGNO (X) < VEC_length (rtx, reg_base_value) \
|
||||
? VEC_index (rtx, reg_base_value, REGNO (X)) : 0)
|
||||
#define REG_BASE_VALUE(X) \
|
||||
(REGNO (X) < vec_safe_length (reg_base_value) \
|
||||
? (*reg_base_value)[REGNO (X)] : 0)
|
||||
|
||||
/* Vector indexed by N giving the initial (unchanging) value known for
|
||||
pseudo-register N. This vector is initialized in init_alias_analysis,
|
||||
and does not change until end_alias_analysis is called. */
|
||||
static GTY(()) VEC(rtx,gc) *reg_known_value;
|
||||
static GTY(()) vec<rtx, va_gc> *reg_known_value;
|
||||
|
||||
/* Vector recording for each reg_known_value whether it is due to a
|
||||
REG_EQUIV note. Future passes (viz., reload) may replace the
|
||||
|
@ -258,11 +258,9 @@ static sbitmap reg_known_equiv_p;
|
|||
NOTE_INSN_FUNCTION_BEG note. */
|
||||
static bool copying_arguments;
|
||||
|
||||
DEF_VEC_P(alias_set_entry);
|
||||
DEF_VEC_ALLOC_P(alias_set_entry,gc);
|
||||
|
||||
/* The splay-tree used to store the various alias set entries. */
|
||||
static GTY (()) VEC(alias_set_entry,gc) *alias_sets;
|
||||
static GTY (()) vec<alias_set_entry, va_gc> *alias_sets;
|
||||
|
||||
/* Build a decomposed reference object for querying the alias-oracle
|
||||
from the MEM rtx and store it in *REF.
|
||||
|
@ -391,7 +389,7 @@ rtx_refs_may_alias_p (const_rtx x, const_rtx mem, bool tbaa_p)
|
|||
static inline alias_set_entry
|
||||
get_alias_set_entry (alias_set_type alias_set)
|
||||
{
|
||||
return VEC_index (alias_set_entry, alias_sets, alias_set);
|
||||
return (*alias_sets)[alias_set];
|
||||
}
|
||||
|
||||
/* Returns nonzero if the alias sets for MEM1 and MEM2 are such that
|
||||
|
@ -854,9 +852,9 @@ new_alias_set (void)
|
|||
if (flag_strict_aliasing)
|
||||
{
|
||||
if (alias_sets == 0)
|
||||
VEC_safe_push (alias_set_entry, gc, alias_sets, 0);
|
||||
VEC_safe_push (alias_set_entry, gc, alias_sets, 0);
|
||||
return VEC_length (alias_set_entry, alias_sets) - 1;
|
||||
vec_safe_push (alias_sets, (alias_set_entry) 0);
|
||||
vec_safe_push (alias_sets, (alias_set_entry) 0);
|
||||
return alias_sets->length () - 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
@ -900,7 +898,7 @@ record_alias_subset (alias_set_type superset, alias_set_type subset)
|
|||
ggc_alloc_splay_tree_scalar_scalar_splay_tree_s,
|
||||
ggc_alloc_splay_tree_scalar_scalar_splay_tree_node_s);
|
||||
superset_entry->has_zero_child = 0;
|
||||
VEC_replace (alias_set_entry, alias_sets, superset, superset_entry);
|
||||
(*alias_sets)[superset] = superset_entry;
|
||||
}
|
||||
|
||||
if (subset == 0)
|
||||
|
@ -1079,7 +1077,7 @@ find_base_value (rtx src)
|
|||
The test above is not sufficient because the scheduler may move
|
||||
a copy out of an arg reg past the NOTE_INSN_FUNCTION_BEGIN. */
|
||||
if ((regno >= FIRST_PSEUDO_REGISTER || fixed_regs[regno])
|
||||
&& regno < VEC_length (rtx, reg_base_value))
|
||||
&& regno < vec_safe_length (reg_base_value))
|
||||
{
|
||||
/* If we're inside init_alias_analysis, use new_reg_base_value
|
||||
to reduce the number of relaxation iterations. */
|
||||
|
@ -1087,8 +1085,8 @@ find_base_value (rtx src)
|
|||
&& DF_REG_DEF_COUNT (regno) == 1)
|
||||
return new_reg_base_value[regno];
|
||||
|
||||
if (VEC_index (rtx, reg_base_value, regno))
|
||||
return VEC_index (rtx, reg_base_value, regno);
|
||||
if ((*reg_base_value)[regno])
|
||||
return (*reg_base_value)[regno];
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1233,7 +1231,7 @@ record_set (rtx dest, const_rtx set, void *data ATTRIBUTE_UNUSED)
|
|||
|
||||
regno = REGNO (dest);
|
||||
|
||||
gcc_checking_assert (regno < VEC_length (rtx, reg_base_value));
|
||||
gcc_checking_assert (regno < reg_base_value->length ());
|
||||
|
||||
/* If this spans multiple hard registers, then we must indicate that every
|
||||
register has an unusable value. */
|
||||
|
@ -1338,7 +1336,7 @@ record_set (rtx dest, const_rtx set, void *data ATTRIBUTE_UNUSED)
|
|||
rtx
|
||||
get_reg_base_value (unsigned int regno)
|
||||
{
|
||||
return VEC_index (rtx, reg_base_value, regno);
|
||||
return (*reg_base_value)[regno];
|
||||
}
|
||||
|
||||
/* If a value is known for REGNO, return it. */
|
||||
|
@ -1349,8 +1347,8 @@ get_reg_known_value (unsigned int regno)
|
|||
if (regno >= FIRST_PSEUDO_REGISTER)
|
||||
{
|
||||
regno -= FIRST_PSEUDO_REGISTER;
|
||||
if (regno < VEC_length (rtx, reg_known_value))
|
||||
return VEC_index (rtx, reg_known_value, regno);
|
||||
if (regno < vec_safe_length (reg_known_value))
|
||||
return (*reg_known_value)[regno];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1363,8 +1361,8 @@ set_reg_known_value (unsigned int regno, rtx val)
|
|||
if (regno >= FIRST_PSEUDO_REGISTER)
|
||||
{
|
||||
regno -= FIRST_PSEUDO_REGISTER;
|
||||
if (regno < VEC_length (rtx, reg_known_value))
|
||||
VEC_replace (rtx, reg_known_value, regno, val);
|
||||
if (regno < vec_safe_length (reg_known_value))
|
||||
(*reg_known_value)[regno] = val;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1376,7 +1374,7 @@ get_reg_known_equiv_p (unsigned int regno)
|
|||
if (regno >= FIRST_PSEUDO_REGISTER)
|
||||
{
|
||||
regno -= FIRST_PSEUDO_REGISTER;
|
||||
if (regno < VEC_length (rtx, reg_known_value))
|
||||
if (regno < vec_safe_length (reg_known_value))
|
||||
return bitmap_bit_p (reg_known_equiv_p, regno);
|
||||
}
|
||||
return false;
|
||||
|
@ -1388,7 +1386,7 @@ set_reg_known_equiv_p (unsigned int regno, bool val)
|
|||
if (regno >= FIRST_PSEUDO_REGISTER)
|
||||
{
|
||||
regno -= FIRST_PSEUDO_REGISTER;
|
||||
if (regno < VEC_length (rtx, reg_known_value))
|
||||
if (regno < vec_safe_length (reg_known_value))
|
||||
{
|
||||
if (val)
|
||||
bitmap_set_bit (reg_known_equiv_p, regno);
|
||||
|
@ -2811,7 +2809,7 @@ init_alias_analysis (void)
|
|||
|
||||
timevar_push (TV_ALIAS_ANALYSIS);
|
||||
|
||||
reg_known_value = VEC_alloc (rtx, gc, maxreg - FIRST_PSEUDO_REGISTER);
|
||||
vec_alloc (reg_known_value, maxreg - FIRST_PSEUDO_REGISTER);
|
||||
reg_known_equiv_p = sbitmap_alloc (maxreg - FIRST_PSEUDO_REGISTER);
|
||||
|
||||
/* If we have memory allocated from the previous run, use it. */
|
||||
|
@ -2819,9 +2817,9 @@ init_alias_analysis (void)
|
|||
reg_base_value = old_reg_base_value;
|
||||
|
||||
if (reg_base_value)
|
||||
VEC_truncate (rtx, reg_base_value, 0);
|
||||
reg_base_value->truncate (0);
|
||||
|
||||
VEC_safe_grow_cleared (rtx, gc, reg_base_value, maxreg);
|
||||
vec_safe_grow_cleared (reg_base_value, maxreg);
|
||||
|
||||
new_reg_base_value = XNEWVEC (rtx, maxreg);
|
||||
reg_seen = sbitmap_alloc (maxreg);
|
||||
|
@ -2969,11 +2967,10 @@ init_alias_analysis (void)
|
|||
for (ui = 0; ui < maxreg; ui++)
|
||||
{
|
||||
if (new_reg_base_value[ui]
|
||||
&& new_reg_base_value[ui] != VEC_index (rtx, reg_base_value, ui)
|
||||
&& ! rtx_equal_p (new_reg_base_value[ui],
|
||||
VEC_index (rtx, reg_base_value, ui)))
|
||||
&& new_reg_base_value[ui] != (*reg_base_value)[ui]
|
||||
&& ! rtx_equal_p (new_reg_base_value[ui], (*reg_base_value)[ui]))
|
||||
{
|
||||
VEC_replace (rtx, reg_base_value, ui, new_reg_base_value[ui]);
|
||||
(*reg_base_value)[ui] = new_reg_base_value[ui];
|
||||
changed = 1;
|
||||
}
|
||||
}
|
||||
|
@ -2982,7 +2979,7 @@ init_alias_analysis (void)
|
|||
XDELETEVEC (rpo);
|
||||
|
||||
/* Fill in the remaining entries. */
|
||||
FOR_EACH_VEC_ELT (rtx, reg_known_value, i, val)
|
||||
FOR_EACH_VEC_ELT (*reg_known_value, i, val)
|
||||
{
|
||||
int regno = i + FIRST_PSEUDO_REGISTER;
|
||||
if (! val)
|
||||
|
@ -3003,14 +3000,14 @@ init_alias_analysis (void)
|
|||
void
|
||||
vt_equate_reg_base_value (const_rtx reg1, const_rtx reg2)
|
||||
{
|
||||
VEC_replace (rtx, reg_base_value, REGNO (reg1), REG_BASE_VALUE (reg2));
|
||||
(*reg_base_value)[REGNO (reg1)] = REG_BASE_VALUE (reg2);
|
||||
}
|
||||
|
||||
void
|
||||
end_alias_analysis (void)
|
||||
{
|
||||
old_reg_base_value = reg_base_value;
|
||||
VEC_free (rtx, gc, reg_known_value);
|
||||
vec_free (reg_known_value);
|
||||
sbitmap_free (reg_known_equiv_p);
|
||||
}
|
||||
|
||||
|
|
11
gcc/asan.c
11
gcc/asan.c
|
@ -1436,12 +1436,12 @@ asan_global_struct (void)
|
|||
TYPE is __asan_global struct type as returned by asan_global_struct. */
|
||||
|
||||
static void
|
||||
asan_add_global (tree decl, tree type, VEC(constructor_elt, gc) *v)
|
||||
asan_add_global (tree decl, tree type, vec<constructor_elt, va_gc> *v)
|
||||
{
|
||||
tree init, uptr = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (type)));
|
||||
unsigned HOST_WIDE_INT size;
|
||||
tree str_cst, refdecl = decl;
|
||||
VEC(constructor_elt, gc) *vinner = NULL;
|
||||
vec<constructor_elt, va_gc> *vinner = NULL;
|
||||
|
||||
if (!asan_pp_initialized)
|
||||
asan_pp_initialize ();
|
||||
|
@ -1460,8 +1460,7 @@ asan_add_global (tree decl, tree type, VEC(constructor_elt, gc) *v)
|
|||
if (asan_needs_local_alias (decl))
|
||||
{
|
||||
char buf[20];
|
||||
ASM_GENERATE_INTERNAL_LABEL (buf, "LASAN",
|
||||
VEC_length (constructor_elt, v) + 1);
|
||||
ASM_GENERATE_INTERNAL_LABEL (buf, "LASAN", vec_safe_length (v) + 1);
|
||||
refdecl = build_decl (DECL_SOURCE_LOCATION (decl),
|
||||
VAR_DECL, get_identifier (buf), TREE_TYPE (decl));
|
||||
TREE_ADDRESSABLE (refdecl) = TREE_ADDRESSABLE (decl);
|
||||
|
@ -1515,7 +1514,7 @@ asan_finish_file (void)
|
|||
tree type = asan_global_struct (), var, ctor, decl;
|
||||
tree uptr = build_nonstandard_integer_type (POINTER_SIZE, 1);
|
||||
tree dtor_statements = NULL_TREE;
|
||||
VEC(constructor_elt, gc) *v;
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
char buf[20];
|
||||
|
||||
type = build_array_type_nelts (type, gcount);
|
||||
|
@ -1526,7 +1525,7 @@ asan_finish_file (void)
|
|||
TREE_PUBLIC (var) = 0;
|
||||
DECL_ARTIFICIAL (var) = 1;
|
||||
DECL_IGNORED_P (var) = 1;
|
||||
v = VEC_alloc (constructor_elt, gc, gcount);
|
||||
vec_alloc (v, gcount);
|
||||
FOR_EACH_DEFINED_VARIABLE (vnode)
|
||||
if (asan_protect_global (vnode->symbol.decl))
|
||||
asan_add_global (vnode->symbol.decl, TREE_TYPE (type), v);
|
||||
|
|
|
@ -46,23 +46,17 @@ struct substring
|
|||
int length;
|
||||
};
|
||||
|
||||
DEF_VEC_O (attribute_spec);
|
||||
DEF_VEC_ALLOC_O (attribute_spec, heap);
|
||||
|
||||
/* Scoped attribute name representation. */
|
||||
|
||||
struct scoped_attributes
|
||||
{
|
||||
const char *ns;
|
||||
VEC (attribute_spec, heap) *attributes;
|
||||
vec<attribute_spec> attributes;
|
||||
htab_t attribute_hash;
|
||||
};
|
||||
|
||||
DEF_VEC_O (scoped_attributes);
|
||||
DEF_VEC_ALLOC_O (scoped_attributes, heap);
|
||||
|
||||
/* The table of scope attributes. */
|
||||
static VEC(scoped_attributes, heap) *attributes_table;
|
||||
static vec<scoped_attributes> attributes_table;
|
||||
|
||||
static scoped_attributes* find_attribute_namespace (const char*);
|
||||
static void register_scoped_attribute (const struct attribute_spec *,
|
||||
|
@ -140,21 +134,20 @@ register_scoped_attributes (const struct attribute_spec * attributes,
|
|||
/* We don't have any namespace NS yet. Create one. */
|
||||
scoped_attributes sa;
|
||||
|
||||
if (attributes_table == NULL)
|
||||
attributes_table = VEC_alloc (scoped_attributes, heap, 64);
|
||||
if (!attributes_table.is_empty ())
|
||||
attributes_table.create (64);
|
||||
|
||||
memset (&sa, 0, sizeof (sa));
|
||||
sa.ns = ns;
|
||||
sa.attributes = VEC_alloc (attribute_spec, heap, 64);
|
||||
result = VEC_safe_push (scoped_attributes, heap, attributes_table, sa);
|
||||
sa.attributes.create (64);
|
||||
result = attributes_table.safe_push (sa);
|
||||
result->attribute_hash = htab_create (200, hash_attr, eq_attr, NULL);
|
||||
}
|
||||
|
||||
/* Really add the attributes to their namespace now. */
|
||||
for (unsigned i = 0; attributes[i].name != NULL; ++i)
|
||||
{
|
||||
VEC_safe_push (attribute_spec, heap,
|
||||
result->attributes, attributes[i]);
|
||||
result->attributes.safe_push (attributes[i]);
|
||||
register_scoped_attribute (&attributes[i], result);
|
||||
}
|
||||
|
||||
|
@ -171,7 +164,7 @@ find_attribute_namespace (const char* ns)
|
|||
unsigned ix;
|
||||
scoped_attributes *iter;
|
||||
|
||||
FOR_EACH_VEC_ELT (scoped_attributes, attributes_table, ix, iter)
|
||||
FOR_EACH_VEC_ELT (attributes_table, ix, iter)
|
||||
if (ns == iter->ns
|
||||
|| (iter->ns != NULL
|
||||
&& ns != NULL
|
||||
|
|
|
@ -61,9 +61,6 @@ struct GTY((user)) edge_def {
|
|||
in profile.c */
|
||||
};
|
||||
|
||||
DEF_VEC_P(edge);
|
||||
DEF_VEC_ALLOC_P(edge,gc);
|
||||
DEF_VEC_ALLOC_P(edge,heap);
|
||||
|
||||
/* Garbage collection and PCH support for edge_def. */
|
||||
extern void gt_ggc_mx (edge_def *e);
|
||||
|
@ -182,8 +179,8 @@ struct GTY(()) gimple_bb_info {
|
|||
/* Basic block information indexed by block number. */
|
||||
struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_def {
|
||||
/* The edges into and out of the block. */
|
||||
VEC(edge,gc) *preds;
|
||||
VEC(edge,gc) *succs;
|
||||
vec<edge, va_gc> *preds;
|
||||
vec<edge, va_gc> *succs;
|
||||
|
||||
/* Auxiliary info specific to a pass. */
|
||||
PTR GTY ((skip (""))) aux;
|
||||
|
@ -231,9 +228,6 @@ typedef int __assert_gimple_bb_smaller_rtl_bb
|
|||
[(int)sizeof(struct rtl_bb_info)
|
||||
- (int)sizeof (struct gimple_bb_info)];
|
||||
|
||||
DEF_VEC_P(basic_block);
|
||||
DEF_VEC_ALLOC_P(basic_block,gc);
|
||||
DEF_VEC_ALLOC_P(basic_block,heap);
|
||||
|
||||
#define BB_FREQ_MAX 10000
|
||||
|
||||
|
@ -299,7 +293,7 @@ struct GTY(()) control_flow_graph {
|
|||
basic_block x_exit_block_ptr;
|
||||
|
||||
/* Index by basic block number, get basic block struct info. */
|
||||
VEC(basic_block,gc) *x_basic_block_info;
|
||||
vec<basic_block, va_gc> *x_basic_block_info;
|
||||
|
||||
/* Number of basic blocks in this flow graph. */
|
||||
int x_n_basic_blocks;
|
||||
|
@ -315,7 +309,7 @@ struct GTY(()) control_flow_graph {
|
|||
|
||||
/* Mapping of labels to their associated blocks. At present
|
||||
only used for the gimple CFG. */
|
||||
VEC(basic_block,gc) *x_label_to_block_map;
|
||||
vec<basic_block, va_gc> *x_label_to_block_map;
|
||||
|
||||
enum profile_status_d x_profile_status;
|
||||
|
||||
|
@ -341,9 +335,9 @@ struct GTY(()) control_flow_graph {
|
|||
#define profile_status_for_function(FN) ((FN)->cfg->x_profile_status)
|
||||
|
||||
#define BASIC_BLOCK_FOR_FUNCTION(FN,N) \
|
||||
(VEC_index (basic_block, basic_block_info_for_function(FN), (N)))
|
||||
((*basic_block_info_for_function(FN))[(N)])
|
||||
#define SET_BASIC_BLOCK_FOR_FUNCTION(FN,N,BB) \
|
||||
(VEC_replace (basic_block, basic_block_info_for_function(FN), (N), (BB)))
|
||||
((*basic_block_info_for_function(FN))[(N)] = (BB))
|
||||
|
||||
/* Defines for textual backward source compatibility. */
|
||||
#define ENTRY_BLOCK_PTR (cfun->cfg->x_entry_block_ptr)
|
||||
|
@ -355,8 +349,8 @@ struct GTY(()) control_flow_graph {
|
|||
#define label_to_block_map (cfun->cfg->x_label_to_block_map)
|
||||
#define profile_status (cfun->cfg->x_profile_status)
|
||||
|
||||
#define BASIC_BLOCK(N) (VEC_index (basic_block, basic_block_info, (N)))
|
||||
#define SET_BASIC_BLOCK(N,BB) (VEC_replace (basic_block, basic_block_info, (N), (BB)))
|
||||
#define BASIC_BLOCK(N) ((*basic_block_info)[(N)])
|
||||
#define SET_BASIC_BLOCK(N,BB) ((*basic_block_info)[(N)] = (BB))
|
||||
|
||||
/* For iterating over basic blocks. */
|
||||
#define FOR_BB_BETWEEN(BB, FROM, TO, DIR) \
|
||||
|
@ -473,7 +467,7 @@ typedef struct ce_if_block
|
|||
} ce_if_block_t;
|
||||
|
||||
/* This structure maintains an edge list vector. */
|
||||
/* FIXME: Make this a VEC(edge). */
|
||||
/* FIXME: Make this a vec<edge>. */
|
||||
struct edge_list
|
||||
{
|
||||
int num_edges;
|
||||
|
@ -518,10 +512,10 @@ struct edge_list
|
|||
#define EDGE_CRITICAL_P(e) (EDGE_COUNT ((e)->src->succs) >= 2 \
|
||||
&& EDGE_COUNT ((e)->dest->preds) >= 2)
|
||||
|
||||
#define EDGE_COUNT(ev) VEC_length (edge, (ev))
|
||||
#define EDGE_I(ev,i) VEC_index (edge, (ev), (i))
|
||||
#define EDGE_PRED(bb,i) VEC_index (edge, (bb)->preds, (i))
|
||||
#define EDGE_SUCC(bb,i) VEC_index (edge, (bb)->succs, (i))
|
||||
#define EDGE_COUNT(ev) vec_safe_length (ev)
|
||||
#define EDGE_I(ev,i) (*ev)[(i)]
|
||||
#define EDGE_PRED(bb,i) (*(bb)->preds)[(i)]
|
||||
#define EDGE_SUCC(bb,i) (*(bb)->succs)[(i)]
|
||||
|
||||
/* Returns true if BB has precisely one successor. */
|
||||
|
||||
|
@ -581,10 +575,10 @@ single_pred (const_basic_block bb)
|
|||
|
||||
typedef struct {
|
||||
unsigned index;
|
||||
VEC(edge,gc) **container;
|
||||
vec<edge, va_gc> **container;
|
||||
} edge_iterator;
|
||||
|
||||
static inline VEC(edge,gc) *
|
||||
static inline vec<edge, va_gc> *
|
||||
ei_container (edge_iterator i)
|
||||
{
|
||||
gcc_checking_assert (i.container);
|
||||
|
@ -596,7 +590,7 @@ ei_container (edge_iterator i)
|
|||
|
||||
/* Return an iterator pointing to the start of an edge vector. */
|
||||
static inline edge_iterator
|
||||
ei_start_1 (VEC(edge,gc) **ev)
|
||||
ei_start_1 (vec<edge, va_gc> **ev)
|
||||
{
|
||||
edge_iterator i;
|
||||
|
||||
|
@ -609,7 +603,7 @@ ei_start_1 (VEC(edge,gc) **ev)
|
|||
/* Return an iterator pointing to the last element of an edge
|
||||
vector. */
|
||||
static inline edge_iterator
|
||||
ei_last_1 (VEC(edge,gc) **ev)
|
||||
ei_last_1 (vec<edge, va_gc> **ev)
|
||||
{
|
||||
edge_iterator i;
|
||||
|
||||
|
@ -848,13 +842,13 @@ extern void set_immediate_dominator (enum cdi_direction, basic_block,
|
|||
basic_block);
|
||||
extern basic_block get_immediate_dominator (enum cdi_direction, basic_block);
|
||||
extern bool dominated_by_p (enum cdi_direction, const_basic_block, const_basic_block);
|
||||
extern VEC (basic_block, heap) *get_dominated_by (enum cdi_direction, basic_block);
|
||||
extern VEC (basic_block, heap) *get_dominated_by_region (enum cdi_direction,
|
||||
extern vec<basic_block> get_dominated_by (enum cdi_direction, basic_block);
|
||||
extern vec<basic_block> get_dominated_by_region (enum cdi_direction,
|
||||
basic_block *,
|
||||
unsigned);
|
||||
extern VEC (basic_block, heap) *get_dominated_to_depth (enum cdi_direction,
|
||||
extern vec<basic_block> get_dominated_to_depth (enum cdi_direction,
|
||||
basic_block, int);
|
||||
extern VEC (basic_block, heap) *get_all_dominated_blocks (enum cdi_direction,
|
||||
extern vec<basic_block> get_all_dominated_blocks (enum cdi_direction,
|
||||
basic_block);
|
||||
extern void add_to_dominance_info (enum cdi_direction, basic_block);
|
||||
extern void delete_from_dominance_info (enum cdi_direction, basic_block);
|
||||
|
@ -862,7 +856,7 @@ basic_block recompute_dominator (enum cdi_direction, basic_block);
|
|||
extern void redirect_immediate_dominators (enum cdi_direction, basic_block,
|
||||
basic_block);
|
||||
extern void iterate_fix_dominators (enum cdi_direction,
|
||||
VEC (basic_block, heap) *, bool);
|
||||
vec<basic_block> , bool);
|
||||
extern void verify_dominators (enum cdi_direction);
|
||||
extern basic_block first_dom_son (enum cdi_direction, basic_block);
|
||||
extern basic_block next_dom_son (enum cdi_direction, basic_block);
|
||||
|
@ -918,7 +912,7 @@ bb_has_abnormal_pred (basic_block bb)
|
|||
|
||||
/* Return the fallthru edge in EDGES if it exists, NULL otherwise. */
|
||||
static inline edge
|
||||
find_fallthru_edge (VEC(edge,gc) *edges)
|
||||
find_fallthru_edge (vec<edge, va_gc> *edges)
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
|
|
@ -1458,10 +1458,10 @@ fix_up_crossing_landing_pad (eh_landing_pad old_lp, basic_block old_bb)
|
|||
a separate section of the .o file (to cut down on paging and improve
|
||||
cache locality). Return a vector of all edges that cross. */
|
||||
|
||||
static VEC(edge, heap) *
|
||||
static vec<edge>
|
||||
find_rarely_executed_basic_blocks_and_crossing_edges (void)
|
||||
{
|
||||
VEC(edge, heap) *crossing_edges = NULL;
|
||||
vec<edge> crossing_edges = vec<edge>();
|
||||
basic_block bb;
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
@ -1483,7 +1483,7 @@ find_rarely_executed_basic_blocks_and_crossing_edges (void)
|
|||
unsigned i;
|
||||
eh_landing_pad lp;
|
||||
|
||||
FOR_EACH_VEC_ELT (eh_landing_pad, cfun->eh->lp_array, i, lp)
|
||||
FOR_EACH_VEC_ELT (*cfun->eh->lp_array, i, lp)
|
||||
{
|
||||
bool all_same, all_diff;
|
||||
|
||||
|
@ -1530,7 +1530,7 @@ find_rarely_executed_basic_blocks_and_crossing_edges (void)
|
|||
&& e->dest != EXIT_BLOCK_PTR
|
||||
&& BB_PARTITION (e->src) != BB_PARTITION (e->dest))
|
||||
{
|
||||
VEC_safe_push (edge, heap, crossing_edges, e);
|
||||
crossing_edges.safe_push (e);
|
||||
flags |= EDGE_CROSSING;
|
||||
}
|
||||
|
||||
|
@ -1583,12 +1583,12 @@ set_edge_can_fallthru_flag (void)
|
|||
Convert any easy fall-through crossing edges to unconditional jumps. */
|
||||
|
||||
static void
|
||||
add_labels_and_missing_jumps (VEC(edge, heap) *crossing_edges)
|
||||
add_labels_and_missing_jumps (vec<edge> crossing_edges)
|
||||
{
|
||||
size_t i;
|
||||
edge e;
|
||||
|
||||
FOR_EACH_VEC_ELT (edge, crossing_edges, i, e)
|
||||
FOR_EACH_VEC_ELT (crossing_edges, i, e)
|
||||
{
|
||||
basic_block src = e->src;
|
||||
basic_block dest = e->dest;
|
||||
|
@ -2500,7 +2500,7 @@ gate_handle_partition_blocks (void)
|
|||
static unsigned
|
||||
partition_hot_cold_basic_blocks (void)
|
||||
{
|
||||
VEC(edge, heap) *crossing_edges;
|
||||
vec<edge> crossing_edges;
|
||||
|
||||
if (n_basic_blocks <= NUM_FIXED_BLOCKS + 1)
|
||||
return 0;
|
||||
|
@ -2508,7 +2508,7 @@ partition_hot_cold_basic_blocks (void)
|
|||
df_set_flags (DF_DEFER_INSN_RESCAN);
|
||||
|
||||
crossing_edges = find_rarely_executed_basic_blocks_and_crossing_edges ();
|
||||
if (crossing_edges == NULL)
|
||||
if (!crossing_edges.exists ())
|
||||
return 0;
|
||||
|
||||
/* Make sure the source of any crossing edge ends in a jump and the
|
||||
|
@ -2539,7 +2539,7 @@ partition_hot_cold_basic_blocks (void)
|
|||
/* Clear bb->aux fields that the above routines were using. */
|
||||
clear_aux_for_blocks ();
|
||||
|
||||
VEC_free (edge, heap, crossing_edges);
|
||||
crossing_edges.release ();
|
||||
|
||||
/* ??? FIXME: DF generates the bb info for a block immediately.
|
||||
And by immediately, I mean *during* creation of the block.
|
||||
|
|
|
@ -6581,7 +6581,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
|
|||
case BUILT_IN_ATOMIC_COMPARE_EXCHANGE_16:
|
||||
{
|
||||
unsigned int nargs, z;
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
|
||||
mode =
|
||||
get_builtin_sync_mode (fcode - BUILT_IN_ATOMIC_COMPARE_EXCHANGE_1);
|
||||
|
@ -6592,12 +6592,12 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
|
|||
/* If this is turned into an external library call, the weak parameter
|
||||
must be dropped to match the expected parameter list. */
|
||||
nargs = call_expr_nargs (exp);
|
||||
vec = VEC_alloc (tree, gc, nargs - 1);
|
||||
vec_alloc (vec, nargs - 1);
|
||||
for (z = 0; z < 3; z++)
|
||||
VEC_quick_push (tree, vec, CALL_EXPR_ARG (exp, z));
|
||||
vec->quick_push (CALL_EXPR_ARG (exp, z));
|
||||
/* Skip the boolean weak parameter. */
|
||||
for (z = 4; z < 6; z++)
|
||||
VEC_quick_push (tree, vec, CALL_EXPR_ARG (exp, z));
|
||||
vec->quick_push (CALL_EXPR_ARG (exp, z));
|
||||
exp = build_call_vec (TREE_TYPE (exp), CALL_EXPR_FN (exp), vec);
|
||||
break;
|
||||
}
|
||||
|
@ -11206,10 +11206,10 @@ build_call_expr_loc_array (location_t loc, tree fndecl, int n, tree *argarray)
|
|||
VEC. */
|
||||
|
||||
tree
|
||||
build_call_expr_loc_vec (location_t loc, tree fndecl, VEC(tree,gc) *vec)
|
||||
build_call_expr_loc_vec (location_t loc, tree fndecl, vec<tree, va_gc> *vec)
|
||||
{
|
||||
return build_call_expr_loc_array (loc, fndecl, VEC_length (tree, vec),
|
||||
VEC_address (tree, vec));
|
||||
return build_call_expr_loc_array (loc, fndecl, vec_safe_length (vec),
|
||||
vec_safe_address (vec));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1839,7 +1839,7 @@ strict_aliasing_warning (tree otype, tree type, tree expr)
|
|||
|
||||
void
|
||||
sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
|
||||
VEC(tree, gc) *params, tree *sizeof_arg,
|
||||
vec<tree, va_gc> *params, tree *sizeof_arg,
|
||||
bool (*comp_types) (tree, tree))
|
||||
{
|
||||
tree type, dest = NULL_TREE, src = NULL_TREE, tem;
|
||||
|
@ -1849,7 +1849,7 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
|
|||
|
||||
if (TREE_CODE (callee) != FUNCTION_DECL
|
||||
|| DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL
|
||||
|| VEC_length (tree, params) <= 1)
|
||||
|| vec_safe_length (params) <= 1)
|
||||
return;
|
||||
|
||||
switch (DECL_FUNCTION_CODE (callee))
|
||||
|
@ -1870,55 +1870,55 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
|
|||
case BUILT_IN_MEMCPY_CHK:
|
||||
case BUILT_IN_MEMMOVE:
|
||||
case BUILT_IN_MEMMOVE_CHK:
|
||||
if (VEC_length (tree, params) < 3)
|
||||
if (params->length () < 3)
|
||||
return;
|
||||
src = VEC_index (tree, params, 1);
|
||||
dest = VEC_index (tree, params, 0);
|
||||
src = (*params)[1];
|
||||
dest = (*params)[0];
|
||||
idx = 2;
|
||||
break;
|
||||
case BUILT_IN_BCOPY:
|
||||
if (VEC_length (tree, params) < 3)
|
||||
if (params->length () < 3)
|
||||
return;
|
||||
src = VEC_index (tree, params, 0);
|
||||
dest = VEC_index (tree, params, 1);
|
||||
src = (*params)[0];
|
||||
dest = (*params)[1];
|
||||
idx = 2;
|
||||
break;
|
||||
case BUILT_IN_MEMCMP:
|
||||
case BUILT_IN_BCMP:
|
||||
if (VEC_length (tree, params) < 3)
|
||||
if (params->length () < 3)
|
||||
return;
|
||||
src = VEC_index (tree, params, 1);
|
||||
dest = VEC_index (tree, params, 0);
|
||||
src = (*params)[1];
|
||||
dest = (*params)[0];
|
||||
idx = 2;
|
||||
cmp = true;
|
||||
break;
|
||||
case BUILT_IN_MEMSET:
|
||||
case BUILT_IN_MEMSET_CHK:
|
||||
if (VEC_length (tree, params) < 3)
|
||||
if (params->length () < 3)
|
||||
return;
|
||||
dest = VEC_index (tree, params, 0);
|
||||
dest = (*params)[0];
|
||||
idx = 2;
|
||||
break;
|
||||
case BUILT_IN_BZERO:
|
||||
dest = VEC_index (tree, params, 0);
|
||||
dest = (*params)[0];
|
||||
idx = 1;
|
||||
break;
|
||||
case BUILT_IN_STRNDUP:
|
||||
src = VEC_index (tree, params, 0);
|
||||
src = (*params)[0];
|
||||
strop = true;
|
||||
idx = 1;
|
||||
break;
|
||||
case BUILT_IN_MEMCHR:
|
||||
if (VEC_length (tree, params) < 3)
|
||||
if (params->length () < 3)
|
||||
return;
|
||||
src = VEC_index (tree, params, 0);
|
||||
src = (*params)[0];
|
||||
idx = 2;
|
||||
break;
|
||||
case BUILT_IN_SNPRINTF:
|
||||
case BUILT_IN_SNPRINTF_CHK:
|
||||
case BUILT_IN_VSNPRINTF:
|
||||
case BUILT_IN_VSNPRINTF_CHK:
|
||||
dest = VEC_index (tree, params, 0);
|
||||
dest = (*params)[0];
|
||||
idx = 1;
|
||||
strop = true;
|
||||
break;
|
||||
|
@ -8729,9 +8729,7 @@ handle_target_attribute (tree *node, tree name, tree args, int flags,
|
|||
|
||||
/* Arguments being collected for optimization. */
|
||||
typedef const char *const_char_p; /* For DEF_VEC_P. */
|
||||
DEF_VEC_P(const_char_p);
|
||||
DEF_VEC_ALLOC_P(const_char_p, gc);
|
||||
static GTY(()) VEC(const_char_p, gc) *optimize_args;
|
||||
static GTY(()) vec<const_char_p, va_gc> *optimize_args;
|
||||
|
||||
|
||||
/* Inner function to convert a TREE_LIST to argv string to parse the optimize
|
||||
|
@ -8752,8 +8750,8 @@ parse_optimize_options (tree args, bool attr_p)
|
|||
|
||||
/* Build up argv vector. Just in case the string is stored away, use garbage
|
||||
collected strings. */
|
||||
VEC_truncate (const_char_p, optimize_args, 0);
|
||||
VEC_safe_push (const_char_p, gc, optimize_args, NULL);
|
||||
vec_safe_truncate (optimize_args, 0);
|
||||
vec_safe_push (optimize_args, (const char *) NULL);
|
||||
|
||||
for (ap = args; ap != NULL_TREE; ap = TREE_CHAIN (ap))
|
||||
{
|
||||
|
@ -8763,7 +8761,7 @@ parse_optimize_options (tree args, bool attr_p)
|
|||
{
|
||||
char buffer[20];
|
||||
sprintf (buffer, "-O%ld", (long) TREE_INT_CST_LOW (value));
|
||||
VEC_safe_push (const_char_p, gc, optimize_args, ggc_strdup (buffer));
|
||||
vec_safe_push (optimize_args, ggc_strdup (buffer));
|
||||
}
|
||||
|
||||
else if (TREE_CODE (value) == STRING_CST)
|
||||
|
@ -8825,17 +8823,17 @@ parse_optimize_options (tree args, bool attr_p)
|
|||
|
||||
memcpy (r, p, len2);
|
||||
r[len2] = '\0';
|
||||
VEC_safe_push (const_char_p, gc, optimize_args, q);
|
||||
vec_safe_push (optimize_args, (const char *) q);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
opt_argc = VEC_length (const_char_p, optimize_args);
|
||||
opt_argc = optimize_args->length ();
|
||||
opt_argv = (const char **) alloca (sizeof (char *) * (opt_argc + 1));
|
||||
|
||||
for (i = 1; i < opt_argc; i++)
|
||||
opt_argv[i] = VEC_index (const_char_p, optimize_args, i);
|
||||
opt_argv[i] = (*optimize_args)[i];
|
||||
|
||||
saved_flag_strict_aliasing = flag_strict_aliasing;
|
||||
|
||||
|
@ -8852,7 +8850,7 @@ parse_optimize_options (tree args, bool attr_p)
|
|||
/* Don't allow changing -fstrict-aliasing. */
|
||||
flag_strict_aliasing = saved_flag_strict_aliasing;
|
||||
|
||||
VEC_truncate (const_char_p, optimize_args, 0);
|
||||
optimize_args->truncate (0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -9736,9 +9734,9 @@ complete_array_type (tree *ptype, tree initial_value, bool do_default)
|
|||
}
|
||||
else if (TREE_CODE (initial_value) == CONSTRUCTOR)
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (initial_value);
|
||||
vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (initial_value);
|
||||
|
||||
if (VEC_empty (constructor_elt, v))
|
||||
if (vec_safe_is_empty (v))
|
||||
{
|
||||
if (pedantic)
|
||||
failure = 3;
|
||||
|
@ -9751,15 +9749,12 @@ complete_array_type (tree *ptype, tree initial_value, bool do_default)
|
|||
constructor_elt *ce;
|
||||
bool fold_p = false;
|
||||
|
||||
if (VEC_index (constructor_elt, v, 0).index)
|
||||
if ((*v)[0].index)
|
||||
maxindex = fold_convert_loc (input_location, sizetype,
|
||||
VEC_index (constructor_elt,
|
||||
v, 0).index);
|
||||
(*v)[0].index);
|
||||
curindex = maxindex;
|
||||
|
||||
for (cnt = 1;
|
||||
VEC_iterate (constructor_elt, v, cnt, ce);
|
||||
cnt++)
|
||||
for (cnt = 1; vec_safe_iterate (v, cnt, &ce); cnt++)
|
||||
{
|
||||
bool curfold_p = false;
|
||||
if (ce->index)
|
||||
|
@ -9879,18 +9874,18 @@ builtin_type_for_size (int size, bool unsignedp)
|
|||
Returns 0 if an error is encountered. */
|
||||
|
||||
static int
|
||||
sync_resolve_size (tree function, VEC(tree,gc) *params)
|
||||
sync_resolve_size (tree function, vec<tree, va_gc> *params)
|
||||
{
|
||||
tree type;
|
||||
int size;
|
||||
|
||||
if (VEC_empty (tree, params))
|
||||
if (!params)
|
||||
{
|
||||
error ("too few arguments to function %qE", function);
|
||||
return 0;
|
||||
}
|
||||
|
||||
type = TREE_TYPE (VEC_index (tree, params, 0));
|
||||
type = TREE_TYPE ((*params)[0]);
|
||||
if (TREE_CODE (type) != POINTER_TYPE)
|
||||
goto incompatible;
|
||||
|
||||
|
@ -9914,7 +9909,7 @@ sync_resolve_size (tree function, VEC(tree,gc) *params)
|
|||
|
||||
static bool
|
||||
sync_resolve_params (location_t loc, tree orig_function, tree function,
|
||||
VEC(tree, gc) *params, bool orig_format)
|
||||
vec<tree, va_gc> *params, bool orig_format)
|
||||
{
|
||||
function_args_iterator iter;
|
||||
tree ptype;
|
||||
|
@ -9925,7 +9920,7 @@ sync_resolve_params (location_t loc, tree orig_function, tree function,
|
|||
as the pointer parameter, so we shouldn't get any complaints from the
|
||||
call to check_function_arguments what ever type the user used. */
|
||||
function_args_iter_next (&iter);
|
||||
ptype = TREE_TYPE (TREE_TYPE (VEC_index (tree, params, 0)));
|
||||
ptype = TREE_TYPE (TREE_TYPE ((*params)[0]));
|
||||
|
||||
/* For the rest of the values, we need to cast these to FTYPE, so that we
|
||||
don't get warnings for passing pointer types, etc. */
|
||||
|
@ -9940,7 +9935,7 @@ sync_resolve_params (location_t loc, tree orig_function, tree function,
|
|||
break;
|
||||
|
||||
++parmnum;
|
||||
if (VEC_length (tree, params) <= parmnum)
|
||||
if (params->length () <= parmnum)
|
||||
{
|
||||
error_at (loc, "too few arguments to function %qE", orig_function);
|
||||
return false;
|
||||
|
@ -9956,17 +9951,17 @@ sync_resolve_params (location_t loc, tree orig_function, tree function,
|
|||
/* Ideally for the first conversion we'd use convert_for_assignment
|
||||
so that we get warnings for anything that doesn't match the pointer
|
||||
type. This isn't portable across the C and C++ front ends atm. */
|
||||
val = VEC_index (tree, params, parmnum);
|
||||
val = (*params)[parmnum];
|
||||
val = convert (ptype, val);
|
||||
val = convert (arg_type, val);
|
||||
VEC_replace (tree, params, parmnum, val);
|
||||
(*params)[parmnum] = val;
|
||||
}
|
||||
|
||||
function_args_iter_next (&iter);
|
||||
}
|
||||
|
||||
/* __atomic routines are not variadic. */
|
||||
if (!orig_format && VEC_length (tree, params) != parmnum + 1)
|
||||
if (!orig_format && params->length () != parmnum + 1)
|
||||
{
|
||||
error_at (loc, "too many arguments to function %qE", orig_function);
|
||||
return false;
|
||||
|
@ -9976,7 +9971,7 @@ sync_resolve_params (location_t loc, tree orig_function, tree function,
|
|||
being "an optional list of variables protected by the memory barrier".
|
||||
No clue what that's supposed to mean, precisely, but we consider all
|
||||
call-clobbered variables to be protected so we're safe. */
|
||||
VEC_truncate (tree, params, parmnum + 1);
|
||||
params->truncate (parmnum + 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -10004,7 +9999,8 @@ sync_resolve_return (tree first_param, tree result, bool orig_format)
|
|||
0 is returned if the parameters are invalid. */
|
||||
|
||||
static int
|
||||
get_atomic_generic_size (location_t loc, tree function, VEC(tree,gc) *params)
|
||||
get_atomic_generic_size (location_t loc, tree function,
|
||||
vec<tree, va_gc> *params)
|
||||
{
|
||||
unsigned int n_param;
|
||||
unsigned int n_model;
|
||||
|
@ -10032,14 +10028,14 @@ get_atomic_generic_size (location_t loc, tree function, VEC(tree,gc) *params)
|
|||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
if (VEC_length (tree, params) != n_param)
|
||||
if (vec_safe_length (params) != n_param)
|
||||
{
|
||||
error_at (loc, "incorrect number of arguments to function %qE", function);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Get type of first parameter, and determine its size. */
|
||||
type_0 = TREE_TYPE (VEC_index (tree, params, 0));
|
||||
type_0 = TREE_TYPE ((*params)[0]);
|
||||
if (TREE_CODE (type_0) != POINTER_TYPE || VOID_TYPE_P (TREE_TYPE (type_0)))
|
||||
{
|
||||
error_at (loc, "argument 1 of %qE must be a non-void pointer type",
|
||||
|
@ -10071,7 +10067,7 @@ get_atomic_generic_size (location_t loc, tree function, VEC(tree,gc) *params)
|
|||
for (x = 0; x < n_param - n_model; x++)
|
||||
{
|
||||
int size;
|
||||
tree type = TREE_TYPE (VEC_index (tree, params, x));
|
||||
tree type = TREE_TYPE ((*params)[x]);
|
||||
/* __atomic_compare_exchange has a bool in the 4th postion, skip it. */
|
||||
if (n_param == 6 && x == 3)
|
||||
continue;
|
||||
|
@ -10093,7 +10089,7 @@ get_atomic_generic_size (location_t loc, tree function, VEC(tree,gc) *params)
|
|||
/* Check memory model parameters for validity. */
|
||||
for (x = n_param - n_model ; x < n_param; x++)
|
||||
{
|
||||
tree p = VEC_index (tree, params, x);
|
||||
tree p = (*params)[x];
|
||||
if (TREE_CODE (p) == INTEGER_CST)
|
||||
{
|
||||
int i = tree_low_cst (p, 1);
|
||||
|
@ -10126,30 +10122,30 @@ get_atomic_generic_size (location_t loc, tree function, VEC(tree,gc) *params)
|
|||
|
||||
static tree
|
||||
add_atomic_size_parameter (unsigned n, location_t loc, tree function,
|
||||
VEC(tree,gc) *params)
|
||||
vec<tree, va_gc> *params)
|
||||
{
|
||||
tree size_node;
|
||||
|
||||
/* Insert a SIZE_T parameter as the first param. If there isn't
|
||||
enough space, allocate a new vector and recursively re-build with that. */
|
||||
if (!VEC_space (tree, params, 1))
|
||||
if (!params->space (1))
|
||||
{
|
||||
unsigned int z, len;
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *v;
|
||||
tree f;
|
||||
|
||||
len = VEC_length (tree, params);
|
||||
vec = VEC_alloc (tree, gc, len + 1);
|
||||
len = params->length ();
|
||||
vec_alloc (v, len + 1);
|
||||
for (z = 0; z < len; z++)
|
||||
VEC_quick_push (tree, vec, VEC_index (tree, params, z));
|
||||
f = build_function_call_vec (loc, function, vec, NULL);
|
||||
VEC_free (tree, gc, vec);
|
||||
v->quick_push ((*params)[z]);
|
||||
f = build_function_call_vec (loc, function, v, NULL);
|
||||
vec_free (v);
|
||||
return f;
|
||||
}
|
||||
|
||||
/* Add the size parameter and leave as a function call for processing. */
|
||||
size_node = build_int_cst (size_type_node, n);
|
||||
VEC_quick_insert (tree, params, 0, size_node);
|
||||
params->quick_insert (0, size_node);
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
@ -10165,7 +10161,7 @@ add_atomic_size_parameter (unsigned n, location_t loc, tree function,
|
|||
NEW_RETURN is set to the the return value the result is copied into. */
|
||||
static bool
|
||||
resolve_overloaded_atomic_exchange (location_t loc, tree function,
|
||||
VEC(tree,gc) *params, tree *new_return)
|
||||
vec<tree, va_gc> *params, tree *new_return)
|
||||
{
|
||||
tree p0, p1, p2, p3;
|
||||
tree I_type, I_type_ptr;
|
||||
|
@ -10190,10 +10186,10 @@ resolve_overloaded_atomic_exchange (location_t loc, tree function,
|
|||
into
|
||||
*return = (T) (fn (In* mem, (In) *desired, model)) */
|
||||
|
||||
p0 = VEC_index (tree, params, 0);
|
||||
p1 = VEC_index (tree, params, 1);
|
||||
p2 = VEC_index (tree, params, 2);
|
||||
p3 = VEC_index (tree, params, 3);
|
||||
p0 = (*params)[0];
|
||||
p1 = (*params)[1];
|
||||
p2 = (*params)[2];
|
||||
p3 = (*params)[3];
|
||||
|
||||
/* Create pointer to appropriate size. */
|
||||
I_type = builtin_type_for_size (BITS_PER_UNIT * n, 1);
|
||||
|
@ -10201,15 +10197,15 @@ resolve_overloaded_atomic_exchange (location_t loc, tree function,
|
|||
|
||||
/* Convert object pointer to required type. */
|
||||
p0 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p0);
|
||||
VEC_replace (tree, params, 0, p0);
|
||||
(*params)[0] = p0;
|
||||
/* Convert new value to required type, and dereference it. */
|
||||
p1 = build_indirect_ref (loc, p1, RO_UNARY_STAR);
|
||||
p1 = build1 (VIEW_CONVERT_EXPR, I_type, p1);
|
||||
VEC_replace (tree, params, 1, p1);
|
||||
(*params)[1] = p1;
|
||||
|
||||
/* Move memory model to the 3rd position, and end param list. */
|
||||
VEC_replace (tree, params, 2, p3);
|
||||
VEC_truncate (tree, params, 3);
|
||||
(*params)[2] = p3;
|
||||
params->truncate (3);
|
||||
|
||||
/* Convert return pointer and dereference it for later assignment. */
|
||||
*new_return = build_indirect_ref (loc, p2, RO_UNARY_STAR);
|
||||
|
@ -10229,7 +10225,7 @@ resolve_overloaded_atomic_exchange (location_t loc, tree function,
|
|||
|
||||
static bool
|
||||
resolve_overloaded_atomic_compare_exchange (location_t loc, tree function,
|
||||
VEC(tree,gc) *params,
|
||||
vec<tree, va_gc> *params,
|
||||
tree *new_return)
|
||||
{
|
||||
tree p0, p1, p2;
|
||||
|
@ -10253,9 +10249,9 @@ resolve_overloaded_atomic_compare_exchange (location_t loc, tree function,
|
|||
there is no danger this will be done twice. */
|
||||
if (n > 0)
|
||||
{
|
||||
VEC_replace (tree, params, 3, VEC_index (tree, params, 4));
|
||||
VEC_replace (tree, params, 4, VEC_index (tree, params, 5));
|
||||
VEC_truncate (tree, params, 5);
|
||||
(*params)[3] = (*params)[4];
|
||||
(*params)[4] = (*params)[5];
|
||||
params->truncate (5);
|
||||
}
|
||||
*new_return = add_atomic_size_parameter (n, loc, function, params);
|
||||
return true;
|
||||
|
@ -10266,9 +10262,9 @@ resolve_overloaded_atomic_compare_exchange (location_t loc, tree function,
|
|||
into
|
||||
bool fn ((In *)mem, (In *)expected, (In) *desired, weak, succ, fail) */
|
||||
|
||||
p0 = VEC_index (tree, params, 0);
|
||||
p1 = VEC_index (tree, params, 1);
|
||||
p2 = VEC_index (tree, params, 2);
|
||||
p0 = (*params)[0];
|
||||
p1 = (*params)[1];
|
||||
p2 = (*params)[2];
|
||||
|
||||
/* Create pointer to appropriate size. */
|
||||
I_type = builtin_type_for_size (BITS_PER_UNIT * n, 1);
|
||||
|
@ -10276,16 +10272,16 @@ resolve_overloaded_atomic_compare_exchange (location_t loc, tree function,
|
|||
|
||||
/* Convert object pointer to required type. */
|
||||
p0 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p0);
|
||||
VEC_replace (tree, params, 0, p0);
|
||||
(*params)[0] = p0;
|
||||
|
||||
/* Convert expected pointer to required type. */
|
||||
p1 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p1);
|
||||
VEC_replace (tree, params, 1, p1);
|
||||
(*params)[1] = p1;
|
||||
|
||||
/* Convert desired value to required type, and dereference it. */
|
||||
p2 = build_indirect_ref (loc, p2, RO_UNARY_STAR);
|
||||
p2 = build1 (VIEW_CONVERT_EXPR, I_type, p2);
|
||||
VEC_replace (tree, params, 2, p2);
|
||||
(*params)[2] = p2;
|
||||
|
||||
/* The rest of the parameters are fine. NULL means no special return value
|
||||
processing.*/
|
||||
|
@ -10306,7 +10302,7 @@ resolve_overloaded_atomic_compare_exchange (location_t loc, tree function,
|
|||
|
||||
static bool
|
||||
resolve_overloaded_atomic_load (location_t loc, tree function,
|
||||
VEC(tree,gc) *params, tree *new_return)
|
||||
vec<tree, va_gc> *params, tree *new_return)
|
||||
{
|
||||
tree p0, p1, p2;
|
||||
tree I_type, I_type_ptr;
|
||||
|
@ -10331,9 +10327,9 @@ resolve_overloaded_atomic_load (location_t loc, tree function,
|
|||
into
|
||||
*return = (T) (fn ((In *) mem, model)) */
|
||||
|
||||
p0 = VEC_index (tree, params, 0);
|
||||
p1 = VEC_index (tree, params, 1);
|
||||
p2 = VEC_index (tree, params, 2);
|
||||
p0 = (*params)[0];
|
||||
p1 = (*params)[1];
|
||||
p2 = (*params)[2];
|
||||
|
||||
/* Create pointer to appropriate size. */
|
||||
I_type = builtin_type_for_size (BITS_PER_UNIT * n, 1);
|
||||
|
@ -10341,11 +10337,11 @@ resolve_overloaded_atomic_load (location_t loc, tree function,
|
|||
|
||||
/* Convert object pointer to required type. */
|
||||
p0 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p0);
|
||||
VEC_replace (tree, params, 0, p0);
|
||||
(*params)[0] = p0;
|
||||
|
||||
/* Move memory model to the 2nd position, and end param list. */
|
||||
VEC_replace (tree, params, 1, p2);
|
||||
VEC_truncate (tree, params, 2);
|
||||
(*params)[1] = p2;
|
||||
params->truncate (2);
|
||||
|
||||
/* Convert return pointer and dereference it for later assignment. */
|
||||
*new_return = build_indirect_ref (loc, p1, RO_UNARY_STAR);
|
||||
|
@ -10366,7 +10362,7 @@ resolve_overloaded_atomic_load (location_t loc, tree function,
|
|||
|
||||
static bool
|
||||
resolve_overloaded_atomic_store (location_t loc, tree function,
|
||||
VEC(tree,gc) *params, tree *new_return)
|
||||
vec<tree, va_gc> *params, tree *new_return)
|
||||
{
|
||||
tree p0, p1;
|
||||
tree I_type, I_type_ptr;
|
||||
|
@ -10391,8 +10387,8 @@ resolve_overloaded_atomic_store (location_t loc, tree function,
|
|||
into
|
||||
fn ((In *) mem, (In) *value, model) */
|
||||
|
||||
p0 = VEC_index (tree, params, 0);
|
||||
p1 = VEC_index (tree, params, 1);
|
||||
p0 = (*params)[0];
|
||||
p1 = (*params)[1];
|
||||
|
||||
/* Create pointer to appropriate size. */
|
||||
I_type = builtin_type_for_size (BITS_PER_UNIT * n, 1);
|
||||
|
@ -10400,12 +10396,12 @@ resolve_overloaded_atomic_store (location_t loc, tree function,
|
|||
|
||||
/* Convert object pointer to required type. */
|
||||
p0 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p0);
|
||||
VEC_replace (tree, params, 0, p0);
|
||||
(*params)[0] = p0;
|
||||
|
||||
/* Convert new value to required type, and dereference it. */
|
||||
p1 = build_indirect_ref (loc, p1, RO_UNARY_STAR);
|
||||
p1 = build1 (VIEW_CONVERT_EXPR, I_type, p1);
|
||||
VEC_replace (tree, params, 1, p1);
|
||||
(*params)[1] = p1;
|
||||
|
||||
/* The memory model is in the right spot already. Return is void. */
|
||||
*new_return = NULL_TREE;
|
||||
|
@ -10426,7 +10422,8 @@ resolve_overloaded_atomic_store (location_t loc, tree function,
|
|||
continue. */
|
||||
|
||||
tree
|
||||
resolve_overloaded_builtin (location_t loc, tree function, VEC(tree,gc) *params)
|
||||
resolve_overloaded_builtin (location_t loc, tree function,
|
||||
vec<tree, va_gc> *params)
|
||||
{
|
||||
enum built_in_function orig_code = DECL_FUNCTION_CODE (function);
|
||||
bool orig_format = true;
|
||||
|
@ -10550,7 +10547,7 @@ resolve_overloaded_builtin (location_t loc, tree function, VEC(tree,gc) *params)
|
|||
orig_format))
|
||||
return error_mark_node;
|
||||
|
||||
first_param = VEC_index (tree, params, 0);
|
||||
first_param = (*params)[0];
|
||||
result = build_function_call_vec (loc, new_function, params, NULL);
|
||||
if (result == error_mark_node)
|
||||
return result;
|
||||
|
@ -11097,9 +11094,9 @@ record_types_used_by_current_var_decl (tree decl)
|
|||
{
|
||||
gcc_assert (decl && DECL_P (decl) && TREE_STATIC (decl));
|
||||
|
||||
while (!VEC_empty (tree, types_used_by_cur_var_decl))
|
||||
while (types_used_by_cur_var_decl && !types_used_by_cur_var_decl->is_empty ())
|
||||
{
|
||||
tree type = VEC_pop (tree, types_used_by_cur_var_decl);
|
||||
tree type = types_used_by_cur_var_decl->pop ();
|
||||
types_used_by_var_decl_insert (type, decl);
|
||||
}
|
||||
}
|
||||
|
@ -11121,7 +11118,7 @@ record_locally_defined_typedef (tree decl)
|
|||
return;
|
||||
|
||||
l = (struct c_language_function *) cfun->language;
|
||||
VEC_safe_push (tree, gc, l->local_typedefs, decl);
|
||||
vec_safe_push (l->local_typedefs, decl);
|
||||
}
|
||||
|
||||
/* If T is a TYPE_DECL declared locally, mark it as used. */
|
||||
|
@ -11159,7 +11156,7 @@ maybe_warn_unused_local_typedefs (void)
|
|||
if (warn_unused_local_typedefs
|
||||
&& errorcount == unused_local_typedefs_warn_count)
|
||||
{
|
||||
FOR_EACH_VEC_ELT (tree, l->local_typedefs, i, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT (l->local_typedefs, i, decl)
|
||||
if (!TREE_USED (decl))
|
||||
warning_at (DECL_SOURCE_LOCATION (decl),
|
||||
OPT_Wunused_local_typedefs,
|
||||
|
@ -11167,86 +11164,82 @@ maybe_warn_unused_local_typedefs (void)
|
|||
unused_local_typedefs_warn_count = errorcount;
|
||||
}
|
||||
|
||||
if (l->local_typedefs)
|
||||
{
|
||||
VEC_free (tree, gc, l->local_typedefs);
|
||||
l->local_typedefs = NULL;
|
||||
}
|
||||
vec_free (l->local_typedefs);
|
||||
}
|
||||
|
||||
/* The C and C++ parsers both use vectors to hold function arguments.
|
||||
For efficiency, we keep a cache of unused vectors. This is the
|
||||
cache. */
|
||||
|
||||
typedef VEC(tree,gc)* tree_gc_vec;
|
||||
DEF_VEC_P(tree_gc_vec);
|
||||
DEF_VEC_ALLOC_P(tree_gc_vec,gc);
|
||||
static GTY((deletable)) VEC(tree_gc_vec,gc) *tree_vector_cache;
|
||||
typedef vec<tree, va_gc> *tree_gc_vec;
|
||||
static GTY((deletable)) vec<tree_gc_vec, va_gc> *tree_vector_cache;
|
||||
|
||||
/* Return a new vector from the cache. If the cache is empty,
|
||||
allocate a new vector. These vectors are GC'ed, so it is OK if the
|
||||
pointer is not released.. */
|
||||
|
||||
VEC(tree,gc) *
|
||||
vec<tree, va_gc> *
|
||||
make_tree_vector (void)
|
||||
{
|
||||
if (!VEC_empty (tree_gc_vec, tree_vector_cache))
|
||||
return VEC_pop (tree_gc_vec, tree_vector_cache);
|
||||
if (tree_vector_cache && !tree_vector_cache->is_empty ())
|
||||
return tree_vector_cache->pop ();
|
||||
else
|
||||
{
|
||||
/* Passing 0 to VEC_alloc returns NULL, and our callers require
|
||||
/* Passing 0 to vec::alloc returns NULL, and our callers require
|
||||
that we always return a non-NULL value. The vector code uses
|
||||
4 when growing a NULL vector, so we do too. */
|
||||
return VEC_alloc (tree, gc, 4);
|
||||
vec<tree, va_gc> *v;
|
||||
vec_alloc (v, 4);
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
/* Release a vector of trees back to the cache. */
|
||||
|
||||
void
|
||||
release_tree_vector (VEC(tree,gc) *vec)
|
||||
release_tree_vector (vec<tree, va_gc> *vec)
|
||||
{
|
||||
if (vec != NULL)
|
||||
{
|
||||
VEC_truncate (tree, vec, 0);
|
||||
VEC_safe_push (tree_gc_vec, gc, tree_vector_cache, vec);
|
||||
vec->truncate (0);
|
||||
vec_safe_push (tree_vector_cache, vec);
|
||||
}
|
||||
}
|
||||
|
||||
/* Get a new tree vector holding a single tree. */
|
||||
|
||||
VEC(tree,gc) *
|
||||
vec<tree, va_gc> *
|
||||
make_tree_vector_single (tree t)
|
||||
{
|
||||
VEC(tree,gc) *ret = make_tree_vector ();
|
||||
VEC_quick_push (tree, ret, t);
|
||||
vec<tree, va_gc> *ret = make_tree_vector ();
|
||||
ret->quick_push (t);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Get a new tree vector of the TREE_VALUEs of a TREE_LIST chain. */
|
||||
|
||||
VEC(tree,gc) *
|
||||
vec<tree, va_gc> *
|
||||
make_tree_vector_from_list (tree list)
|
||||
{
|
||||
VEC(tree,gc) *ret = make_tree_vector ();
|
||||
vec<tree, va_gc> *ret = make_tree_vector ();
|
||||
for (; list; list = TREE_CHAIN (list))
|
||||
VEC_safe_push (tree, gc, ret, TREE_VALUE (list));
|
||||
vec_safe_push (ret, TREE_VALUE (list));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Get a new tree vector which is a copy of an existing one. */
|
||||
|
||||
VEC(tree,gc) *
|
||||
make_tree_vector_copy (const VEC(tree,gc) *orig)
|
||||
vec<tree, va_gc> *
|
||||
make_tree_vector_copy (const vec<tree, va_gc> *orig)
|
||||
{
|
||||
VEC(tree,gc) *ret;
|
||||
vec<tree, va_gc> *ret;
|
||||
unsigned int ix;
|
||||
tree t;
|
||||
|
||||
ret = make_tree_vector ();
|
||||
VEC_reserve (tree, gc, ret, VEC_length (tree, orig));
|
||||
FOR_EACH_VEC_ELT (tree, orig, ix, t)
|
||||
VEC_quick_push (tree, ret, t);
|
||||
vec_safe_reserve (ret, vec_safe_length (orig));
|
||||
FOR_EACH_VEC_SAFE_ELT (orig, ix, t)
|
||||
ret->quick_push (t);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -486,7 +486,7 @@ typedef enum ref_operator {
|
|||
|
||||
struct GTY(()) stmt_tree_s {
|
||||
/* A stack of statement lists being collected. */
|
||||
VEC(tree,gc) *x_cur_stmt_list;
|
||||
vec<tree, va_gc> *x_cur_stmt_list;
|
||||
|
||||
/* In C++, Nonzero if we should treat statements as full
|
||||
expressions. In particular, this variable is non-zero if at the
|
||||
|
@ -512,20 +512,16 @@ struct GTY(()) c_language_function {
|
|||
|
||||
/* Vector of locally defined typedefs, for
|
||||
-Wunused-local-typedefs. */
|
||||
VEC(tree,gc) *local_typedefs;
|
||||
vec<tree, va_gc> *local_typedefs;
|
||||
};
|
||||
|
||||
#define stmt_list_stack (current_stmt_tree ()->x_cur_stmt_list)
|
||||
|
||||
/* When building a statement-tree, this is the current statement list
|
||||
being collected. We define it in this convoluted way, rather than
|
||||
using VEC_last, because it must be an lvalue. */
|
||||
being collected. */
|
||||
#define cur_stmt_list (stmt_list_stack->last ())
|
||||
|
||||
#define cur_stmt_list \
|
||||
(*(VEC_address (tree, stmt_list_stack) \
|
||||
+ VEC_length (tree, stmt_list_stack) - 1))
|
||||
|
||||
#define building_stmt_list_p() (!VEC_empty (tree, stmt_list_stack))
|
||||
#define building_stmt_list_p() (stmt_list_stack && !stmt_list_stack->is_empty())
|
||||
|
||||
/* Language-specific hooks. */
|
||||
|
||||
|
@ -759,7 +755,7 @@ extern void constant_expression_warning (tree);
|
|||
extern void constant_expression_error (tree);
|
||||
extern bool strict_aliasing_warning (tree, tree, tree);
|
||||
extern void sizeof_pointer_memaccess_warning (location_t *, tree,
|
||||
VEC(tree, gc) *, tree *,
|
||||
vec<tree, va_gc> *, tree *,
|
||||
bool (*) (tree, tree));
|
||||
extern void warnings_for_convert_and_check (tree, tree, tree);
|
||||
extern tree convert_and_check (tree, tree);
|
||||
|
@ -899,10 +895,10 @@ extern void c_do_switch_warnings (splay_tree, location_t, tree, tree);
|
|||
|
||||
extern tree build_function_call (location_t, tree, tree);
|
||||
|
||||
extern tree build_function_call_vec (location_t, tree,
|
||||
VEC(tree,gc) *, VEC(tree,gc) *);
|
||||
extern tree build_function_call_vec (location_t, tree, vec<tree, va_gc> *,
|
||||
vec<tree, va_gc> *);
|
||||
|
||||
extern tree resolve_overloaded_builtin (location_t, tree, VEC(tree,gc) *);
|
||||
extern tree resolve_overloaded_builtin (location_t, tree, vec<tree, va_gc> *);
|
||||
|
||||
extern tree finish_label_address_expr (tree, location_t);
|
||||
|
||||
|
@ -997,11 +993,11 @@ extern void set_underlying_type (tree);
|
|||
extern void record_locally_defined_typedef (tree);
|
||||
extern void maybe_record_typedef_use (tree);
|
||||
extern void maybe_warn_unused_local_typedefs (void);
|
||||
extern VEC(tree,gc) *make_tree_vector (void);
|
||||
extern void release_tree_vector (VEC(tree,gc) *);
|
||||
extern VEC(tree,gc) *make_tree_vector_single (tree);
|
||||
extern VEC(tree,gc) *make_tree_vector_from_list (tree);
|
||||
extern VEC(tree,gc) *make_tree_vector_copy (const VEC(tree,gc) *);
|
||||
extern vec<tree, va_gc> *make_tree_vector (void);
|
||||
extern void release_tree_vector (vec<tree, va_gc> *);
|
||||
extern vec<tree, va_gc> *make_tree_vector_single (tree);
|
||||
extern vec<tree, va_gc> *make_tree_vector_from_list (tree);
|
||||
extern vec<tree, va_gc> *make_tree_vector_copy (const vec<tree, va_gc> *);
|
||||
|
||||
/* In c-gimplify.c */
|
||||
extern void c_genericize (tree);
|
||||
|
|
|
@ -108,9 +108,9 @@ add_block_to_enclosing (tree block)
|
|||
unsigned i;
|
||||
tree enclosing;
|
||||
gimple bind;
|
||||
VEC(gimple, heap) *stack = gimple_bind_expr_stack ();
|
||||
vec<gimple> stack = gimple_bind_expr_stack ();
|
||||
|
||||
FOR_EACH_VEC_ELT (gimple, stack, i, bind)
|
||||
FOR_EACH_VEC_ELT (stack, i, bind)
|
||||
if (gimple_bind_block (bind))
|
||||
break;
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "tm_p.h" /* For REGISTER_TARGET_PRAGMAS (why is
|
||||
this not a target hook?). */
|
||||
#include "vec.h"
|
||||
#include "vecprim.h"
|
||||
#include "target.h"
|
||||
#include "diagnostic.h"
|
||||
#include "opts.h"
|
||||
|
@ -241,10 +240,8 @@ typedef struct GTY(()) pending_weak_d
|
|||
tree value;
|
||||
} pending_weak;
|
||||
|
||||
DEF_VEC_O(pending_weak);
|
||||
DEF_VEC_ALLOC_O(pending_weak,gc);
|
||||
|
||||
static GTY(()) VEC(pending_weak,gc) *pending_weaks;
|
||||
static GTY(()) vec<pending_weak, va_gc> *pending_weaks;
|
||||
|
||||
static void apply_pragma_weak (tree, tree);
|
||||
static void handle_pragma_weak (cpp_reader *);
|
||||
|
@ -294,11 +291,11 @@ maybe_apply_pragma_weak (tree decl)
|
|||
|
||||
id = DECL_ASSEMBLER_NAME (decl);
|
||||
|
||||
FOR_EACH_VEC_ELT (pending_weak, pending_weaks, i, pe)
|
||||
FOR_EACH_VEC_ELT (*pending_weaks, i, pe)
|
||||
if (id == pe->name)
|
||||
{
|
||||
apply_pragma_weak (decl, pe->value);
|
||||
VEC_unordered_remove (pending_weak, pending_weaks, i);
|
||||
pending_weaks->unordered_remove (i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -313,7 +310,10 @@ maybe_apply_pending_pragma_weaks (void)
|
|||
pending_weak *pe;
|
||||
symtab_node target;
|
||||
|
||||
FOR_EACH_VEC_ELT (pending_weak, pending_weaks, i, pe)
|
||||
if (!pending_weaks)
|
||||
return;
|
||||
|
||||
FOR_EACH_VEC_ELT (*pending_weaks, i, pe)
|
||||
{
|
||||
alias_id = pe->name;
|
||||
id = pe->value;
|
||||
|
@ -373,7 +373,7 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
|
|||
else
|
||||
{
|
||||
pending_weak pe = {name, value};
|
||||
VEC_safe_push (pending_weak, gc, pending_weaks, pe);
|
||||
vec_safe_push (pending_weaks, pe);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -414,10 +414,8 @@ typedef struct GTY(()) pending_redefinition_d {
|
|||
tree newname;
|
||||
} pending_redefinition;
|
||||
|
||||
DEF_VEC_O(pending_redefinition);
|
||||
DEF_VEC_ALLOC_O(pending_redefinition,gc);
|
||||
|
||||
static GTY(()) VEC(pending_redefinition,gc) *pending_redefine_extname;
|
||||
static GTY(()) vec<pending_redefinition, va_gc> *pending_redefine_extname;
|
||||
|
||||
static void handle_pragma_redefine_extname (cpp_reader *);
|
||||
|
||||
|
@ -488,7 +486,7 @@ add_to_renaming_pragma_list (tree oldname, tree newname)
|
|||
unsigned ix;
|
||||
pending_redefinition *p;
|
||||
|
||||
FOR_EACH_VEC_ELT (pending_redefinition, pending_redefine_extname, ix, p)
|
||||
FOR_EACH_VEC_SAFE_ELT (pending_redefine_extname, ix, p)
|
||||
if (oldname == p->oldname)
|
||||
{
|
||||
if (p->newname != newname)
|
||||
|
@ -498,7 +496,7 @@ add_to_renaming_pragma_list (tree oldname, tree newname)
|
|||
}
|
||||
|
||||
pending_redefinition e = {oldname, newname};
|
||||
VEC_safe_push (pending_redefinition, gc, pending_redefine_extname, e);
|
||||
vec_safe_push (pending_redefine_extname, e);
|
||||
}
|
||||
|
||||
/* The current prefix set by #pragma extern_prefix. */
|
||||
|
@ -532,7 +530,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname)
|
|||
"conflict with previous rename");
|
||||
|
||||
/* Take any pending redefine_extname off the list. */
|
||||
FOR_EACH_VEC_ELT (pending_redefinition, pending_redefine_extname, ix, p)
|
||||
FOR_EACH_VEC_SAFE_ELT (pending_redefine_extname, ix, p)
|
||||
if (DECL_NAME (decl) == p->oldname)
|
||||
{
|
||||
/* Only warn if there is a conflict. */
|
||||
|
@ -540,20 +538,18 @@ maybe_apply_renaming_pragma (tree decl, tree asmname)
|
|||
warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to "
|
||||
"conflict with previous rename");
|
||||
|
||||
VEC_unordered_remove (pending_redefinition,
|
||||
pending_redefine_extname, ix);
|
||||
pending_redefine_extname->unordered_remove (ix);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Find out if we have a pending #pragma redefine_extname. */
|
||||
FOR_EACH_VEC_ELT (pending_redefinition, pending_redefine_extname, ix, p)
|
||||
FOR_EACH_VEC_SAFE_ELT (pending_redefine_extname, ix, p)
|
||||
if (DECL_NAME (decl) == p->oldname)
|
||||
{
|
||||
tree newname = p->newname;
|
||||
VEC_unordered_remove (pending_redefinition,
|
||||
pending_redefine_extname, ix);
|
||||
pending_redefine_extname->unordered_remove (ix);
|
||||
|
||||
/* If we already have an asmname, #pragma redefine_extname is
|
||||
ignored (with a warning if it conflicts). */
|
||||
|
@ -600,7 +596,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname)
|
|||
|
||||
static void handle_pragma_visibility (cpp_reader *);
|
||||
|
||||
static VEC (int, heap) *visstack;
|
||||
static vec<int> visstack;
|
||||
|
||||
/* Push the visibility indicated by STR onto the top of the #pragma
|
||||
visibility stack. KIND is 0 for #pragma GCC visibility, 1 for
|
||||
|
@ -612,8 +608,7 @@ static VEC (int, heap) *visstack;
|
|||
void
|
||||
push_visibility (const char *str, int kind)
|
||||
{
|
||||
VEC_safe_push (int, heap, visstack,
|
||||
((int) default_visibility) | (kind << 8));
|
||||
visstack.safe_push (((int) default_visibility) | (kind << 8));
|
||||
if (!strcmp (str, "default"))
|
||||
default_visibility = VISIBILITY_DEFAULT;
|
||||
else if (!strcmp (str, "internal"))
|
||||
|
@ -633,14 +628,14 @@ push_visibility (const char *str, int kind)
|
|||
bool
|
||||
pop_visibility (int kind)
|
||||
{
|
||||
if (!VEC_length (int, visstack))
|
||||
if (!visstack.length ())
|
||||
return false;
|
||||
if ((VEC_last (int, visstack) >> 8) != kind)
|
||||
if ((visstack.last () >> 8) != kind)
|
||||
return false;
|
||||
default_visibility
|
||||
= (enum symbol_visibility) (VEC_pop (int, visstack) & 0xff);
|
||||
= (enum symbol_visibility) (visstack.pop () & 0xff);
|
||||
visibility_options.inpragma
|
||||
= VEC_length (int, visstack) != 0;
|
||||
= visstack.length () != 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1152,10 +1147,8 @@ handle_pragma_float_const_decimal64 (cpp_reader *ARG_UNUSED (dummy))
|
|||
}
|
||||
|
||||
/* A vector of registered pragma callbacks, which is never freed. */
|
||||
DEF_VEC_O (internal_pragma_handler);
|
||||
DEF_VEC_ALLOC_O (internal_pragma_handler, heap);
|
||||
|
||||
static VEC(internal_pragma_handler, heap) *registered_pragmas;
|
||||
static vec<internal_pragma_handler> registered_pragmas;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -1163,10 +1156,8 @@ typedef struct
|
|||
const char *name;
|
||||
} pragma_ns_name;
|
||||
|
||||
DEF_VEC_O (pragma_ns_name);
|
||||
DEF_VEC_ALLOC_O (pragma_ns_name, heap);
|
||||
|
||||
static VEC(pragma_ns_name, heap) *registered_pp_pragmas;
|
||||
static vec<pragma_ns_name> registered_pp_pragmas;
|
||||
|
||||
struct omp_pragma_def { const char *name; unsigned int id; };
|
||||
static const struct omp_pragma_def omp_pragmas[] = {
|
||||
|
@ -1202,13 +1193,10 @@ c_pp_lookup_pragma (unsigned int id, const char **space, const char **name)
|
|||
}
|
||||
|
||||
if (id >= PRAGMA_FIRST_EXTERNAL
|
||||
&& (id < PRAGMA_FIRST_EXTERNAL
|
||||
+ VEC_length (pragma_ns_name, registered_pp_pragmas)))
|
||||
&& (id < PRAGMA_FIRST_EXTERNAL + registered_pp_pragmas.length ()))
|
||||
{
|
||||
*space = VEC_index (pragma_ns_name, registered_pp_pragmas,
|
||||
id - PRAGMA_FIRST_EXTERNAL).space;
|
||||
*name = VEC_index (pragma_ns_name, registered_pp_pragmas,
|
||||
id - PRAGMA_FIRST_EXTERNAL).name;
|
||||
*space = registered_pp_pragmas[id - PRAGMA_FIRST_EXTERNAL].space;
|
||||
*name = registered_pp_pragmas[id - PRAGMA_FIRST_EXTERNAL].name;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1233,15 +1221,14 @@ c_register_pragma_1 (const char *space, const char *name,
|
|||
|
||||
ns_name.space = space;
|
||||
ns_name.name = name;
|
||||
VEC_safe_push (pragma_ns_name, heap, registered_pp_pragmas, ns_name);
|
||||
id = VEC_length (pragma_ns_name, registered_pp_pragmas);
|
||||
registered_pp_pragmas.safe_push (ns_name);
|
||||
id = registered_pp_pragmas.length ();
|
||||
id += PRAGMA_FIRST_EXTERNAL - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
VEC_safe_push (internal_pragma_handler, heap, registered_pragmas,
|
||||
ihandler);
|
||||
id = VEC_length (internal_pragma_handler, registered_pragmas);
|
||||
registered_pragmas.safe_push (ihandler);
|
||||
id = registered_pragmas.length ();
|
||||
id += PRAGMA_FIRST_EXTERNAL - 1;
|
||||
|
||||
/* The C++ front end allocates 6 bits in cp_token; the C front end
|
||||
|
@ -1331,7 +1318,7 @@ c_invoke_pragma_handler (unsigned int id)
|
|||
pragma_handler_2arg handler_2arg;
|
||||
|
||||
id -= PRAGMA_FIRST_EXTERNAL;
|
||||
ihandler = &VEC_index (internal_pragma_handler, registered_pragmas, id);
|
||||
ihandler = ®istered_pragmas[id];
|
||||
if (ihandler->extra_data)
|
||||
{
|
||||
handler_2arg = ihandler->handler.handler_2arg;
|
||||
|
|
|
@ -1662,7 +1662,7 @@ pp_c_expression_list (c_pretty_printer *pp, tree e)
|
|||
/* Print out V, which contains the elements of a constructor. */
|
||||
|
||||
void
|
||||
pp_c_constructor_elts (c_pretty_printer *pp, VEC(constructor_elt,gc) *v)
|
||||
pp_c_constructor_elts (c_pretty_printer *pp, vec<constructor_elt, va_gc> *v)
|
||||
{
|
||||
unsigned HOST_WIDE_INT ix;
|
||||
tree value;
|
||||
|
@ -1670,7 +1670,7 @@ pp_c_constructor_elts (c_pretty_printer *pp, VEC(constructor_elt,gc) *v)
|
|||
FOR_EACH_CONSTRUCTOR_VALUE (v, ix, value)
|
||||
{
|
||||
pp_expression (pp, value);
|
||||
if (ix != VEC_length (constructor_elt, v) - 1)
|
||||
if (ix != vec_safe_length (v) - 1)
|
||||
pp_separate_with (pp, ',');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ void pp_c_statement (c_pretty_printer *, tree);
|
|||
void pp_c_expression (c_pretty_printer *, tree);
|
||||
void pp_c_logical_or_expression (c_pretty_printer *, tree);
|
||||
void pp_c_expression_list (c_pretty_printer *, tree);
|
||||
void pp_c_constructor_elts (c_pretty_printer *, VEC(constructor_elt,gc) *);
|
||||
void pp_c_constructor_elts (c_pretty_printer *, vec<constructor_elt, va_gc> *);
|
||||
void pp_c_call_argument_list (c_pretty_printer *, tree);
|
||||
void pp_c_unary_expression (c_pretty_printer *, tree);
|
||||
void pp_c_cast_expression (c_pretty_printer *, tree);
|
||||
|
|
|
@ -37,7 +37,7 @@ push_stmt_list (void)
|
|||
{
|
||||
tree t;
|
||||
t = alloc_stmt_list ();
|
||||
VEC_safe_push (tree, gc, stmt_list_stack, t);
|
||||
vec_safe_push (stmt_list_stack, t);
|
||||
return t;
|
||||
}
|
||||
|
||||
|
@ -52,10 +52,10 @@ pop_stmt_list (tree t)
|
|||
nestings will be due to outstanding cleanups. */
|
||||
while (1)
|
||||
{
|
||||
u = VEC_pop (tree, stmt_list_stack);
|
||||
if (!VEC_empty (tree, stmt_list_stack))
|
||||
u = stmt_list_stack->pop ();
|
||||
if (!stmt_list_stack->is_empty ())
|
||||
{
|
||||
tree x = VEC_last (tree, stmt_list_stack);
|
||||
tree x = stmt_list_stack->last ();
|
||||
STATEMENT_LIST_HAS_LABEL (x) |= STATEMENT_LIST_HAS_LABEL (u);
|
||||
}
|
||||
if (t == u)
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
2012-11-16 Diego Novillo <dnovillo@google.com>
|
||||
|
||||
Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
|
||||
|
||||
* c-common.c: Use new vec API in vec.h.
|
||||
* c-common.h: Likewise.
|
||||
* c-gimplify.c: Likewise.
|
||||
* c-pragma.c: Likewise.
|
||||
* c-pretty-print.c: Likewise.
|
||||
* c-pretty-print.h: Likewise.
|
||||
* c-semantics.c: Likewise.
|
||||
* c-decl.c: Likewise.
|
||||
* c-parser.c: Likewise.
|
||||
* c-tree.h: Likewise.
|
||||
* c-typeck.c: Likewise.
|
||||
|
||||
2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
|
||||
PR c++/54930
|
||||
|
|
|
@ -286,8 +286,6 @@ struct GTY(()) c_goto_bindings {
|
|||
};
|
||||
|
||||
typedef struct c_goto_bindings *c_goto_bindings_p;
|
||||
DEF_VEC_P(c_goto_bindings_p);
|
||||
DEF_VEC_ALLOC_P(c_goto_bindings_p,gc);
|
||||
|
||||
/* The additional information we keep track of for a label binding.
|
||||
These fields are updated as scopes are popped. */
|
||||
|
@ -302,11 +300,11 @@ struct GTY(()) c_label_vars {
|
|||
warn if a goto branches to this label from later in the function.
|
||||
Decls are added to this list as scopes are popped. We only add
|
||||
the decls that matter. */
|
||||
VEC(tree,gc) *decls_in_scope;
|
||||
vec<tree, va_gc> *decls_in_scope;
|
||||
/* A list of goto statements to this label. This is only used for
|
||||
goto statements seen before the label was defined, so that we can
|
||||
issue appropriate warnings for them. */
|
||||
VEC(c_goto_bindings_p,gc) *gotos;
|
||||
vec<c_goto_bindings_p, va_gc> *gotos;
|
||||
};
|
||||
|
||||
/* Each c_scope structure describes the complete contents of one
|
||||
|
@ -496,11 +494,9 @@ static bool keep_next_level_flag;
|
|||
|
||||
static bool next_is_function_body;
|
||||
|
||||
/* A VEC of pointers to c_binding structures. */
|
||||
/* A vector of pointers to c_binding structures. */
|
||||
|
||||
typedef struct c_binding *c_binding_ptr;
|
||||
DEF_VEC_P(c_binding_ptr);
|
||||
DEF_VEC_ALLOC_P(c_binding_ptr,heap);
|
||||
|
||||
/* Information that we keep for a struct or union while it is being
|
||||
parsed. */
|
||||
|
@ -509,15 +505,15 @@ struct c_struct_parse_info
|
|||
{
|
||||
/* If warn_cxx_compat, a list of types defined within this
|
||||
struct. */
|
||||
VEC(tree,heap) *struct_types;
|
||||
vec<tree> struct_types;
|
||||
/* If warn_cxx_compat, a list of field names which have bindings,
|
||||
and which are defined in this struct, but which are not defined
|
||||
in any enclosing struct. This is used to clear the in_struct
|
||||
field of the c_bindings structure. */
|
||||
VEC(c_binding_ptr,heap) *fields;
|
||||
vec<c_binding_ptr> fields;
|
||||
/* If warn_cxx_compat, a list of typedef names used when defining
|
||||
fields in this struct. */
|
||||
VEC(tree,heap) *typedefs_seen;
|
||||
vec<tree> typedefs_seen;
|
||||
};
|
||||
|
||||
/* Information for the struct or union currently being parsed, or
|
||||
|
@ -1019,16 +1015,14 @@ update_label_decls (struct c_scope *scope)
|
|||
of B1, if any. Save it to issue a
|
||||
warning if needed. */
|
||||
if (decl_jump_unsafe (b1->decl))
|
||||
VEC_safe_push (tree, gc,
|
||||
label_vars->decls_in_scope,
|
||||
b1->decl);
|
||||
vec_safe_push(label_vars->decls_in_scope, b1->decl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Update the bindings of any goto statements associated
|
||||
with this label. */
|
||||
FOR_EACH_VEC_ELT (c_goto_bindings_p, label_vars->gotos, ix, g)
|
||||
FOR_EACH_VEC_SAFE_ELT (label_vars->gotos, ix, g)
|
||||
update_spot_bindings (scope, &g->goto_bindings);
|
||||
}
|
||||
}
|
||||
|
@ -1375,7 +1369,7 @@ c_bindings_start_stmt_expr (struct c_spot_bindings* switch_bindings)
|
|||
continue;
|
||||
label_vars = b->u.label;
|
||||
++label_vars->label_bindings.stmt_exprs;
|
||||
FOR_EACH_VEC_ELT (c_goto_bindings_p, label_vars->gotos, ix, g)
|
||||
FOR_EACH_VEC_SAFE_ELT (label_vars->gotos, ix, g)
|
||||
++g->goto_bindings.stmt_exprs;
|
||||
}
|
||||
}
|
||||
|
@ -1413,7 +1407,7 @@ c_bindings_end_stmt_expr (struct c_spot_bindings *switch_bindings)
|
|||
label_vars->label_bindings.left_stmt_expr = true;
|
||||
label_vars->label_bindings.stmt_exprs = 0;
|
||||
}
|
||||
FOR_EACH_VEC_ELT (c_goto_bindings_p, label_vars->gotos, ix, g)
|
||||
FOR_EACH_VEC_SAFE_ELT (label_vars->gotos, ix, g)
|
||||
{
|
||||
--g->goto_bindings.stmt_exprs;
|
||||
if (g->goto_bindings.stmt_exprs < 0)
|
||||
|
@ -3056,7 +3050,7 @@ make_label (location_t location, tree name, bool defining,
|
|||
label_vars->shadowed = NULL;
|
||||
set_spot_bindings (&label_vars->label_bindings, defining);
|
||||
label_vars->decls_in_scope = make_tree_vector ();
|
||||
label_vars->gotos = VEC_alloc (c_goto_bindings_p, gc, 0);
|
||||
label_vars->gotos = NULL;
|
||||
*p_label_vars = label_vars;
|
||||
|
||||
return label;
|
||||
|
@ -3153,7 +3147,7 @@ lookup_label_for_goto (location_t loc, tree name)
|
|||
g = ggc_alloc_c_goto_bindings ();
|
||||
g->loc = loc;
|
||||
set_spot_bindings (&g->goto_bindings, true);
|
||||
VEC_safe_push (c_goto_bindings_p, gc, label_vars->gotos, g);
|
||||
vec_safe_push (label_vars->gotos, g);
|
||||
return label;
|
||||
}
|
||||
|
||||
|
@ -3165,7 +3159,7 @@ lookup_label_for_goto (location_t loc, tree name)
|
|||
...
|
||||
goto lab;
|
||||
Issue a warning or error. */
|
||||
FOR_EACH_VEC_ELT (tree, label_vars->decls_in_scope, ix, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT (label_vars->decls_in_scope, ix, decl)
|
||||
warn_about_goto (loc, label, decl);
|
||||
|
||||
if (label_vars->label_bindings.left_stmt_expr)
|
||||
|
@ -3217,7 +3211,7 @@ check_earlier_gotos (tree label, struct c_label_vars* label_vars)
|
|||
unsigned int ix;
|
||||
struct c_goto_bindings *g;
|
||||
|
||||
FOR_EACH_VEC_ELT (c_goto_bindings_p, label_vars->gotos, ix, g)
|
||||
FOR_EACH_VEC_SAFE_ELT (label_vars->gotos, ix, g)
|
||||
{
|
||||
struct c_binding *b;
|
||||
struct c_scope *scope;
|
||||
|
@ -3267,7 +3261,7 @@ check_earlier_gotos (tree label, struct c_label_vars* label_vars)
|
|||
|
||||
/* Now that the label is defined, we will issue warnings about
|
||||
subsequent gotos to this label when we see them. */
|
||||
VEC_truncate (c_goto_bindings_p, label_vars->gotos, 0);
|
||||
vec_safe_truncate (label_vars->gotos, 0);
|
||||
label_vars->gotos = NULL;
|
||||
}
|
||||
|
||||
|
@ -3939,10 +3933,10 @@ add_flexible_array_elts_to_size (tree decl, tree init)
|
|||
{
|
||||
tree elt, type;
|
||||
|
||||
if (VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (init)))
|
||||
if (vec_safe_is_empty (CONSTRUCTOR_ELTS (init)))
|
||||
return;
|
||||
|
||||
elt = VEC_last (constructor_elt, CONSTRUCTOR_ELTS (init)).value;
|
||||
elt = CONSTRUCTOR_ELTS (init)->last ().value;
|
||||
type = TREE_TYPE (elt);
|
||||
if (TREE_CODE (type) == ARRAY_TYPE
|
||||
&& TYPE_SIZE (type) == NULL_TREE
|
||||
|
@ -4509,15 +4503,15 @@ finish_decl (tree decl, location_t init_loc, tree init,
|
|||
tree cleanup_id = TREE_VALUE (TREE_VALUE (attr));
|
||||
tree cleanup_decl = lookup_name (cleanup_id);
|
||||
tree cleanup;
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *v;
|
||||
|
||||
/* Build "cleanup(&decl)" for the destructor. */
|
||||
cleanup = build_unary_op (input_location, ADDR_EXPR, decl, 0);
|
||||
vec = VEC_alloc (tree, gc, 1);
|
||||
VEC_quick_push (tree, vec, cleanup);
|
||||
vec_alloc (v, 1);
|
||||
v->quick_push (cleanup);
|
||||
cleanup = build_function_call_vec (DECL_SOURCE_LOCATION (decl),
|
||||
cleanup_decl, vec, NULL);
|
||||
VEC_free (tree, gc, vec);
|
||||
cleanup_decl, v, NULL);
|
||||
vec_free (v);
|
||||
|
||||
/* Don't warn about decl unused; the cleanup uses it. */
|
||||
TREE_USED (decl) = 1;
|
||||
|
@ -5656,7 +5650,7 @@ grokdeclarator (const struct c_declarator *declarator,
|
|||
c_arg_tag *tag;
|
||||
unsigned ix;
|
||||
|
||||
FOR_EACH_VEC_ELT_REVERSE (c_arg_tag, arg_info->tags, ix, tag)
|
||||
FOR_EACH_VEC_SAFE_ELT_REVERSE (arg_info->tags, ix, tag)
|
||||
TYPE_CONTEXT (tag->type) = type;
|
||||
}
|
||||
break;
|
||||
|
@ -6398,7 +6392,7 @@ get_parm_info (bool ellipsis, tree expr)
|
|||
struct c_arg_info *arg_info = build_arg_info ();
|
||||
|
||||
tree parms = 0;
|
||||
VEC(c_arg_tag,gc) *tags = NULL;
|
||||
vec<c_arg_tag, va_gc> *tags = NULL;
|
||||
tree types = 0;
|
||||
tree others = 0;
|
||||
|
||||
|
@ -6523,7 +6517,7 @@ get_parm_info (bool ellipsis, tree expr)
|
|||
|
||||
tag.id = b->id;
|
||||
tag.type = decl;
|
||||
VEC_safe_push (c_arg_tag, gc, tags, tag);
|
||||
vec_safe_push (tags, tag);
|
||||
break;
|
||||
|
||||
case CONST_DECL:
|
||||
|
@ -6735,9 +6729,9 @@ start_struct (location_t loc, enum tree_code code, tree name,
|
|||
|
||||
*enclosing_struct_parse_info = struct_parse_info;
|
||||
struct_parse_info = XNEW (struct c_struct_parse_info);
|
||||
struct_parse_info->struct_types = VEC_alloc (tree, heap, 0);
|
||||
struct_parse_info->fields = VEC_alloc (c_binding_ptr, heap, 0);
|
||||
struct_parse_info->typedefs_seen = VEC_alloc (tree, heap, 0);
|
||||
struct_parse_info->struct_types.create (0);
|
||||
struct_parse_info->fields.create (0);
|
||||
struct_parse_info->typedefs_seen.create (0);
|
||||
|
||||
/* FIXME: This will issue a warning for a use of a type defined
|
||||
within a statement expr used within sizeof, et. al. This is not
|
||||
|
@ -6847,8 +6841,7 @@ grokfield (location_t loc,
|
|||
to be cleared when this struct is finished. */
|
||||
if (!b->in_struct)
|
||||
{
|
||||
VEC_safe_push (c_binding_ptr, heap,
|
||||
struct_parse_info->fields, b);
|
||||
struct_parse_info->fields.safe_push (b);
|
||||
b->in_struct = 1;
|
||||
}
|
||||
}
|
||||
|
@ -7028,7 +7021,7 @@ warn_cxx_compat_finish_struct (tree fieldlist)
|
|||
because the flag is used to issue visibility warnings, and we
|
||||
only want to issue those warnings if the type is referenced
|
||||
outside of the struct declaration. */
|
||||
FOR_EACH_VEC_ELT (tree, struct_parse_info->struct_types, ix, x)
|
||||
FOR_EACH_VEC_ELT (struct_parse_info->struct_types, ix, x)
|
||||
C_TYPE_DEFINED_IN_STRUCT (x) = 1;
|
||||
|
||||
/* The TYPEDEFS_SEEN field of STRUCT_PARSE_INFO is a list of
|
||||
|
@ -7037,14 +7030,14 @@ warn_cxx_compat_finish_struct (tree fieldlist)
|
|||
not parse in C++, because the C++ lookup rules say that the
|
||||
typedef name would be looked up in the context of the struct, and
|
||||
would thus be the field rather than the typedef. */
|
||||
if (!VEC_empty (tree, struct_parse_info->typedefs_seen)
|
||||
if (!struct_parse_info->typedefs_seen.is_empty ()
|
||||
&& fieldlist != NULL_TREE)
|
||||
{
|
||||
/* Use a pointer_set using the name of the typedef. We can use
|
||||
a pointer_set because identifiers are interned. */
|
||||
struct pointer_set_t *tset = pointer_set_create ();
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, struct_parse_info->typedefs_seen, ix, x)
|
||||
FOR_EACH_VEC_ELT (struct_parse_info->typedefs_seen, ix, x)
|
||||
pointer_set_insert (tset, DECL_NAME (x));
|
||||
|
||||
for (x = fieldlist; x != NULL_TREE; x = DECL_CHAIN (x))
|
||||
|
@ -7066,7 +7059,7 @@ warn_cxx_compat_finish_struct (tree fieldlist)
|
|||
|
||||
/* For each field which has a binding and which was not defined in
|
||||
an enclosing struct, clear the in_struct field. */
|
||||
FOR_EACH_VEC_ELT (c_binding_ptr, struct_parse_info->fields, ix, b)
|
||||
FOR_EACH_VEC_ELT (struct_parse_info->fields, ix, b)
|
||||
b->in_struct = 0;
|
||||
}
|
||||
|
||||
|
@ -7353,9 +7346,9 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
|
|||
if (warn_cxx_compat)
|
||||
warn_cxx_compat_finish_struct (fieldlist);
|
||||
|
||||
VEC_free (tree, heap, struct_parse_info->struct_types);
|
||||
VEC_free (c_binding_ptr, heap, struct_parse_info->fields);
|
||||
VEC_free (tree, heap, struct_parse_info->typedefs_seen);
|
||||
struct_parse_info->struct_types.release ();
|
||||
struct_parse_info->fields.release ();
|
||||
struct_parse_info->typedefs_seen.release ();
|
||||
XDELETE (struct_parse_info);
|
||||
|
||||
struct_parse_info = enclosing_struct_parse_info;
|
||||
|
@ -7365,7 +7358,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
|
|||
if (warn_cxx_compat
|
||||
&& struct_parse_info != NULL
|
||||
&& !in_sizeof && !in_typeof && !in_alignof)
|
||||
VEC_safe_push (tree, heap, struct_parse_info->struct_types, t);
|
||||
struct_parse_info->struct_types.safe_push (t);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
@ -7583,7 +7576,7 @@ finish_enum (tree enumtype, tree values, tree attributes)
|
|||
if (warn_cxx_compat
|
||||
&& struct_parse_info != NULL
|
||||
&& !in_sizeof && !in_typeof && !in_alignof)
|
||||
VEC_safe_push (tree, heap, struct_parse_info->struct_types, enumtype);
|
||||
struct_parse_info->struct_types.safe_push (enumtype);
|
||||
|
||||
return enumtype;
|
||||
}
|
||||
|
@ -7981,7 +7974,7 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
|
|||
}
|
||||
|
||||
/* And all the tag declarations. */
|
||||
FOR_EACH_VEC_ELT_REVERSE (c_arg_tag, arg_info->tags, ix, tag)
|
||||
FOR_EACH_VEC_SAFE_ELT_REVERSE (arg_info->tags, ix, tag)
|
||||
if (tag->id)
|
||||
bind (tag->id, tag->type, current_scope,
|
||||
/*invisible=*/false, /*nested=*/false, UNKNOWN_LOCATION);
|
||||
|
@ -8598,8 +8591,7 @@ c_push_function_context (void)
|
|||
cfun->language = p = ggc_alloc_cleared_language_function ();
|
||||
|
||||
p->base.x_stmt_tree = c_stmt_tree;
|
||||
c_stmt_tree.x_cur_stmt_list
|
||||
= VEC_copy (tree, gc, c_stmt_tree.x_cur_stmt_list);
|
||||
c_stmt_tree.x_cur_stmt_list = vec_safe_copy (c_stmt_tree.x_cur_stmt_list);
|
||||
p->x_break_label = c_break_label;
|
||||
p->x_cont_label = c_cont_label;
|
||||
p->x_switch_stack = c_switch_stack;
|
||||
|
@ -9538,7 +9530,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs,
|
|||
/* If we are parsing a struct, record that a struct field
|
||||
used a typedef. */
|
||||
if (warn_cxx_compat && struct_parse_info != NULL)
|
||||
VEC_safe_push (tree, heap, struct_parse_info->typedefs_seen, type);
|
||||
struct_parse_info->typedefs_seen.safe_push (type);
|
||||
}
|
||||
}
|
||||
else if (TREE_CODE (type) == IDENTIFIER_NODE)
|
||||
|
@ -10040,7 +10032,7 @@ collect_all_refs (const char *source_file)
|
|||
tree t;
|
||||
unsigned i;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, all_translation_units, i, t)
|
||||
FOR_EACH_VEC_ELT (*all_translation_units, i, t)
|
||||
collect_ada_nodes (BLOCK_VARS (DECL_INITIAL (t)), source_file);
|
||||
|
||||
collect_ada_nodes (BLOCK_VARS (ext_block), source_file);
|
||||
|
@ -10056,7 +10048,7 @@ for_each_global_decl (void (*callback) (tree decl))
|
|||
tree decl;
|
||||
unsigned i;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, all_translation_units, i, t)
|
||||
FOR_EACH_VEC_ELT (*all_translation_units, i, t)
|
||||
{
|
||||
decls = DECL_INITIAL (t);
|
||||
for (decl = BLOCK_VARS (decls); decl; decl = TREE_CHAIN (decl))
|
||||
|
@ -10116,7 +10108,7 @@ c_write_global_declarations (void)
|
|||
|
||||
/* Process all file scopes in this compilation, and the external_scope,
|
||||
through wrapup_global_declarations and check_global_declarations. */
|
||||
FOR_EACH_VEC_ELT (tree, all_translation_units, i, t)
|
||||
FOR_EACH_VEC_ELT (*all_translation_units, i, t)
|
||||
c_write_global_declarations_1 (BLOCK_VARS (DECL_INITIAL (t)));
|
||||
c_write_global_declarations_1 (BLOCK_VARS (ext_block));
|
||||
|
||||
|
@ -10135,7 +10127,7 @@ c_write_global_declarations (void)
|
|||
if (!seen_error ())
|
||||
{
|
||||
timevar_push (TV_SYMOUT);
|
||||
FOR_EACH_VEC_ELT (tree, all_translation_units, i, t)
|
||||
FOR_EACH_VEC_ELT (*all_translation_units, i, t)
|
||||
c_write_global_declarations_2 (BLOCK_VARS (DECL_INITIAL (t)));
|
||||
c_write_global_declarations_2 (BLOCK_VARS (ext_block));
|
||||
timevar_pop (TV_SYMOUT);
|
||||
|
|
|
@ -1178,9 +1178,9 @@ static struct c_expr c_parser_transaction_expression (c_parser *, enum rid);
|
|||
static tree c_parser_transaction_cancel (c_parser *);
|
||||
static struct c_expr c_parser_expression (c_parser *);
|
||||
static struct c_expr c_parser_expression_conv (c_parser *);
|
||||
static VEC(tree,gc) *c_parser_expr_list (c_parser *, bool, bool,
|
||||
VEC(tree,gc) **, location_t *,
|
||||
tree *);
|
||||
static vec<tree, va_gc> *c_parser_expr_list (c_parser *, bool, bool,
|
||||
vec<tree, va_gc> **, location_t *,
|
||||
tree *);
|
||||
static void c_parser_omp_construct (c_parser *);
|
||||
static void c_parser_omp_threadprivate (c_parser *);
|
||||
static void c_parser_omp_barrier (c_parser *);
|
||||
|
@ -3540,7 +3540,7 @@ c_parser_attributes (c_parser *parser)
|
|||
|| c_parser_next_token_is (parser, CPP_KEYWORD))
|
||||
{
|
||||
tree attr, attr_name, attr_args;
|
||||
VEC(tree,gc) *expr_list;
|
||||
vec<tree, va_gc> *expr_list;
|
||||
if (c_parser_next_token_is (parser, CPP_COMMA))
|
||||
{
|
||||
c_parser_consume_token (parser);
|
||||
|
@ -6123,10 +6123,10 @@ c_parser_alignof_expression (c_parser *parser)
|
|||
stores the arguments in CEXPR_LIST. */
|
||||
static bool
|
||||
c_parser_get_builtin_args (c_parser *parser, const char *bname,
|
||||
VEC(c_expr_t,gc) **ret_cexpr_list)
|
||||
vec<c_expr_t, va_gc> **ret_cexpr_list)
|
||||
{
|
||||
location_t loc = c_parser_peek_token (parser)->location;
|
||||
VEC (c_expr_t,gc) *cexpr_list;
|
||||
vec<c_expr_t, va_gc> *cexpr_list;
|
||||
c_expr_t expr;
|
||||
|
||||
*ret_cexpr_list = NULL;
|
||||
|
@ -6145,7 +6145,7 @@ c_parser_get_builtin_args (c_parser *parser, const char *bname,
|
|||
}
|
||||
|
||||
expr = c_parser_expr_no_commas (parser, NULL);
|
||||
cexpr_list = VEC_alloc (c_expr_t, gc, 1);
|
||||
vec_alloc (cexpr_list, 1);
|
||||
C_EXPR_APPEND (cexpr_list, expr);
|
||||
while (c_parser_next_token_is (parser, CPP_COMMA))
|
||||
{
|
||||
|
@ -6511,7 +6511,7 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
break;
|
||||
case RID_CHOOSE_EXPR:
|
||||
{
|
||||
VEC (c_expr_t, gc) *cexpr_list;
|
||||
vec<c_expr_t, va_gc> *cexpr_list;
|
||||
c_expr_t *e1_p, *e2_p, *e3_p;
|
||||
tree c;
|
||||
|
||||
|
@ -6524,7 +6524,7 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
break;
|
||||
}
|
||||
|
||||
if (VEC_length (c_expr_t, cexpr_list) != 3)
|
||||
if (vec_safe_length (cexpr_list) != 3)
|
||||
{
|
||||
error_at (loc, "wrong number of arguments to "
|
||||
"%<__builtin_choose_expr%>");
|
||||
|
@ -6532,9 +6532,9 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
break;
|
||||
}
|
||||
|
||||
e1_p = &VEC_index (c_expr_t, cexpr_list, 0);
|
||||
e2_p = &VEC_index (c_expr_t, cexpr_list, 1);
|
||||
e3_p = &VEC_index (c_expr_t, cexpr_list, 2);
|
||||
e1_p = &(*cexpr_list)[0];
|
||||
e2_p = &(*cexpr_list)[1];
|
||||
e3_p = &(*cexpr_list)[2];
|
||||
|
||||
c = e1_p->value;
|
||||
mark_exp_read (e2_p->value);
|
||||
|
@ -6594,7 +6594,7 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
break;
|
||||
case RID_BUILTIN_COMPLEX:
|
||||
{
|
||||
VEC(c_expr_t, gc) *cexpr_list;
|
||||
vec<c_expr_t, va_gc> *cexpr_list;
|
||||
c_expr_t *e1_p, *e2_p;
|
||||
|
||||
c_parser_consume_token (parser);
|
||||
|
@ -6606,7 +6606,7 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
break;
|
||||
}
|
||||
|
||||
if (VEC_length (c_expr_t, cexpr_list) != 2)
|
||||
if (vec_safe_length (cexpr_list) != 2)
|
||||
{
|
||||
error_at (loc, "wrong number of arguments to "
|
||||
"%<__builtin_complex%>");
|
||||
|
@ -6614,8 +6614,8 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
break;
|
||||
}
|
||||
|
||||
e1_p = &VEC_index (c_expr_t, cexpr_list, 0);
|
||||
e2_p = &VEC_index (c_expr_t, cexpr_list, 1);
|
||||
e1_p = &(*cexpr_list)[0];
|
||||
e2_p = &(*cexpr_list)[1];
|
||||
|
||||
mark_exp_read (e1_p->value);
|
||||
if (TREE_CODE (e1_p->value) == EXCESS_PRECISION_EXPR)
|
||||
|
@ -6655,7 +6655,7 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
}
|
||||
case RID_BUILTIN_SHUFFLE:
|
||||
{
|
||||
VEC(c_expr_t,gc) *cexpr_list;
|
||||
vec<c_expr_t, va_gc> *cexpr_list;
|
||||
unsigned int i;
|
||||
c_expr_t *p;
|
||||
|
||||
|
@ -6668,21 +6668,21 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
break;
|
||||
}
|
||||
|
||||
FOR_EACH_VEC_ELT (c_expr_t, cexpr_list, i, p)
|
||||
FOR_EACH_VEC_SAFE_ELT (cexpr_list, i, p)
|
||||
mark_exp_read (p->value);
|
||||
|
||||
if (VEC_length (c_expr_t, cexpr_list) == 2)
|
||||
if (vec_safe_length (cexpr_list) == 2)
|
||||
expr.value =
|
||||
c_build_vec_perm_expr
|
||||
(loc, VEC_index (c_expr_t, cexpr_list, 0).value,
|
||||
NULL_TREE, VEC_index (c_expr_t, cexpr_list, 1).value);
|
||||
(loc, (*cexpr_list)[0].value,
|
||||
NULL_TREE, (*cexpr_list)[1].value);
|
||||
|
||||
else if (VEC_length (c_expr_t, cexpr_list) == 3)
|
||||
else if (vec_safe_length (cexpr_list) == 3)
|
||||
expr.value =
|
||||
c_build_vec_perm_expr
|
||||
(loc, VEC_index (c_expr_t, cexpr_list, 0).value,
|
||||
VEC_index (c_expr_t, cexpr_list, 1).value,
|
||||
VEC_index (c_expr_t, cexpr_list, 2).value);
|
||||
(loc, (*cexpr_list)[0].value,
|
||||
(*cexpr_list)[1].value,
|
||||
(*cexpr_list)[2].value);
|
||||
else
|
||||
{
|
||||
error_at (loc, "wrong number of arguments to "
|
||||
|
@ -6872,8 +6872,8 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
|
|||
location_t sizeof_arg_loc[3];
|
||||
tree sizeof_arg[3];
|
||||
unsigned int i;
|
||||
VEC(tree,gc) *exprlist;
|
||||
VEC(tree,gc) *origtypes;
|
||||
vec<tree, va_gc> *exprlist;
|
||||
vec<tree, va_gc> *origtypes;
|
||||
while (true)
|
||||
{
|
||||
location_t op_loc = c_parser_peek_token (parser)->location;
|
||||
|
@ -6922,7 +6922,7 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
|
|||
&& DECL_FUNCTION_CODE (orig_expr.value) == BUILT_IN_CONSTANT_P)
|
||||
expr.original_code = C_MAYBE_CONST_EXPR;
|
||||
expr.original_type = NULL;
|
||||
if (exprlist != NULL)
|
||||
if (exprlist)
|
||||
{
|
||||
release_tree_vector (exprlist);
|
||||
release_tree_vector (origtypes);
|
||||
|
@ -7069,13 +7069,13 @@ c_parser_expression_conv (c_parser *parser)
|
|||
nonempty-expr-list , assignment-expression
|
||||
*/
|
||||
|
||||
static VEC(tree,gc) *
|
||||
static vec<tree, va_gc> *
|
||||
c_parser_expr_list (c_parser *parser, bool convert_p, bool fold_p,
|
||||
VEC(tree,gc) **p_orig_types, location_t *sizeof_arg_loc,
|
||||
tree *sizeof_arg)
|
||||
vec<tree, va_gc> **p_orig_types,
|
||||
location_t *sizeof_arg_loc, tree *sizeof_arg)
|
||||
{
|
||||
VEC(tree,gc) *ret;
|
||||
VEC(tree,gc) *orig_types;
|
||||
vec<tree, va_gc> *ret;
|
||||
vec<tree, va_gc> *orig_types;
|
||||
struct c_expr expr;
|
||||
location_t loc = c_parser_peek_token (parser)->location;
|
||||
location_t cur_sizeof_arg_loc = UNKNOWN_LOCATION;
|
||||
|
@ -7095,9 +7095,9 @@ c_parser_expr_list (c_parser *parser, bool convert_p, bool fold_p,
|
|||
expr = default_function_array_read_conversion (loc, expr);
|
||||
if (fold_p)
|
||||
expr.value = c_fully_fold (expr.value, false, NULL);
|
||||
VEC_quick_push (tree, ret, expr.value);
|
||||
if (orig_types != NULL)
|
||||
VEC_quick_push (tree, orig_types, expr.original_type);
|
||||
ret->quick_push (expr.value);
|
||||
if (orig_types)
|
||||
orig_types->quick_push (expr.original_type);
|
||||
if (sizeof_arg != NULL
|
||||
&& cur_sizeof_arg_loc != UNKNOWN_LOCATION
|
||||
&& expr.original_code == SIZEOF_EXPR)
|
||||
|
@ -7119,9 +7119,9 @@ c_parser_expr_list (c_parser *parser, bool convert_p, bool fold_p,
|
|||
expr = default_function_array_read_conversion (loc, expr);
|
||||
if (fold_p)
|
||||
expr.value = c_fully_fold (expr.value, false, NULL);
|
||||
VEC_safe_push (tree, gc, ret, expr.value);
|
||||
if (orig_types != NULL)
|
||||
VEC_safe_push (tree, gc, orig_types, expr.original_type);
|
||||
vec_safe_push (ret, expr.value);
|
||||
if (orig_types)
|
||||
vec_safe_push (orig_types, expr.original_type);
|
||||
if (++idx < 3
|
||||
&& sizeof_arg != NULL
|
||||
&& cur_sizeof_arg_loc != UNKNOWN_LOCATION
|
||||
|
@ -7131,7 +7131,7 @@ c_parser_expr_list (c_parser *parser, bool convert_p, bool fold_p,
|
|||
sizeof_arg_loc[idx] = cur_sizeof_arg_loc;
|
||||
}
|
||||
}
|
||||
if (orig_types != NULL)
|
||||
if (orig_types)
|
||||
*p_orig_types = orig_types;
|
||||
return ret;
|
||||
}
|
||||
|
@ -8209,13 +8209,13 @@ static tree
|
|||
c_parser_objc_keywordexpr (c_parser *parser)
|
||||
{
|
||||
tree ret;
|
||||
VEC(tree,gc) *expr_list = c_parser_expr_list (parser, true, true,
|
||||
vec<tree, va_gc> *expr_list = c_parser_expr_list (parser, true, true,
|
||||
NULL, NULL, NULL);
|
||||
if (VEC_length (tree, expr_list) == 1)
|
||||
if (vec_safe_length (expr_list) == 1)
|
||||
{
|
||||
/* Just return the expression, remove a level of
|
||||
indirection. */
|
||||
ret = VEC_index (tree, expr_list, 0);
|
||||
ret = (*expr_list)[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -9923,7 +9923,7 @@ c_parser_omp_for_loop (location_t loc,
|
|||
bool fail = false, open_brace_parsed = false;
|
||||
int i, collapse = 1, nbraces = 0;
|
||||
location_t for_loc;
|
||||
VEC(tree,gc) *for_block = make_tree_vector ();
|
||||
vec<tree, va_gc> *for_block = make_tree_vector ();
|
||||
|
||||
for (cl = clauses; cl; cl = OMP_CLAUSE_CHAIN (cl))
|
||||
if (OMP_CLAUSE_CODE (cl) == OMP_CLAUSE_COLLAPSE)
|
||||
|
@ -9955,7 +9955,7 @@ c_parser_omp_for_loop (location_t loc,
|
|||
if (c_parser_next_tokens_start_declaration (parser))
|
||||
{
|
||||
if (i > 0)
|
||||
VEC_safe_push (tree, gc, for_block, c_begin_compound_stmt (true));
|
||||
vec_safe_push (for_block, c_begin_compound_stmt (true));
|
||||
c_parser_declaration_or_fndef (parser, true, true, true, true, true, NULL);
|
||||
decl = check_for_loop_decls (for_loc, flag_isoc99);
|
||||
if (decl == NULL)
|
||||
|
@ -10186,12 +10186,12 @@ c_parser_omp_for_loop (location_t loc,
|
|||
ret = stmt;
|
||||
}
|
||||
pop_scopes:
|
||||
while (!VEC_empty (tree, for_block))
|
||||
while (!for_block->is_empty ())
|
||||
{
|
||||
/* FIXME diagnostics: LOC below should be the actual location of
|
||||
this particular for block. We need to build a list of
|
||||
locations to go along with FOR_BLOCK. */
|
||||
stmt = c_end_compound_stmt (loc, VEC_pop (tree, for_block), true);
|
||||
stmt = c_end_compound_stmt (loc, for_block->pop (), true);
|
||||
add_stmt (stmt);
|
||||
}
|
||||
release_tree_vector (for_block);
|
||||
|
|
|
@ -135,15 +135,12 @@ struct c_expr
|
|||
typedef struct c_expr c_expr_t;
|
||||
|
||||
/* A varray of c_expr_t. */
|
||||
DEF_VEC_O (c_expr_t);
|
||||
DEF_VEC_ALLOC_O (c_expr_t, gc);
|
||||
DEF_VEC_ALLOC_O (c_expr_t, heap);
|
||||
|
||||
/* Append a new c_expr_t element to V. */
|
||||
#define C_EXPR_APPEND(V, ELEM) \
|
||||
do { \
|
||||
c_expr_t __elem = (ELEM); \
|
||||
VEC_safe_push (c_expr_t, gc, V, __elem); \
|
||||
vec_safe_push (V, __elem); \
|
||||
} while (0)
|
||||
|
||||
/* A kind of type specifier. Note that this information is currently
|
||||
|
@ -363,15 +360,13 @@ typedef struct c_arg_tag_d {
|
|||
tree type;
|
||||
} c_arg_tag;
|
||||
|
||||
DEF_VEC_O(c_arg_tag);
|
||||
DEF_VEC_ALLOC_O(c_arg_tag,gc);
|
||||
|
||||
/* Information about the parameters in a function declarator. */
|
||||
struct c_arg_info {
|
||||
/* A list of parameter decls. */
|
||||
tree parms;
|
||||
/* A list of structure, union and enum tags defined. */
|
||||
VEC(c_arg_tag,gc) *tags;
|
||||
vec<c_arg_tag, va_gc> *tags;
|
||||
/* A list of argument types to go in the FUNCTION_TYPE. */
|
||||
tree types;
|
||||
/* A list of non-parameter decls (notably enumeration constants)
|
||||
|
|
|
@ -80,8 +80,8 @@ static int function_types_compatible_p (const_tree, const_tree, bool *,
|
|||
bool *);
|
||||
static int type_lists_compatible_p (const_tree, const_tree, bool *, bool *);
|
||||
static tree lookup_field (tree, tree);
|
||||
static int convert_arguments (tree, VEC(tree,gc) *, VEC(tree,gc) *, tree,
|
||||
tree);
|
||||
static int convert_arguments (tree, vec<tree, va_gc> *, vec<tree, va_gc> *,
|
||||
tree, tree);
|
||||
static tree pointer_diff (location_t, tree, tree);
|
||||
static tree convert_for_assignment (location_t, tree, tree, tree,
|
||||
enum impl_conv, bool, tree, tree, int);
|
||||
|
@ -2662,14 +2662,14 @@ c_expr_sizeof_type (location_t loc, struct c_type_name *t)
|
|||
tree
|
||||
build_function_call (location_t loc, tree function, tree params)
|
||||
{
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *v;
|
||||
tree ret;
|
||||
|
||||
vec = VEC_alloc (tree, gc, list_length (params));
|
||||
vec_alloc (v, list_length (params));
|
||||
for (; params; params = TREE_CHAIN (params))
|
||||
VEC_quick_push (tree, vec, TREE_VALUE (params));
|
||||
ret = build_function_call_vec (loc, function, vec, NULL);
|
||||
VEC_free (tree, gc, vec);
|
||||
v->quick_push (TREE_VALUE (params));
|
||||
ret = build_function_call_vec (loc, function, v, NULL);
|
||||
vec_free (v);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2690,8 +2690,9 @@ static void inform_declaration (tree decl)
|
|||
PARAMS. */
|
||||
|
||||
tree
|
||||
build_function_call_vec (location_t loc, tree function, VEC(tree,gc) *params,
|
||||
VEC(tree,gc) *origtypes)
|
||||
build_function_call_vec (location_t loc, tree function,
|
||||
vec<tree, va_gc> *params,
|
||||
vec<tree, va_gc> *origtypes)
|
||||
{
|
||||
tree fntype, fundecl = 0;
|
||||
tree name = NULL_TREE, result;
|
||||
|
@ -2729,9 +2730,8 @@ build_function_call_vec (location_t loc, tree function, VEC(tree,gc) *params,
|
|||
|
||||
/* For Objective-C, convert any calls via a cast to OBJC_TYPE_REF
|
||||
expressions, like those used for ObjC messenger dispatches. */
|
||||
if (!VEC_empty (tree, params))
|
||||
function = objc_rewrite_function_call (function,
|
||||
VEC_index (tree, params, 0));
|
||||
if (params && !params->is_empty ())
|
||||
function = objc_rewrite_function_call (function, (*params)[0]);
|
||||
|
||||
function = c_fully_fold (function, false, NULL);
|
||||
|
||||
|
@ -2800,8 +2800,7 @@ build_function_call_vec (location_t loc, tree function, VEC(tree,gc) *params,
|
|||
/* Before the abort, allow the function arguments to exit or
|
||||
call longjmp. */
|
||||
for (i = 0; i < nargs; i++)
|
||||
trap = build2 (COMPOUND_EXPR, void_type_node,
|
||||
VEC_index (tree, params, i), trap);
|
||||
trap = build2 (COMPOUND_EXPR, void_type_node, (*params)[i], trap);
|
||||
|
||||
if (VOID_TYPE_P (return_type))
|
||||
{
|
||||
|
@ -2816,7 +2815,8 @@ build_function_call_vec (location_t loc, tree function, VEC(tree,gc) *params,
|
|||
|
||||
if (AGGREGATE_TYPE_P (return_type))
|
||||
rhs = build_compound_literal (loc, return_type,
|
||||
build_constructor (return_type, 0),
|
||||
build_constructor (return_type,
|
||||
NULL),
|
||||
false);
|
||||
else
|
||||
rhs = build_zero_cst (return_type);
|
||||
|
@ -2826,7 +2826,7 @@ build_function_call_vec (location_t loc, tree function, VEC(tree,gc) *params,
|
|||
}
|
||||
}
|
||||
|
||||
argarray = VEC_address (tree, params);
|
||||
argarray = vec_safe_address (params);
|
||||
|
||||
/* Check that arguments to builtin functions match the expectations. */
|
||||
if (fundecl
|
||||
|
@ -2886,8 +2886,8 @@ build_function_call_vec (location_t loc, tree function, VEC(tree,gc) *params,
|
|||
failure. */
|
||||
|
||||
static int
|
||||
convert_arguments (tree typelist, VEC(tree,gc) *values,
|
||||
VEC(tree,gc) *origtypes, tree function, tree fundecl)
|
||||
convert_arguments (tree typelist, vec<tree, va_gc> *values,
|
||||
vec<tree, va_gc> *origtypes, tree function, tree fundecl)
|
||||
{
|
||||
tree typetail, val;
|
||||
unsigned int parmnum;
|
||||
|
@ -2934,7 +2934,7 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
|
|||
converted arguments. */
|
||||
|
||||
for (typetail = typelist, parmnum = 0;
|
||||
VEC_iterate (tree, values, parmnum, val);
|
||||
values && values->iterate (parmnum, &val);
|
||||
++parmnum)
|
||||
{
|
||||
tree type = typetail ? TREE_VALUE (typetail) : 0;
|
||||
|
@ -3127,9 +3127,7 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
|
|||
sake of better warnings from convert_and_check. */
|
||||
if (excess_precision)
|
||||
val = build1 (EXCESS_PRECISION_EXPR, valtype, val);
|
||||
origtype = (origtypes == NULL
|
||||
? NULL_TREE
|
||||
: VEC_index (tree, origtypes, parmnum));
|
||||
origtype = (!origtypes) ? NULL_TREE : (*origtypes)[parmnum];
|
||||
parmval = convert_for_assignment (input_location, type, val,
|
||||
origtype, ic_argpass, npc,
|
||||
fundecl, function,
|
||||
|
@ -3173,7 +3171,7 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
|
|||
/* Convert `short' and `char' to full-size `int'. */
|
||||
parmval = default_conversion (val);
|
||||
|
||||
VEC_replace (tree, values, parmnum, parmval);
|
||||
(*values)[parmnum] = parmval;
|
||||
if (parmval == error_mark_node)
|
||||
error_args = true;
|
||||
|
||||
|
@ -3181,7 +3179,7 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
|
|||
typetail = TREE_CHAIN (typetail);
|
||||
}
|
||||
|
||||
gcc_assert (parmnum == VEC_length (tree, values));
|
||||
gcc_assert (parmnum == vec_safe_length (values));
|
||||
|
||||
if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
|
||||
{
|
||||
|
@ -6341,7 +6339,7 @@ static tree constructor_bit_index;
|
|||
/* If we are saving up the elements rather than allocating them,
|
||||
this is the list of elements so far (in reverse order,
|
||||
most recent first). */
|
||||
static VEC(constructor_elt,gc) *constructor_elements;
|
||||
static vec<constructor_elt, va_gc> *constructor_elements;
|
||||
|
||||
/* 1 if constructor should be incrementally stored into a constructor chain,
|
||||
0 if all the elements should be kept in AVL tree. */
|
||||
|
@ -6417,7 +6415,7 @@ struct constructor_stack
|
|||
tree unfilled_index;
|
||||
tree unfilled_fields;
|
||||
tree bit_index;
|
||||
VEC(constructor_elt,gc) *elements;
|
||||
vec<constructor_elt, va_gc> *elements;
|
||||
struct init_node *pending_elts;
|
||||
int offset;
|
||||
int depth;
|
||||
|
@ -6462,7 +6460,7 @@ struct initializer_stack
|
|||
tree decl;
|
||||
struct constructor_stack *constructor_stack;
|
||||
struct constructor_range_stack *constructor_range_stack;
|
||||
VEC(constructor_elt,gc) *elements;
|
||||
vec<constructor_elt, va_gc> *elements;
|
||||
struct spelling *spelling;
|
||||
struct spelling *spelling_base;
|
||||
int spelling_size;
|
||||
|
@ -6611,7 +6609,7 @@ really_start_incremental_init (tree type)
|
|||
constructor_simple = 1;
|
||||
constructor_nonconst = 0;
|
||||
constructor_depth = SPELLING_DEPTH ();
|
||||
constructor_elements = 0;
|
||||
constructor_elements = NULL;
|
||||
constructor_pending_elts = 0;
|
||||
constructor_type = type;
|
||||
constructor_incremental = 1;
|
||||
|
@ -6757,7 +6755,7 @@ push_init_level (int implicit, struct obstack * braced_init_obstack)
|
|||
constructor_simple = 1;
|
||||
constructor_nonconst = 0;
|
||||
constructor_depth = SPELLING_DEPTH ();
|
||||
constructor_elements = 0;
|
||||
constructor_elements = NULL;
|
||||
constructor_incremental = 1;
|
||||
constructor_designated = 0;
|
||||
constructor_pending_elts = 0;
|
||||
|
@ -6807,7 +6805,7 @@ push_init_level (int implicit, struct obstack * braced_init_obstack)
|
|||
constructor_simple = TREE_STATIC (value);
|
||||
constructor_nonconst = CONSTRUCTOR_NON_CONST (value);
|
||||
constructor_elements = CONSTRUCTOR_ELTS (value);
|
||||
if (!VEC_empty (constructor_elt, constructor_elements)
|
||||
if (!vec_safe_is_empty (constructor_elements)
|
||||
&& (TREE_CODE (constructor_type) == RECORD_TYPE
|
||||
|| TREE_CODE (constructor_type) == ARRAY_TYPE))
|
||||
set_nonincremental_init (braced_init_obstack);
|
||||
|
@ -6957,9 +6955,8 @@ pop_init_level (int implicit, struct obstack * braced_init_obstack)
|
|||
&& constructor_unfilled_fields)
|
||||
{
|
||||
bool constructor_zeroinit =
|
||||
(VEC_length (constructor_elt, constructor_elements) == 1
|
||||
&& integer_zerop
|
||||
(VEC_index (constructor_elt, constructor_elements, 0).value));
|
||||
(vec_safe_length (constructor_elements) == 1
|
||||
&& integer_zerop ((*constructor_elements)[0].value));
|
||||
|
||||
/* Do not warn for flexible array members or zero-length arrays. */
|
||||
while (constructor_unfilled_fields
|
||||
|
@ -6997,19 +6994,19 @@ pop_init_level (int implicit, struct obstack * braced_init_obstack)
|
|||
{
|
||||
/* A nonincremental scalar initializer--just return
|
||||
the element, after verifying there is just one. */
|
||||
if (VEC_empty (constructor_elt,constructor_elements))
|
||||
if (vec_safe_is_empty (constructor_elements))
|
||||
{
|
||||
if (!constructor_erroneous)
|
||||
error_init ("empty scalar initializer");
|
||||
ret.value = error_mark_node;
|
||||
}
|
||||
else if (VEC_length (constructor_elt,constructor_elements) != 1)
|
||||
else if (vec_safe_length (constructor_elements) != 1)
|
||||
{
|
||||
error_init ("extra elements in scalar initializer");
|
||||
ret.value = VEC_index (constructor_elt,constructor_elements,0).value;
|
||||
ret.value = (*constructor_elements)[0].value;
|
||||
}
|
||||
else
|
||||
ret.value = VEC_index (constructor_elt,constructor_elements,0).value;
|
||||
ret.value = (*constructor_elements)[0].value;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -7534,7 +7531,7 @@ set_nonincremental_init (struct obstack * braced_init_obstack)
|
|||
add_pending_init (index, value, NULL_TREE, true,
|
||||
braced_init_obstack);
|
||||
}
|
||||
constructor_elements = 0;
|
||||
constructor_elements = NULL;
|
||||
if (TREE_CODE (constructor_type) == RECORD_TYPE)
|
||||
{
|
||||
constructor_unfilled_fields = TYPE_FIELDS (constructor_type);
|
||||
|
@ -7679,10 +7676,9 @@ find_init_member (tree field, struct obstack * braced_init_obstack)
|
|||
}
|
||||
else if (TREE_CODE (constructor_type) == UNION_TYPE)
|
||||
{
|
||||
if (!VEC_empty (constructor_elt, constructor_elements)
|
||||
&& (VEC_last (constructor_elt, constructor_elements).index
|
||||
== field))
|
||||
return VEC_last (constructor_elt, constructor_elements).value;
|
||||
if (!vec_safe_is_empty (constructor_elements)
|
||||
&& (constructor_elements->last ().index == field))
|
||||
return constructor_elements->last ().value;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -7859,12 +7855,11 @@ output_init_element (tree value, tree origtype, bool strict_string, tree type,
|
|||
return;
|
||||
}
|
||||
else if (TREE_CODE (constructor_type) == UNION_TYPE
|
||||
&& !VEC_empty (constructor_elt, constructor_elements))
|
||||
&& !vec_safe_is_empty (constructor_elements))
|
||||
{
|
||||
if (!implicit)
|
||||
{
|
||||
if (TREE_SIDE_EFFECTS (VEC_last (constructor_elt,
|
||||
constructor_elements).value))
|
||||
if (TREE_SIDE_EFFECTS (constructor_elements->last ().value))
|
||||
warning_init (0,
|
||||
"initialized field with side-effects overwritten");
|
||||
else if (warn_override_init)
|
||||
|
@ -7872,14 +7867,14 @@ output_init_element (tree value, tree origtype, bool strict_string, tree type,
|
|||
}
|
||||
|
||||
/* We can have just one union field set. */
|
||||
constructor_elements = 0;
|
||||
constructor_elements = NULL;
|
||||
}
|
||||
|
||||
/* Otherwise, output this element either to
|
||||
constructor_elements or to the assembler file. */
|
||||
|
||||
constructor_elt celt = {field, value};
|
||||
VEC_safe_push (constructor_elt, gc, constructor_elements, celt);
|
||||
vec_safe_push (constructor_elements, celt);
|
||||
|
||||
/* Advance the variable that indicates sequential elements output. */
|
||||
if (TREE_CODE (constructor_type) == ARRAY_TYPE)
|
||||
|
|
22
gcc/calls.c
22
gcc/calls.c
|
@ -1696,7 +1696,7 @@ static struct
|
|||
based on crtl->args.internal_arg_pointer. The element is NULL_RTX if the
|
||||
pseudo isn't based on it, a CONST_INT offset if the pseudo is based on it
|
||||
with fixed offset, or PC if this is with variable or unknown offset. */
|
||||
VEC(rtx, heap) *cache;
|
||||
vec<rtx> cache;
|
||||
} internal_arg_pointer_exp_state;
|
||||
|
||||
static rtx internal_arg_pointer_based_exp (rtx, bool);
|
||||
|
@ -1725,21 +1725,17 @@ internal_arg_pointer_based_exp_scan (void)
|
|||
rtx val = NULL_RTX;
|
||||
unsigned int idx = REGNO (SET_DEST (set)) - FIRST_PSEUDO_REGISTER;
|
||||
/* Punt on pseudos set multiple times. */
|
||||
if (idx < VEC_length (rtx, internal_arg_pointer_exp_state.cache)
|
||||
&& (VEC_index (rtx, internal_arg_pointer_exp_state.cache, idx)
|
||||
if (idx < internal_arg_pointer_exp_state.cache.length ()
|
||||
&& (internal_arg_pointer_exp_state.cache[idx]
|
||||
!= NULL_RTX))
|
||||
val = pc_rtx;
|
||||
else
|
||||
val = internal_arg_pointer_based_exp (SET_SRC (set), false);
|
||||
if (val != NULL_RTX)
|
||||
{
|
||||
if (idx
|
||||
>= VEC_length (rtx, internal_arg_pointer_exp_state.cache))
|
||||
VEC_safe_grow_cleared (rtx, heap,
|
||||
internal_arg_pointer_exp_state.cache,
|
||||
idx + 1);
|
||||
VEC_replace (rtx, internal_arg_pointer_exp_state.cache,
|
||||
idx, val);
|
||||
if (idx >= internal_arg_pointer_exp_state.cache.length ())
|
||||
internal_arg_pointer_exp_state.cache.safe_grow_cleared(idx + 1);
|
||||
internal_arg_pointer_exp_state.cache[idx] = val;
|
||||
}
|
||||
}
|
||||
if (NEXT_INSN (insn) == NULL_RTX)
|
||||
|
@ -1799,8 +1795,8 @@ internal_arg_pointer_based_exp (rtx rtl, bool toplevel)
|
|||
if (REG_P (rtl))
|
||||
{
|
||||
unsigned int idx = REGNO (rtl) - FIRST_PSEUDO_REGISTER;
|
||||
if (idx < VEC_length (rtx, internal_arg_pointer_exp_state.cache))
|
||||
return VEC_index (rtx, internal_arg_pointer_exp_state.cache, idx);
|
||||
if (idx < internal_arg_pointer_exp_state.cache.length ())
|
||||
return internal_arg_pointer_exp_state.cache[idx];
|
||||
|
||||
return NULL_RTX;
|
||||
}
|
||||
|
@ -3443,7 +3439,7 @@ expand_call (tree exp, rtx target, int ignore)
|
|||
|
||||
sbitmap_free (stored_args_map);
|
||||
internal_arg_pointer_exp_state.scan_start = NULL_RTX;
|
||||
VEC_free (rtx, heap, internal_arg_pointer_exp_state.cache);
|
||||
internal_arg_pointer_exp_state.cache.release ();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
16
gcc/cfg.c
16
gcc/cfg.c
|
@ -107,14 +107,14 @@ clear_edges (void)
|
|||
{
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
free_edge (e);
|
||||
VEC_truncate (edge, bb->succs, 0);
|
||||
VEC_truncate (edge, bb->preds, 0);
|
||||
vec_safe_truncate (bb->succs, 0);
|
||||
vec_safe_truncate (bb->preds, 0);
|
||||
}
|
||||
|
||||
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
|
||||
free_edge (e);
|
||||
VEC_truncate (edge, EXIT_BLOCK_PTR->preds, 0);
|
||||
VEC_truncate (edge, ENTRY_BLOCK_PTR->succs, 0);
|
||||
vec_safe_truncate (EXIT_BLOCK_PTR->preds, 0);
|
||||
vec_safe_truncate (ENTRY_BLOCK_PTR->succs, 0);
|
||||
|
||||
gcc_assert (!n_edges);
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ expunge_block (basic_block b)
|
|||
static inline void
|
||||
connect_src (edge e)
|
||||
{
|
||||
VEC_safe_push (edge, gc, e->src->succs, e);
|
||||
vec_safe_push (e->src->succs, e);
|
||||
df_mark_solutions_dirty ();
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ static inline void
|
|||
connect_dest (edge e)
|
||||
{
|
||||
basic_block dest = e->dest;
|
||||
VEC_safe_push (edge, gc, dest->preds, e);
|
||||
vec_safe_push (dest->preds, e);
|
||||
e->dest_idx = EDGE_COUNT (dest->preds) - 1;
|
||||
df_mark_solutions_dirty ();
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ disconnect_src (edge e)
|
|||
{
|
||||
if (tmp == e)
|
||||
{
|
||||
VEC_unordered_remove (edge, src->succs, ei.index);
|
||||
src->succs->unordered_remove (ei.index);
|
||||
df_mark_solutions_dirty ();
|
||||
return;
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ disconnect_dest (edge e)
|
|||
basic_block dest = e->dest;
|
||||
unsigned int dest_idx = e->dest_idx;
|
||||
|
||||
VEC_unordered_remove (edge, dest->preds, dest_idx);
|
||||
dest->preds->unordered_remove (dest_idx);
|
||||
|
||||
/* If we removed an edge in the middle of the edge vector, we need
|
||||
to update dest_idx of the edge that moved into the "hole". */
|
||||
|
|
|
@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "coretypes.h"
|
||||
#include "basic-block.h"
|
||||
#include "vec.h"
|
||||
#include "vecprim.h"
|
||||
#include "bitmap.h"
|
||||
#include "sbitmap.h"
|
||||
#include "timevar.h"
|
||||
|
@ -1139,27 +1138,27 @@ compute_idf (bitmap def_blocks, bitmap_head *dfs)
|
|||
{
|
||||
bitmap_iterator bi;
|
||||
unsigned bb_index, i;
|
||||
VEC(int,heap) *work_stack;
|
||||
vec<int> work_stack;
|
||||
bitmap phi_insertion_points;
|
||||
|
||||
work_stack = VEC_alloc (int, heap, n_basic_blocks);
|
||||
work_stack.create (n_basic_blocks);
|
||||
phi_insertion_points = BITMAP_ALLOC (NULL);
|
||||
|
||||
/* Seed the work list with all the blocks in DEF_BLOCKS. We use
|
||||
VEC_quick_push here for speed. This is safe because we know that
|
||||
vec::quick_push here for speed. This is safe because we know that
|
||||
the number of definition blocks is no greater than the number of
|
||||
basic blocks, which is the initial capacity of WORK_STACK. */
|
||||
EXECUTE_IF_SET_IN_BITMAP (def_blocks, 0, bb_index, bi)
|
||||
VEC_quick_push (int, work_stack, bb_index);
|
||||
work_stack.quick_push (bb_index);
|
||||
|
||||
/* Pop a block off the worklist, add every block that appears in
|
||||
the original block's DF that we have not already processed to
|
||||
the worklist. Iterate until the worklist is empty. Blocks
|
||||
which are added to the worklist are potential sites for
|
||||
PHI nodes. */
|
||||
while (VEC_length (int, work_stack) > 0)
|
||||
while (work_stack.length () > 0)
|
||||
{
|
||||
bb_index = VEC_pop (int, work_stack);
|
||||
bb_index = work_stack.pop ();
|
||||
|
||||
/* Since the registration of NEW -> OLD name mappings is done
|
||||
separately from the call to update_ssa, when updating the SSA
|
||||
|
@ -1174,12 +1173,12 @@ compute_idf (bitmap def_blocks, bitmap_head *dfs)
|
|||
/* Use a safe push because if there is a definition of VAR
|
||||
in every basic block, then WORK_STACK may eventually have
|
||||
more than N_BASIC_BLOCK entries. */
|
||||
VEC_safe_push (int, heap, work_stack, i);
|
||||
work_stack.safe_push (i);
|
||||
bitmap_set_bit (phi_insertion_points, i);
|
||||
}
|
||||
}
|
||||
|
||||
VEC_free (int, heap, work_stack);
|
||||
work_stack.release ();
|
||||
|
||||
return phi_insertion_points;
|
||||
}
|
||||
|
|
|
@ -2816,12 +2816,12 @@ delete_unreachable_blocks (void)
|
|||
delete_basic_block (b);
|
||||
else
|
||||
{
|
||||
VEC (basic_block, heap) *h
|
||||
vec<basic_block> h
|
||||
= get_all_dominated_blocks (CDI_DOMINATORS, b);
|
||||
|
||||
while (VEC_length (basic_block, h))
|
||||
while (h.length ())
|
||||
{
|
||||
b = VEC_pop (basic_block, h);
|
||||
b = h.pop ();
|
||||
|
||||
prev_bb = b->prev_bb;
|
||||
|
||||
|
@ -2830,7 +2830,7 @@ delete_unreachable_blocks (void)
|
|||
delete_basic_block (b);
|
||||
}
|
||||
|
||||
VEC_free (basic_block, heap, h);
|
||||
h.release ();
|
||||
}
|
||||
|
||||
changed = true;
|
||||
|
|
|
@ -848,18 +848,15 @@ expand_one_stack_var_at (tree decl, rtx base, unsigned base_align,
|
|||
set_rtl (decl, x);
|
||||
}
|
||||
|
||||
DEF_VEC_I(HOST_WIDE_INT);
|
||||
DEF_VEC_ALLOC_I(HOST_WIDE_INT,heap);
|
||||
|
||||
struct stack_vars_data
|
||||
{
|
||||
/* Vector of offset pairs, always end of some padding followed
|
||||
by start of the padding that needs Address Sanitizer protection.
|
||||
The vector is in reversed, highest offset pairs come first. */
|
||||
VEC(HOST_WIDE_INT, heap) *asan_vec;
|
||||
vec<HOST_WIDE_INT> asan_vec;
|
||||
|
||||
/* Vector of partition representative decls in between the paddings. */
|
||||
VEC(tree, heap) *asan_decl_vec;
|
||||
vec<tree> asan_decl_vec;
|
||||
};
|
||||
|
||||
/* A subroutine of expand_used_vars. Give each partition representative
|
||||
|
@ -953,10 +950,8 @@ expand_stack_vars (bool (*pred) (size_t), struct stack_vars_data *data)
|
|||
= alloc_stack_frame_space (stack_vars[i].size
|
||||
+ ASAN_RED_ZONE_SIZE,
|
||||
MAX (alignb, ASAN_RED_ZONE_SIZE));
|
||||
VEC_safe_push (HOST_WIDE_INT, heap, data->asan_vec,
|
||||
prev_offset);
|
||||
VEC_safe_push (HOST_WIDE_INT, heap, data->asan_vec,
|
||||
offset + stack_vars[i].size);
|
||||
data->asan_vec.safe_push (prev_offset);
|
||||
data->asan_vec.safe_push (offset + stack_vars[i].size);
|
||||
/* Find best representative of the partition.
|
||||
Prefer those with DECL_NAME, even better
|
||||
satisfying asan_protect_stack_decl predicate. */
|
||||
|
@ -973,7 +968,7 @@ expand_stack_vars (bool (*pred) (size_t), struct stack_vars_data *data)
|
|||
repr_decl = stack_vars[j].decl;
|
||||
if (repr_decl == NULL_TREE)
|
||||
repr_decl = stack_vars[i].decl;
|
||||
VEC_safe_push (tree, heap, data->asan_decl_vec, repr_decl);
|
||||
data->asan_decl_vec.safe_push (repr_decl);
|
||||
}
|
||||
else
|
||||
offset = alloc_stack_frame_space (stack_vars[i].size, alignb);
|
||||
|
@ -1526,7 +1521,7 @@ static rtx
|
|||
expand_used_vars (void)
|
||||
{
|
||||
tree var, outer_block = DECL_INITIAL (current_function_decl);
|
||||
VEC(tree,heap) *maybe_local_decls = NULL;
|
||||
vec<tree> maybe_local_decls = vec<tree>();
|
||||
rtx var_end_seq = NULL_RTX;
|
||||
struct pointer_map_t *ssa_name_decls;
|
||||
unsigned i;
|
||||
|
@ -1585,7 +1580,7 @@ expand_used_vars (void)
|
|||
/* At this point all variables on the local_decls with TREE_USED
|
||||
set are not associated with any block scope. Lay them out. */
|
||||
|
||||
len = VEC_length (tree, cfun->local_decls);
|
||||
len = vec_safe_length (cfun->local_decls);
|
||||
FOR_EACH_LOCAL_DECL (cfun, i, var)
|
||||
{
|
||||
bool expand_now = false;
|
||||
|
@ -1630,7 +1625,7 @@ expand_used_vars (void)
|
|||
/* If rtl isn't set yet, which can happen e.g. with
|
||||
-fstack-protector, retry before returning from this
|
||||
function. */
|
||||
VEC_safe_push (tree, heap, maybe_local_decls, var);
|
||||
maybe_local_decls.safe_push (var);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1645,8 +1640,8 @@ expand_used_vars (void)
|
|||
We just want the duplicates, as those are the artificial
|
||||
non-ignored vars that we want to keep until instantiate_decls.
|
||||
Move them down and truncate the array. */
|
||||
if (!VEC_empty (tree, cfun->local_decls))
|
||||
VEC_block_remove (tree, cfun->local_decls, 0, len);
|
||||
if (!vec_safe_is_empty (cfun->local_decls))
|
||||
cfun->local_decls->block_remove (0, len);
|
||||
|
||||
/* At this point, all variables within the block tree with TREE_USED
|
||||
set are actually used by the optimized function. Lay them out. */
|
||||
|
@ -1680,8 +1675,8 @@ expand_used_vars (void)
|
|||
{
|
||||
struct stack_vars_data data;
|
||||
|
||||
data.asan_vec = NULL;
|
||||
data.asan_decl_vec = NULL;
|
||||
data.asan_vec = vec<HOST_WIDE_INT>();
|
||||
data.asan_decl_vec = vec<tree>();
|
||||
|
||||
/* Reorder decls to be protected by iterating over the variables
|
||||
array multiple times, and allocating out of each phase in turn. */
|
||||
|
@ -1703,29 +1698,26 @@ expand_used_vars (void)
|
|||
in addition to phase 1 and 2. */
|
||||
expand_stack_vars (asan_decl_phase_3, &data);
|
||||
|
||||
if (!VEC_empty (HOST_WIDE_INT, data.asan_vec))
|
||||
if (!data.asan_vec.is_empty ())
|
||||
{
|
||||
HOST_WIDE_INT prev_offset = frame_offset;
|
||||
HOST_WIDE_INT offset
|
||||
= alloc_stack_frame_space (ASAN_RED_ZONE_SIZE,
|
||||
ASAN_RED_ZONE_SIZE);
|
||||
VEC_safe_push (HOST_WIDE_INT, heap, data.asan_vec, prev_offset);
|
||||
VEC_safe_push (HOST_WIDE_INT, heap, data.asan_vec, offset);
|
||||
data.asan_vec.safe_push (prev_offset);
|
||||
data.asan_vec.safe_push (offset);
|
||||
|
||||
var_end_seq
|
||||
= asan_emit_stack_protection (virtual_stack_vars_rtx,
|
||||
VEC_address (HOST_WIDE_INT,
|
||||
data.asan_vec),
|
||||
VEC_address (tree,
|
||||
data.asan_decl_vec),
|
||||
VEC_length (HOST_WIDE_INT,
|
||||
data.asan_vec));
|
||||
data.asan_vec.address (),
|
||||
data.asan_decl_vec. address(),
|
||||
data.asan_vec.length ());
|
||||
}
|
||||
|
||||
expand_stack_vars (NULL, &data);
|
||||
|
||||
VEC_free (HOST_WIDE_INT, heap, data.asan_vec);
|
||||
VEC_free (tree, heap, data.asan_decl_vec);
|
||||
data.asan_vec.release ();
|
||||
data.asan_decl_vec.release ();
|
||||
}
|
||||
|
||||
fini_vars_expansion ();
|
||||
|
@ -1733,7 +1725,7 @@ expand_used_vars (void)
|
|||
/* If there were any artificial non-ignored vars without rtl
|
||||
found earlier, see if deferred stack allocation hasn't assigned
|
||||
rtl to them. */
|
||||
FOR_EACH_VEC_ELT_REVERSE (tree, maybe_local_decls, i, var)
|
||||
FOR_EACH_VEC_ELT_REVERSE (maybe_local_decls, i, var)
|
||||
{
|
||||
rtx rtl = DECL_RTL_IF_SET (var);
|
||||
|
||||
|
@ -1742,7 +1734,7 @@ expand_used_vars (void)
|
|||
if (rtl && (MEM_P (rtl) || GET_CODE (rtl) == CONCAT))
|
||||
add_local_decl (cfun, var);
|
||||
}
|
||||
VEC_free (tree, heap, maybe_local_decls);
|
||||
maybe_local_decls.release ();
|
||||
|
||||
/* If the target requires that FRAME_OFFSET be aligned, do it. */
|
||||
if (STACK_ALIGNMENT_NEEDED)
|
||||
|
@ -2104,12 +2096,12 @@ expand_call_stmt (gimple stmt)
|
|||
/* Ensure RTL is created for debug args. */
|
||||
if (decl && DECL_HAS_DEBUG_ARGS_P (decl))
|
||||
{
|
||||
VEC(tree, gc) **debug_args = decl_debug_args_lookup (decl);
|
||||
vec<tree, va_gc> **debug_args = decl_debug_args_lookup (decl);
|
||||
unsigned int ix;
|
||||
tree dtemp;
|
||||
|
||||
if (debug_args)
|
||||
for (ix = 1; VEC_iterate (tree, *debug_args, ix, dtemp); ix += 2)
|
||||
for (ix = 1; (*debug_args)->iterate (ix, &dtemp); ix += 2)
|
||||
{
|
||||
gcc_assert (TREE_CODE (dtemp) == DEBUG_EXPR_DECL);
|
||||
expand_debug_expr (dtemp);
|
||||
|
@ -3657,13 +3649,13 @@ expand_debug_source_expr (tree exp)
|
|||
if (DECL_CONTEXT (aexp)
|
||||
== DECL_ABSTRACT_ORIGIN (current_function_decl))
|
||||
{
|
||||
VEC(tree, gc) **debug_args;
|
||||
vec<tree, va_gc> **debug_args;
|
||||
unsigned int ix;
|
||||
tree ddecl;
|
||||
debug_args = decl_debug_args_lookup (current_function_decl);
|
||||
if (debug_args != NULL)
|
||||
{
|
||||
for (ix = 0; VEC_iterate (tree, *debug_args, ix, ddecl);
|
||||
for (ix = 0; vec_safe_iterate (*debug_args, ix, &ddecl);
|
||||
ix += 2)
|
||||
if (ddecl == aexp)
|
||||
return gen_rtx_DEBUG_PARAMETER_REF (mode, aexp);
|
||||
|
|
|
@ -814,11 +814,12 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
|
|||
|
||||
if (dom_info_available_p (CDI_DOMINATORS))
|
||||
{
|
||||
VEC (basic_block, heap) *doms_to_fix = VEC_alloc (basic_block, heap, 2);
|
||||
VEC_quick_push (basic_block, doms_to_fix, dummy);
|
||||
VEC_quick_push (basic_block, doms_to_fix, bb);
|
||||
vec<basic_block> doms_to_fix;
|
||||
doms_to_fix.create (2);
|
||||
doms_to_fix.quick_push (dummy);
|
||||
doms_to_fix.quick_push (bb);
|
||||
iterate_fix_dominators (CDI_DOMINATORS, doms_to_fix, false);
|
||||
VEC_free (basic_block, heap, doms_to_fix);
|
||||
doms_to_fix.release ();
|
||||
}
|
||||
|
||||
if (current_loops != NULL)
|
||||
|
@ -1144,7 +1145,7 @@ bool
|
|||
cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge e,
|
||||
unsigned int ndupl,
|
||||
sbitmap wont_exit, edge orig,
|
||||
VEC (edge, heap) **to_remove,
|
||||
vec<edge> *to_remove,
|
||||
int flags)
|
||||
{
|
||||
gcc_assert (cfg_hooks->cfg_hook_duplicate_loop_to_header_edge);
|
||||
|
|
|
@ -119,7 +119,7 @@ struct cfg_hooks
|
|||
in loop versioning. */
|
||||
bool (*cfg_hook_duplicate_loop_to_header_edge) (struct loop *, edge,
|
||||
unsigned, sbitmap,
|
||||
edge, VEC (edge, heap) **,
|
||||
edge, vec<edge> *,
|
||||
int);
|
||||
|
||||
/* Add condition to new basic block and update CFG used in loop
|
||||
|
@ -186,7 +186,7 @@ extern bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge,
|
|||
unsigned int ndupl,
|
||||
sbitmap wont_exit,
|
||||
edge orig,
|
||||
VEC (edge, heap) **to_remove,
|
||||
vec<edge> *to_remove,
|
||||
int flags);
|
||||
|
||||
extern void lv_flush_pending_stmts (edge);
|
||||
|
|
106
gcc/cfgloop.c
106
gcc/cfgloop.c
|
@ -66,7 +66,7 @@ flow_loop_nested_p (const struct loop *outer, const struct loop *loop)
|
|||
unsigned odepth = loop_depth (outer);
|
||||
|
||||
return (loop_depth (loop) > odepth
|
||||
&& VEC_index (loop_p, loop->superloops, odepth) == outer);
|
||||
&& (*loop->superloops)[odepth] == outer);
|
||||
}
|
||||
|
||||
/* Returns the loop such that LOOP is nested DEPTH (indexed from zero)
|
||||
|
@ -82,22 +82,22 @@ superloop_at_depth (struct loop *loop, unsigned depth)
|
|||
if (depth == ldepth)
|
||||
return loop;
|
||||
|
||||
return VEC_index (loop_p, loop->superloops, depth);
|
||||
return (*loop->superloops)[depth];
|
||||
}
|
||||
|
||||
/* Returns the list of the latch edges of LOOP. */
|
||||
|
||||
static VEC (edge, heap) *
|
||||
static vec<edge>
|
||||
get_loop_latch_edges (const struct loop *loop)
|
||||
{
|
||||
edge_iterator ei;
|
||||
edge e;
|
||||
VEC (edge, heap) *ret = NULL;
|
||||
vec<edge> ret = vec<edge>();
|
||||
|
||||
FOR_EACH_EDGE (e, ei, loop->header->preds)
|
||||
{
|
||||
if (dominated_by_p (CDI_DOMINATORS, e->src, loop->header))
|
||||
VEC_safe_push (edge, heap, ret, e);
|
||||
ret.safe_push (e);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -113,7 +113,7 @@ flow_loop_dump (const struct loop *loop, FILE *file,
|
|||
{
|
||||
basic_block *bbs;
|
||||
unsigned i;
|
||||
VEC (edge, heap) *latches;
|
||||
vec<edge> latches;
|
||||
edge e;
|
||||
|
||||
if (! loop || ! loop->header)
|
||||
|
@ -128,9 +128,9 @@ flow_loop_dump (const struct loop *loop, FILE *file,
|
|||
{
|
||||
fprintf (file, "multiple latches:");
|
||||
latches = get_loop_latch_edges (loop);
|
||||
FOR_EACH_VEC_ELT (edge, latches, i, e)
|
||||
FOR_EACH_VEC_ELT (latches, i, e)
|
||||
fprintf (file, " %d", e->src->index);
|
||||
VEC_free (edge, heap, latches);
|
||||
latches.release ();
|
||||
fprintf (file, "\n");
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ flow_loop_free (struct loop *loop)
|
|||
{
|
||||
struct loop_exit *exit, *next;
|
||||
|
||||
VEC_free (loop_p, gc, loop->superloops);
|
||||
vec_free (loop->superloops);
|
||||
|
||||
/* Break the list of the loop exit records. They will be freed when the
|
||||
corresponding edge is rescanned or removed, and this avoids
|
||||
|
@ -207,7 +207,7 @@ flow_loops_free (struct loops *loops)
|
|||
loop_p loop;
|
||||
|
||||
/* Free the loop descriptors. */
|
||||
FOR_EACH_VEC_ELT (loop_p, loops->larray, i, loop)
|
||||
FOR_EACH_VEC_SAFE_ELT (loops->larray, i, loop)
|
||||
{
|
||||
if (!loop)
|
||||
continue;
|
||||
|
@ -215,7 +215,7 @@ flow_loops_free (struct loops *loops)
|
|||
flow_loop_free (loop);
|
||||
}
|
||||
|
||||
VEC_free (loop_p, gc, loops->larray);
|
||||
vec_free (loops->larray);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ flow_loops_free (struct loops *loops)
|
|||
int
|
||||
flow_loop_nodes_find (basic_block header, struct loop *loop)
|
||||
{
|
||||
VEC (basic_block, heap) *stack = NULL;
|
||||
vec<basic_block> stack = vec<basic_block>();
|
||||
int num_nodes = 1;
|
||||
edge latch;
|
||||
edge_iterator latch_ei;
|
||||
|
@ -239,16 +239,16 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
|
|||
continue;
|
||||
|
||||
num_nodes++;
|
||||
VEC_safe_push (basic_block, heap, stack, latch->src);
|
||||
stack.safe_push (latch->src);
|
||||
latch->src->loop_father = loop;
|
||||
|
||||
while (!VEC_empty (basic_block, stack))
|
||||
while (!stack.is_empty ())
|
||||
{
|
||||
basic_block node;
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
node = VEC_pop (basic_block, stack);
|
||||
node = stack.pop ();
|
||||
|
||||
FOR_EACH_EDGE (e, ei, node->preds)
|
||||
{
|
||||
|
@ -258,12 +258,12 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
|
|||
{
|
||||
ancestor->loop_father = loop;
|
||||
num_nodes++;
|
||||
VEC_safe_push (basic_block, heap, stack, ancestor);
|
||||
stack.safe_push (ancestor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
VEC_free (basic_block, heap, stack);
|
||||
stack.release ();
|
||||
|
||||
return num_nodes;
|
||||
}
|
||||
|
@ -278,11 +278,11 @@ establish_preds (struct loop *loop, struct loop *father)
|
|||
unsigned depth = loop_depth (father) + 1;
|
||||
unsigned i;
|
||||
|
||||
VEC_truncate (loop_p, loop->superloops, 0);
|
||||
VEC_reserve (loop_p, gc, loop->superloops, depth);
|
||||
FOR_EACH_VEC_ELT (loop_p, father->superloops, i, ploop)
|
||||
VEC_quick_push (loop_p, loop->superloops, ploop);
|
||||
VEC_quick_push (loop_p, loop->superloops, father);
|
||||
loop->superloops = 0;
|
||||
vec_alloc (loop->superloops, depth);
|
||||
FOR_EACH_VEC_SAFE_ELT (father->superloops, i, ploop)
|
||||
loop->superloops->quick_push (ploop);
|
||||
loop->superloops->quick_push (father);
|
||||
|
||||
for (ploop = loop->inner; ploop; ploop = ploop->next)
|
||||
establish_preds (ploop, loop);
|
||||
|
@ -320,7 +320,7 @@ flow_loop_tree_node_remove (struct loop *loop)
|
|||
prev->next = loop->next;
|
||||
}
|
||||
|
||||
VEC_truncate (loop_p, loop->superloops, 0);
|
||||
loop->superloops = NULL;
|
||||
}
|
||||
|
||||
/* Allocates and returns new loop structure. */
|
||||
|
@ -346,7 +346,7 @@ init_loops_structure (struct loops *loops, unsigned num_loops)
|
|||
struct loop *root;
|
||||
|
||||
memset (loops, 0, sizeof *loops);
|
||||
loops->larray = VEC_alloc (loop_p, gc, num_loops);
|
||||
vec_alloc (loops->larray, num_loops);
|
||||
|
||||
/* Dummy loop containing whole function. */
|
||||
root = alloc_loop ();
|
||||
|
@ -356,7 +356,7 @@ init_loops_structure (struct loops *loops, unsigned num_loops)
|
|||
ENTRY_BLOCK_PTR->loop_father = root;
|
||||
EXIT_BLOCK_PTR->loop_father = root;
|
||||
|
||||
VEC_quick_push (loop_p, loops->larray, root);
|
||||
loops->larray->quick_push (root);
|
||||
loops->tree_root = root;
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ flow_loops_find (struct loops *loops)
|
|||
header = BASIC_BLOCK (rc_order[b]);
|
||||
|
||||
loop = alloc_loop ();
|
||||
VEC_quick_push (loop_p, loops->larray, loop);
|
||||
loops->larray->quick_push (loop);
|
||||
|
||||
loop->header = header;
|
||||
loop->num = num_loops;
|
||||
|
@ -492,7 +492,7 @@ flow_loops_find (struct loops *loops)
|
|||
sbitmap_free (headers);
|
||||
|
||||
loops->exits = NULL;
|
||||
return VEC_length (loop_p, loops->larray);
|
||||
return loops->larray->length ();
|
||||
}
|
||||
|
||||
/* Ratio of frequencies of edges so that one of more latch edges is
|
||||
|
@ -513,13 +513,13 @@ flow_loops_find (struct loops *loops)
|
|||
derive the loop structure from it). */
|
||||
|
||||
static edge
|
||||
find_subloop_latch_edge_by_profile (VEC (edge, heap) *latches)
|
||||
find_subloop_latch_edge_by_profile (vec<edge> latches)
|
||||
{
|
||||
unsigned i;
|
||||
edge e, me = NULL;
|
||||
gcov_type mcount = 0, tcount = 0;
|
||||
|
||||
FOR_EACH_VEC_ELT (edge, latches, i, e)
|
||||
FOR_EACH_VEC_ELT (latches, i, e)
|
||||
{
|
||||
if (e->count > mcount)
|
||||
{
|
||||
|
@ -553,9 +553,9 @@ find_subloop_latch_edge_by_profile (VEC (edge, heap) *latches)
|
|||
another edge. */
|
||||
|
||||
static edge
|
||||
find_subloop_latch_edge_by_ivs (struct loop *loop ATTRIBUTE_UNUSED, VEC (edge, heap) *latches)
|
||||
find_subloop_latch_edge_by_ivs (struct loop *loop ATTRIBUTE_UNUSED, vec<edge> latches)
|
||||
{
|
||||
edge e, latch = VEC_index (edge, latches, 0);
|
||||
edge e, latch = latches[0];
|
||||
unsigned i;
|
||||
gimple phi;
|
||||
gimple_stmt_iterator psi;
|
||||
|
@ -563,12 +563,12 @@ find_subloop_latch_edge_by_ivs (struct loop *loop ATTRIBUTE_UNUSED, VEC (edge, h
|
|||
basic_block bb;
|
||||
|
||||
/* Find the candidate for the latch edge. */
|
||||
for (i = 1; VEC_iterate (edge, latches, i, e); i++)
|
||||
for (i = 1; latches.iterate (i, &e); i++)
|
||||
if (dominated_by_p (CDI_DOMINATORS, latch->src, e->src))
|
||||
latch = e;
|
||||
|
||||
/* Verify that it dominates all the latch edges. */
|
||||
FOR_EACH_VEC_ELT (edge, latches, i, e)
|
||||
FOR_EACH_VEC_ELT (latches, i, e)
|
||||
if (!dominated_by_p (CDI_DOMINATORS, e->src, latch->src))
|
||||
return NULL;
|
||||
|
||||
|
@ -587,7 +587,7 @@ find_subloop_latch_edge_by_ivs (struct loop *loop ATTRIBUTE_UNUSED, VEC (edge, h
|
|||
if (!bb || !flow_bb_inside_loop_p (loop, bb))
|
||||
continue;
|
||||
|
||||
FOR_EACH_VEC_ELT (edge, latches, i, e)
|
||||
FOR_EACH_VEC_ELT (latches, i, e)
|
||||
if (e != latch
|
||||
&& PHI_ARG_DEF_FROM_EDGE (phi, e) == lop)
|
||||
return NULL;
|
||||
|
@ -607,10 +607,10 @@ find_subloop_latch_edge_by_ivs (struct loop *loop ATTRIBUTE_UNUSED, VEC (edge, h
|
|||
static edge
|
||||
find_subloop_latch_edge (struct loop *loop)
|
||||
{
|
||||
VEC (edge, heap) *latches = get_loop_latch_edges (loop);
|
||||
vec<edge> latches = get_loop_latch_edges (loop);
|
||||
edge latch = NULL;
|
||||
|
||||
if (VEC_length (edge, latches) > 1)
|
||||
if (latches.length () > 1)
|
||||
{
|
||||
latch = find_subloop_latch_edge_by_profile (latches);
|
||||
|
||||
|
@ -622,7 +622,7 @@ find_subloop_latch_edge (struct loop *loop)
|
|||
latch = find_subloop_latch_edge_by_ivs (loop, latches);
|
||||
}
|
||||
|
||||
VEC_free (edge, heap, latches);
|
||||
latches.release ();
|
||||
return latch;
|
||||
}
|
||||
|
||||
|
@ -671,21 +671,21 @@ form_subloop (struct loop *loop, edge latch)
|
|||
static void
|
||||
merge_latch_edges (struct loop *loop)
|
||||
{
|
||||
VEC (edge, heap) *latches = get_loop_latch_edges (loop);
|
||||
vec<edge> latches = get_loop_latch_edges (loop);
|
||||
edge latch, e;
|
||||
unsigned i;
|
||||
|
||||
gcc_assert (VEC_length (edge, latches) > 0);
|
||||
gcc_assert (latches.length () > 0);
|
||||
|
||||
if (VEC_length (edge, latches) == 1)
|
||||
loop->latch = VEC_index (edge, latches, 0)->src;
|
||||
if (latches.length () == 1)
|
||||
loop->latch = latches[0]->src;
|
||||
else
|
||||
{
|
||||
if (dump_file)
|
||||
fprintf (dump_file, "Merged latch edges of loop %d\n", loop->num);
|
||||
|
||||
mfb_reis_set = pointer_set_create ();
|
||||
FOR_EACH_VEC_ELT (edge, latches, i, e)
|
||||
FOR_EACH_VEC_ELT (latches, i, e)
|
||||
pointer_set_insert (mfb_reis_set, e);
|
||||
latch = make_forwarder_block (loop->header, mfb_redirect_edges_in_set,
|
||||
NULL);
|
||||
|
@ -695,7 +695,7 @@ merge_latch_edges (struct loop *loop)
|
|||
loop->latch = latch->src;
|
||||
}
|
||||
|
||||
VEC_free (edge, heap, latches);
|
||||
latches.release ();
|
||||
}
|
||||
|
||||
/* LOOP may have several latch edges. Transform it into (possibly several)
|
||||
|
@ -1114,10 +1114,10 @@ release_recorded_exits (void)
|
|||
|
||||
/* Returns the list of the exit edges of a LOOP. */
|
||||
|
||||
VEC (edge, heap) *
|
||||
vec<edge>
|
||||
get_loop_exit_edges (const struct loop *loop)
|
||||
{
|
||||
VEC (edge, heap) *edges = NULL;
|
||||
vec<edge> edges = vec<edge>();
|
||||
edge e;
|
||||
unsigned i;
|
||||
basic_block *body;
|
||||
|
@ -1131,7 +1131,7 @@ get_loop_exit_edges (const struct loop *loop)
|
|||
if (loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS))
|
||||
{
|
||||
for (exit = loop->exits->next; exit->e; exit = exit->next)
|
||||
VEC_safe_push (edge, heap, edges, exit->e);
|
||||
edges.safe_push (exit->e);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1140,7 +1140,7 @@ get_loop_exit_edges (const struct loop *loop)
|
|||
FOR_EACH_EDGE (e, ei, body[i]->succs)
|
||||
{
|
||||
if (!flow_bb_inside_loop_p (loop, e->dest))
|
||||
VEC_safe_push (edge, heap, edges, e);
|
||||
edges.safe_push (e);
|
||||
}
|
||||
free (body);
|
||||
}
|
||||
|
@ -1180,7 +1180,7 @@ add_bb_to_loop (basic_block bb, struct loop *loop)
|
|||
gcc_assert (bb->loop_father == NULL);
|
||||
bb->loop_father = loop;
|
||||
loop->num_nodes++;
|
||||
FOR_EACH_VEC_ELT (loop_p, loop->superloops, i, ploop)
|
||||
FOR_EACH_VEC_SAFE_ELT (loop->superloops, i, ploop)
|
||||
ploop->num_nodes++;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
|
@ -1197,7 +1197,7 @@ add_bb_to_loop (basic_block bb, struct loop *loop)
|
|||
void
|
||||
remove_bb_from_loops (basic_block bb)
|
||||
{
|
||||
int i;
|
||||
unsigned i;
|
||||
struct loop *loop = bb->loop_father;
|
||||
loop_p ploop;
|
||||
edge_iterator ei;
|
||||
|
@ -1205,7 +1205,7 @@ remove_bb_from_loops (basic_block bb)
|
|||
|
||||
gcc_assert (loop != NULL);
|
||||
loop->num_nodes--;
|
||||
FOR_EACH_VEC_ELT (loop_p, loop->superloops, i, ploop)
|
||||
FOR_EACH_VEC_SAFE_ELT (loop->superloops, i, ploop)
|
||||
ploop->num_nodes--;
|
||||
bb->loop_father = NULL;
|
||||
|
||||
|
@ -1232,9 +1232,9 @@ find_common_loop (struct loop *loop_s, struct loop *loop_d)
|
|||
ddepth = loop_depth (loop_d);
|
||||
|
||||
if (sdepth < ddepth)
|
||||
loop_d = VEC_index (loop_p, loop_d->superloops, sdepth);
|
||||
loop_d = (*loop_d->superloops)[sdepth];
|
||||
else if (sdepth > ddepth)
|
||||
loop_s = VEC_index (loop_p, loop_s->superloops, ddepth);
|
||||
loop_s = (*loop_s->superloops)[ddepth];
|
||||
|
||||
while (loop_s != loop_d)
|
||||
{
|
||||
|
@ -1253,7 +1253,7 @@ delete_loop (struct loop *loop)
|
|||
flow_loop_tree_node_remove (loop);
|
||||
|
||||
/* Remove loop from loops array. */
|
||||
VEC_replace (loop_p, current_loops->larray, loop->num, NULL);
|
||||
(*current_loops->larray)[loop->num] = NULL;
|
||||
|
||||
/* Free loop data. */
|
||||
flow_loop_free (loop);
|
||||
|
|
|
@ -22,7 +22,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#define GCC_CFGLOOP_H
|
||||
|
||||
#include "basic-block.h"
|
||||
#include "vecprim.h"
|
||||
#include "double-int.h"
|
||||
|
||||
#include "bitmap.h"
|
||||
|
@ -91,9 +90,6 @@ struct GTY (()) loop_exit {
|
|||
};
|
||||
|
||||
typedef struct loop *loop_p;
|
||||
DEF_VEC_P (loop_p);
|
||||
DEF_VEC_ALLOC_P (loop_p, heap);
|
||||
DEF_VEC_ALLOC_P (loop_p, gc);
|
||||
|
||||
/* An integer estimation of the number of iterations. Estimate_state
|
||||
describes what is the state of the estimation. */
|
||||
|
@ -129,7 +125,7 @@ struct GTY ((chain_next ("%h.next"))) loop {
|
|||
unsigned num_nodes;
|
||||
|
||||
/* Superloops of the loop, starting with the outermost loop. */
|
||||
VEC (loop_p, gc) *superloops;
|
||||
vec<loop_p, va_gc> *superloops;
|
||||
|
||||
/* The first inner (child) loop or NULL if innermost loop. */
|
||||
struct loop *inner;
|
||||
|
@ -198,7 +194,7 @@ struct GTY (()) loops {
|
|||
int state;
|
||||
|
||||
/* Array of the loops. */
|
||||
VEC (loop_p, gc) *larray;
|
||||
vec<loop_p, va_gc> *larray;
|
||||
|
||||
/* Maps edges to the list of their descriptions as loop exits. Edges
|
||||
whose sources or destinations have loop_father == NULL (which may
|
||||
|
@ -253,7 +249,7 @@ extern basic_block *get_loop_body_in_bfs_order (const struct loop *);
|
|||
extern basic_block *get_loop_body_in_custom_order (const struct loop *,
|
||||
int (*) (const void *, const void *));
|
||||
|
||||
extern VEC (edge, heap) *get_loop_exit_edges (const struct loop *);
|
||||
extern vec<edge> get_loop_exit_edges (const struct loop *);
|
||||
extern edge single_exit (const struct loop *);
|
||||
extern edge single_likely_exit (struct loop *loop);
|
||||
extern unsigned num_loop_branches (const struct loop *);
|
||||
|
@ -314,7 +310,7 @@ extern void copy_loop_info (struct loop *loop, struct loop *target);
|
|||
extern void duplicate_subloops (struct loop *, struct loop *);
|
||||
extern bool duplicate_loop_to_header_edge (struct loop *, edge,
|
||||
unsigned, sbitmap, edge,
|
||||
VEC (edge, heap) **, int);
|
||||
vec<edge> *, int);
|
||||
extern struct loop *loopify (edge, edge,
|
||||
basic_block, edge, edge, bool,
|
||||
unsigned, unsigned);
|
||||
|
@ -434,7 +430,7 @@ simple_loop_desc (struct loop *loop)
|
|||
static inline struct loop *
|
||||
get_loop (unsigned num)
|
||||
{
|
||||
return VEC_index (loop_p, current_loops->larray, num);
|
||||
return (*current_loops->larray)[num];
|
||||
}
|
||||
|
||||
/* Returns the number of superloops of LOOP. */
|
||||
|
@ -442,7 +438,7 @@ get_loop (unsigned num)
|
|||
static inline unsigned
|
||||
loop_depth (const struct loop *loop)
|
||||
{
|
||||
return VEC_length (loop_p, loop->superloops);
|
||||
return vec_safe_length (loop->superloops);
|
||||
}
|
||||
|
||||
/* Returns the loop depth of the loop BB belongs to. */
|
||||
|
@ -459,12 +455,12 @@ bb_loop_depth (const_basic_block bb)
|
|||
static inline struct loop *
|
||||
loop_outer (const struct loop *loop)
|
||||
{
|
||||
unsigned n = VEC_length (loop_p, loop->superloops);
|
||||
unsigned n = vec_safe_length (loop->superloops);
|
||||
|
||||
if (n == 0)
|
||||
return NULL;
|
||||
|
||||
return VEC_index (loop_p, loop->superloops, n - 1);
|
||||
return (*loop->superloops)[n - 1];
|
||||
}
|
||||
|
||||
/* Returns true if LOOP has at least one exit edge. */
|
||||
|
@ -477,7 +473,7 @@ loop_has_exit_edges (const struct loop *loop)
|
|||
|
||||
/* Returns the list of loops in current_loops. */
|
||||
|
||||
static inline VEC (loop_p, gc) *
|
||||
static inline vec<loop_p, va_gc> *
|
||||
get_loops (void)
|
||||
{
|
||||
if (!current_loops)
|
||||
|
@ -495,7 +491,7 @@ number_of_loops (void)
|
|||
if (!current_loops)
|
||||
return 0;
|
||||
|
||||
return VEC_length (loop_p, current_loops->larray);
|
||||
return vec_safe_length (current_loops->larray);
|
||||
}
|
||||
|
||||
/* Returns true if state of the loops satisfies all properties
|
||||
|
@ -542,7 +538,7 @@ enum li_flags
|
|||
typedef struct
|
||||
{
|
||||
/* The list of loops to visit. */
|
||||
VEC(int,heap) *to_visit;
|
||||
vec<int> to_visit;
|
||||
|
||||
/* The index of the actual loop. */
|
||||
unsigned idx;
|
||||
|
@ -553,7 +549,7 @@ fel_next (loop_iterator *li, loop_p *loop)
|
|||
{
|
||||
int anum;
|
||||
|
||||
while (VEC_iterate (int, li->to_visit, li->idx, anum))
|
||||
while (li->to_visit.iterate (li->idx, &anum))
|
||||
{
|
||||
li->idx++;
|
||||
*loop = get_loop (anum);
|
||||
|
@ -561,7 +557,7 @@ fel_next (loop_iterator *li, loop_p *loop)
|
|||
return;
|
||||
}
|
||||
|
||||
VEC_free (int, heap, li->to_visit);
|
||||
li->to_visit.release ();
|
||||
*loop = NULL;
|
||||
}
|
||||
|
||||
|
@ -575,21 +571,21 @@ fel_init (loop_iterator *li, loop_p *loop, unsigned flags)
|
|||
li->idx = 0;
|
||||
if (!current_loops)
|
||||
{
|
||||
li->to_visit = NULL;
|
||||
li->to_visit.create (0);
|
||||
*loop = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
li->to_visit = VEC_alloc (int, heap, number_of_loops ());
|
||||
li->to_visit.create (number_of_loops ());
|
||||
mn = (flags & LI_INCLUDE_ROOT) ? 0 : 1;
|
||||
|
||||
if (flags & LI_ONLY_INNERMOST)
|
||||
{
|
||||
for (i = 0; VEC_iterate (loop_p, current_loops->larray, i, aloop); i++)
|
||||
for (i = 0; vec_safe_iterate (current_loops->larray, i, &aloop); i++)
|
||||
if (aloop != NULL
|
||||
&& aloop->inner == NULL
|
||||
&& aloop->num >= mn)
|
||||
VEC_quick_push (int, li->to_visit, aloop->num);
|
||||
li->to_visit.quick_push (aloop->num);
|
||||
}
|
||||
else if (flags & LI_FROM_INNERMOST)
|
||||
{
|
||||
|
@ -602,7 +598,7 @@ fel_init (loop_iterator *li, loop_p *loop, unsigned flags)
|
|||
while (1)
|
||||
{
|
||||
if (aloop->num >= mn)
|
||||
VEC_quick_push (int, li->to_visit, aloop->num);
|
||||
li->to_visit.quick_push (aloop->num);
|
||||
|
||||
if (aloop->next)
|
||||
{
|
||||
|
@ -624,7 +620,7 @@ fel_init (loop_iterator *li, loop_p *loop, unsigned flags)
|
|||
while (1)
|
||||
{
|
||||
if (aloop->num >= mn)
|
||||
VEC_quick_push (int, li->to_visit, aloop->num);
|
||||
li->to_visit.quick_push (aloop->num);
|
||||
|
||||
if (aloop->inner != NULL)
|
||||
aloop = aloop->inner;
|
||||
|
@ -649,7 +645,7 @@ fel_init (loop_iterator *li, loop_p *loop, unsigned flags)
|
|||
|
||||
#define FOR_EACH_LOOP_BREAK(LI) \
|
||||
{ \
|
||||
VEC_free (int, heap, (LI).to_visit); \
|
||||
(LI).to_visit.release (); \
|
||||
break; \
|
||||
}
|
||||
|
||||
|
@ -714,19 +710,18 @@ extern void doloop_optimize_loops (void);
|
|||
extern void move_loop_invariants (void);
|
||||
extern bool finite_loop_p (struct loop *);
|
||||
extern void scale_loop_profile (struct loop *loop, int scale, int iteration_bound);
|
||||
extern VEC (basic_block, heap) * get_loop_hot_path (const struct loop *loop);
|
||||
extern vec<basic_block> get_loop_hot_path (const struct loop *loop);
|
||||
|
||||
/* Returns the outermost loop of the loop nest that contains LOOP.*/
|
||||
static inline struct loop *
|
||||
loop_outermost (struct loop *loop)
|
||||
{
|
||||
|
||||
unsigned n = VEC_length (loop_p, loop->superloops);
|
||||
unsigned n = vec_safe_length (loop->superloops);
|
||||
|
||||
if (n <= 1)
|
||||
return loop;
|
||||
|
||||
return VEC_index (loop_p, loop->superloops, 1);
|
||||
return (*loop->superloops)[1];
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ mark_irreducible_loops (void)
|
|||
if (depth == loop_depth (act->loop_father))
|
||||
cloop = act->loop_father;
|
||||
else
|
||||
cloop = VEC_index (loop_p, act->loop_father->superloops, depth);
|
||||
cloop = (*act->loop_father->superloops)[depth];
|
||||
|
||||
src = LOOP_REPR (cloop);
|
||||
}
|
||||
|
@ -454,14 +454,14 @@ edge
|
|||
single_likely_exit (struct loop *loop)
|
||||
{
|
||||
edge found = single_exit (loop);
|
||||
VEC (edge, heap) *exits;
|
||||
vec<edge> exits;
|
||||
unsigned i;
|
||||
edge ex;
|
||||
|
||||
if (found)
|
||||
return found;
|
||||
exits = get_loop_exit_edges (loop);
|
||||
FOR_EACH_VEC_ELT (edge, exits, i, ex)
|
||||
FOR_EACH_VEC_ELT (exits, i, ex)
|
||||
{
|
||||
if (ex->flags & (EDGE_EH | EDGE_ABNORMAL_CALL))
|
||||
continue;
|
||||
|
@ -476,11 +476,11 @@ single_likely_exit (struct loop *loop)
|
|||
found = ex;
|
||||
else
|
||||
{
|
||||
VEC_free (edge, heap, exits);
|
||||
exits.release ();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
VEC_free (edge, heap, exits);
|
||||
exits.release ();
|
||||
return found;
|
||||
}
|
||||
|
||||
|
@ -489,11 +489,11 @@ single_likely_exit (struct loop *loop)
|
|||
order against direction of edges from latch. Specially, if
|
||||
header != latch, latch is the 1-st block. */
|
||||
|
||||
VEC (basic_block, heap) *
|
||||
vec<basic_block>
|
||||
get_loop_hot_path (const struct loop *loop)
|
||||
{
|
||||
basic_block bb = loop->header;
|
||||
VEC (basic_block, heap) *path = NULL;
|
||||
vec<basic_block> path = vec<basic_block>();
|
||||
bitmap visited = BITMAP_ALLOC (NULL);
|
||||
|
||||
while (true)
|
||||
|
@ -502,7 +502,7 @@ get_loop_hot_path (const struct loop *loop)
|
|||
edge e;
|
||||
edge best = NULL;
|
||||
|
||||
VEC_safe_push (basic_block, heap, path, bb);
|
||||
path.safe_push (bb);
|
||||
bitmap_set_bit (visited, bb->index);
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
if ((!best || e->probability > best->probability)
|
||||
|
|
|
@ -119,11 +119,11 @@ fix_loop_placement (struct loop *loop)
|
|||
{
|
||||
unsigned i;
|
||||
edge e;
|
||||
VEC (edge, heap) *exits = get_loop_exit_edges (loop);
|
||||
vec<edge> exits = get_loop_exit_edges (loop);
|
||||
struct loop *father = current_loops->tree_root, *act;
|
||||
bool ret = false;
|
||||
|
||||
FOR_EACH_VEC_ELT (edge, exits, i, e)
|
||||
FOR_EACH_VEC_ELT (exits, i, e)
|
||||
{
|
||||
act = find_common_loop (loop, e->dest->loop_father);
|
||||
if (flow_loop_nested_p (father, act))
|
||||
|
@ -139,13 +139,13 @@ fix_loop_placement (struct loop *loop)
|
|||
|
||||
/* The exit edges of LOOP no longer exits its original immediate
|
||||
superloops; remove them from the appropriate exit lists. */
|
||||
FOR_EACH_VEC_ELT (edge, exits, i, e)
|
||||
FOR_EACH_VEC_ELT (exits, i, e)
|
||||
rescan_loop_exit (e, false, false);
|
||||
|
||||
ret = true;
|
||||
}
|
||||
|
||||
VEC_free (edge, heap, exits);
|
||||
exits.release ();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ remove_path (edge e)
|
|||
{
|
||||
edge ae;
|
||||
basic_block *rem_bbs, *bord_bbs, from, bb;
|
||||
VEC (basic_block, heap) *dom_bbs;
|
||||
vec<basic_block> dom_bbs;
|
||||
int i, nrem, n_bord_bbs;
|
||||
sbitmap seen;
|
||||
bool irred_invalidated = false;
|
||||
|
@ -354,7 +354,7 @@ remove_path (edge e)
|
|||
/* Remove the path. */
|
||||
from = e->src;
|
||||
remove_branch (e);
|
||||
dom_bbs = NULL;
|
||||
dom_bbs.create (0);
|
||||
|
||||
/* Cancel loops contained in the path. */
|
||||
for (i = 0; i < nrem; i++)
|
||||
|
@ -379,14 +379,14 @@ remove_path (edge e)
|
|||
ldom;
|
||||
ldom = next_dom_son (CDI_DOMINATORS, ldom))
|
||||
if (!dominated_by_p (CDI_DOMINATORS, from, ldom))
|
||||
VEC_safe_push (basic_block, heap, dom_bbs, ldom);
|
||||
dom_bbs.safe_push (ldom);
|
||||
}
|
||||
|
||||
free (seen);
|
||||
|
||||
/* Recount dominators. */
|
||||
iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, true);
|
||||
VEC_free (basic_block, heap, dom_bbs);
|
||||
dom_bbs.release ();
|
||||
free (bord_bbs);
|
||||
|
||||
/* Fix placements of basic blocks inside loops and the placement of
|
||||
|
@ -407,7 +407,7 @@ static void
|
|||
place_new_loop (struct loop *loop)
|
||||
{
|
||||
loop->num = number_of_loops ();
|
||||
VEC_safe_push (loop_p, gc, current_loops->larray, loop);
|
||||
vec_safe_push (current_loops->larray, loop);
|
||||
}
|
||||
|
||||
/* Given LOOP structure with filled header and latch, find the body of the
|
||||
|
@ -588,7 +588,7 @@ scale_loop_profile (struct loop *loop, int scale, int iteration_bound)
|
|||
static void
|
||||
update_dominators_in_loop (struct loop *loop)
|
||||
{
|
||||
VEC (basic_block, heap) *dom_bbs = NULL;
|
||||
vec<basic_block> dom_bbs = vec<basic_block>();
|
||||
sbitmap seen;
|
||||
basic_block *body;
|
||||
unsigned i;
|
||||
|
@ -610,14 +610,14 @@ update_dominators_in_loop (struct loop *loop)
|
|||
if (!bitmap_bit_p (seen, ldom->index))
|
||||
{
|
||||
bitmap_set_bit (seen, ldom->index);
|
||||
VEC_safe_push (basic_block, heap, dom_bbs, ldom);
|
||||
dom_bbs.safe_push (ldom);
|
||||
}
|
||||
}
|
||||
|
||||
iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, false);
|
||||
free (body);
|
||||
free (seen);
|
||||
VEC_free (basic_block, heap, dom_bbs);
|
||||
dom_bbs.release ();
|
||||
}
|
||||
|
||||
/* Creates an if region as shown above. CONDITION is used to create
|
||||
|
@ -1115,7 +1115,7 @@ set_zero_probability (edge e)
|
|||
bool
|
||||
duplicate_loop_to_header_edge (struct loop *loop, edge e,
|
||||
unsigned int ndupl, sbitmap wont_exit,
|
||||
edge orig, VEC (edge, heap) **to_remove,
|
||||
edge orig, vec<edge> *to_remove,
|
||||
int flags)
|
||||
{
|
||||
struct loop *target, *aloop;
|
||||
|
@ -1345,7 +1345,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
|
|||
if (orig && bitmap_bit_p (wont_exit, j + 1))
|
||||
{
|
||||
if (to_remove)
|
||||
VEC_safe_push (edge, heap, *to_remove, new_spec_edges[SE_ORIG]);
|
||||
to_remove->safe_push (new_spec_edges[SE_ORIG]);
|
||||
set_zero_probability (new_spec_edges[SE_ORIG]);
|
||||
|
||||
/* Scale the frequencies of the blocks dominated by the exit. */
|
||||
|
@ -1381,7 +1381,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
|
|||
if (orig && bitmap_bit_p (wont_exit, 0))
|
||||
{
|
||||
if (to_remove)
|
||||
VEC_safe_push (edge, heap, *to_remove, orig);
|
||||
to_remove->safe_push (orig);
|
||||
set_zero_probability (orig);
|
||||
|
||||
/* Scale the frequencies of the blocks dominated by the exit. */
|
||||
|
@ -1408,14 +1408,14 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
|
|||
for (i = 0; i < n; i++)
|
||||
{
|
||||
basic_block dominated, dom_bb;
|
||||
VEC (basic_block, heap) *dom_bbs;
|
||||
vec<basic_block> dom_bbs;
|
||||
unsigned j;
|
||||
|
||||
bb = bbs[i];
|
||||
bb->aux = 0;
|
||||
|
||||
dom_bbs = get_dominated_by (CDI_DOMINATORS, bb);
|
||||
FOR_EACH_VEC_ELT (basic_block, dom_bbs, j, dominated)
|
||||
FOR_EACH_VEC_ELT (dom_bbs, j, dominated)
|
||||
{
|
||||
if (flow_bb_inside_loop_p (loop, dominated))
|
||||
continue;
|
||||
|
@ -1423,7 +1423,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
|
|||
CDI_DOMINATORS, first_active[i], first_active_latch);
|
||||
set_immediate_dominator (CDI_DOMINATORS, dominated, dom_bb);
|
||||
}
|
||||
VEC_free (basic_block, heap, dom_bbs);
|
||||
dom_bbs.release ();
|
||||
}
|
||||
free (first_active);
|
||||
|
||||
|
|
|
@ -350,10 +350,10 @@ rtl_create_basic_block (void *headp, void *endp, basic_block after)
|
|||
basic_block bb;
|
||||
|
||||
/* Grow the basic block array if needed. */
|
||||
if ((size_t) last_basic_block >= VEC_length (basic_block, basic_block_info))
|
||||
if ((size_t) last_basic_block >= basic_block_info->length ())
|
||||
{
|
||||
size_t new_size = last_basic_block + (last_basic_block + 3) / 4;
|
||||
VEC_safe_grow_cleared (basic_block, gc, basic_block_info, new_size);
|
||||
vec_safe_grow_cleared (basic_block_info, new_size);
|
||||
}
|
||||
|
||||
n_basic_blocks++;
|
||||
|
@ -1401,7 +1401,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label)
|
|||
{
|
||||
if (tmp == e)
|
||||
{
|
||||
VEC_unordered_remove (edge, ENTRY_BLOCK_PTR->succs, ei.index);
|
||||
ENTRY_BLOCK_PTR->succs->unordered_remove (ei.index);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
@ -1411,7 +1411,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label)
|
|||
|
||||
gcc_assert (found);
|
||||
|
||||
VEC_safe_push (edge, gc, bb->succs, e);
|
||||
vec_safe_push (bb->succs, e);
|
||||
make_single_succ_edge (ENTRY_BLOCK_PTR, bb, EDGE_FALLTHRU);
|
||||
}
|
||||
}
|
||||
|
|
19
gcc/cgraph.c
19
gcc/cgraph.c
|
@ -1291,8 +1291,7 @@ cgraph_release_function_body (struct cgraph_node *node)
|
|||
free_histograms ();
|
||||
pop_cfun();
|
||||
gimple_set_body (node->symbol.decl, NULL);
|
||||
VEC_free (ipa_opt_pass, heap,
|
||||
node->ipa_transforms_to_apply);
|
||||
node->ipa_transforms_to_apply.release ();
|
||||
/* Struct function hangs a lot of data that would leak if we didn't
|
||||
removed all pointers to it. */
|
||||
ggc_free (DECL_STRUCT_FUNCTION (node->symbol.decl));
|
||||
|
@ -1317,8 +1316,7 @@ cgraph_remove_node (struct cgraph_node *node)
|
|||
cgraph_call_node_removal_hooks (node);
|
||||
cgraph_node_remove_callers (node);
|
||||
cgraph_node_remove_callees (node);
|
||||
VEC_free (ipa_opt_pass, heap,
|
||||
node->ipa_transforms_to_apply);
|
||||
node->ipa_transforms_to_apply.release ();
|
||||
|
||||
/* Incremental inlining access removed nodes stored in the postorder list.
|
||||
*/
|
||||
|
@ -2168,7 +2166,7 @@ cgraph_only_called_directly_p (struct cgraph_node *node)
|
|||
static bool
|
||||
collect_callers_of_node_1 (struct cgraph_node *node, void *data)
|
||||
{
|
||||
VEC (cgraph_edge_p, heap) ** redirect_callers = (VEC (cgraph_edge_p, heap) **)data;
|
||||
vec<cgraph_edge_p> *redirect_callers = (vec<cgraph_edge_p> *)data;
|
||||
struct cgraph_edge *cs;
|
||||
enum availability avail;
|
||||
cgraph_function_or_thunk_node (node, &avail);
|
||||
|
@ -2176,17 +2174,17 @@ collect_callers_of_node_1 (struct cgraph_node *node, void *data)
|
|||
if (avail > AVAIL_OVERWRITABLE)
|
||||
for (cs = node->callers; cs != NULL; cs = cs->next_caller)
|
||||
if (!cs->indirect_inlining_edge)
|
||||
VEC_safe_push (cgraph_edge_p, heap, *redirect_callers, cs);
|
||||
redirect_callers->safe_push (cs);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Collect all callers of NODE and its aliases that are known to lead to NODE
|
||||
(i.e. are not overwritable). */
|
||||
|
||||
VEC (cgraph_edge_p, heap) *
|
||||
vec<cgraph_edge_p>
|
||||
collect_callers_of_node (struct cgraph_node *node)
|
||||
{
|
||||
VEC (cgraph_edge_p, heap) * redirect_callers = NULL;
|
||||
vec<cgraph_edge_p> redirect_callers = vec<cgraph_edge_p>();
|
||||
cgraph_for_node_and_aliases (node, collect_callers_of_node_1,
|
||||
&redirect_callers, false);
|
||||
return redirect_callers;
|
||||
|
@ -2229,9 +2227,8 @@ verify_edge_count_and_frequency (struct cgraph_edge *e)
|
|||
/* FIXME: Inline-analysis sets frequency to 0 when edge is optimized out.
|
||||
Remove this once edges are actually removed from the function at that time. */
|
||||
&& (e->frequency
|
||||
|| (inline_edge_summary_vec
|
||||
&& ((VEC_length(inline_edge_summary_t, inline_edge_summary_vec)
|
||||
<= (unsigned) e->uid)
|
||||
|| (inline_edge_summary_vec.exists ()
|
||||
&& ((inline_edge_summary_vec.length () <= (unsigned) e->uid)
|
||||
|| !inline_edge_summary (e)->predicate)))
|
||||
&& (e->frequency
|
||||
!= compute_call_stmt_bb_frequency (e->caller->symbol.decl,
|
||||
|
|
59
gcc/cgraph.h
59
gcc/cgraph.h
|
@ -191,12 +191,10 @@ struct GTY(()) ipa_replace_map
|
|||
bool ref_p;
|
||||
};
|
||||
typedef struct ipa_replace_map *ipa_replace_map_p;
|
||||
DEF_VEC_P(ipa_replace_map_p);
|
||||
DEF_VEC_ALLOC_P(ipa_replace_map_p,gc);
|
||||
|
||||
struct GTY(()) cgraph_clone_info
|
||||
{
|
||||
VEC(ipa_replace_map_p,gc)* tree_map;
|
||||
vec<ipa_replace_map_p, va_gc> *tree_map;
|
||||
bitmap args_to_skip;
|
||||
bitmap combined_args_to_skip;
|
||||
};
|
||||
|
@ -238,7 +236,7 @@ struct GTY(()) cgraph_node {
|
|||
/* Interprocedural passes scheduled to have their transform functions
|
||||
applied next time we execute local pass on them. We maintain it
|
||||
per-function in order to allow IPA passes to introduce new functions. */
|
||||
VEC(ipa_opt_pass,heap) * GTY((skip)) ipa_transforms_to_apply;
|
||||
vec<ipa_opt_pass> GTY((skip)) ipa_transforms_to_apply;
|
||||
|
||||
struct cgraph_local_info local;
|
||||
struct cgraph_global_info global;
|
||||
|
@ -284,15 +282,9 @@ struct GTY(()) cgraph_node {
|
|||
unsigned dispatcher_function : 1;
|
||||
};
|
||||
|
||||
DEF_VEC_P(symtab_node);
|
||||
DEF_VEC_ALLOC_P(symtab_node,heap);
|
||||
DEF_VEC_ALLOC_P(symtab_node,gc);
|
||||
|
||||
typedef struct cgraph_node *cgraph_node_ptr;
|
||||
|
||||
DEF_VEC_P(cgraph_node_ptr);
|
||||
DEF_VEC_ALLOC_P(cgraph_node_ptr,heap);
|
||||
DEF_VEC_ALLOC_P(cgraph_node_ptr,gc);
|
||||
|
||||
/* Function Multiversioning info. */
|
||||
struct GTY(()) cgraph_function_version_info {
|
||||
|
@ -340,34 +332,25 @@ void delete_function_version (tree decl);
|
|||
struct cgraph_node_set_def
|
||||
{
|
||||
struct pointer_map_t *map;
|
||||
VEC(cgraph_node_ptr, heap) *nodes;
|
||||
vec<cgraph_node_ptr> nodes;
|
||||
};
|
||||
|
||||
typedef struct varpool_node *varpool_node_ptr;
|
||||
|
||||
DEF_VEC_P(varpool_node_ptr);
|
||||
DEF_VEC_ALLOC_P(varpool_node_ptr,heap);
|
||||
DEF_VEC_ALLOC_P(varpool_node_ptr,gc);
|
||||
|
||||
/* A varpool node set is a collection of varpool nodes. A varpool node
|
||||
can appear in multiple sets. */
|
||||
struct varpool_node_set_def
|
||||
{
|
||||
struct pointer_map_t * map;
|
||||
VEC(varpool_node_ptr, heap) *nodes;
|
||||
vec<varpool_node_ptr> nodes;
|
||||
};
|
||||
|
||||
typedef struct cgraph_node_set_def *cgraph_node_set;
|
||||
|
||||
DEF_VEC_P(cgraph_node_set);
|
||||
DEF_VEC_ALLOC_P(cgraph_node_set,gc);
|
||||
DEF_VEC_ALLOC_P(cgraph_node_set,heap);
|
||||
|
||||
typedef struct varpool_node_set_def *varpool_node_set;
|
||||
|
||||
DEF_VEC_P(varpool_node_set);
|
||||
DEF_VEC_ALLOC_P(varpool_node_set,gc);
|
||||
DEF_VEC_ALLOC_P(varpool_node_set,heap);
|
||||
|
||||
/* Iterator structure for cgraph node sets. */
|
||||
typedef struct
|
||||
|
@ -462,8 +445,6 @@ struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) cgrap
|
|||
|
||||
typedef struct cgraph_edge *cgraph_edge_p;
|
||||
|
||||
DEF_VEC_P(cgraph_edge_p);
|
||||
DEF_VEC_ALLOC_P(cgraph_edge_p,heap);
|
||||
|
||||
/* The varpool data structure.
|
||||
Each static variable decl has assigned varpool_node. */
|
||||
|
@ -640,7 +621,7 @@ bool cgraph_for_node_thunks_and_aliases (struct cgraph_node *,
|
|||
bool cgraph_for_node_and_aliases (struct cgraph_node *,
|
||||
bool (*) (struct cgraph_node *, void *),
|
||||
void *, bool);
|
||||
VEC (cgraph_edge_p, heap) * collect_callers_of_node (struct cgraph_node *node);
|
||||
vec<cgraph_edge_p> collect_callers_of_node (struct cgraph_node *node);
|
||||
void verify_cgraph (void);
|
||||
void verify_cgraph_node (struct cgraph_node *);
|
||||
void cgraph_mark_address_taken_node (struct cgraph_node *);
|
||||
|
@ -691,12 +672,12 @@ struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *,
|
|||
struct cgraph_node *, gimple,
|
||||
unsigned, gcov_type, int, bool);
|
||||
struct cgraph_node * cgraph_clone_node (struct cgraph_node *, tree, gcov_type,
|
||||
int, bool, VEC(cgraph_edge_p,heap) *,
|
||||
int, bool, vec<cgraph_edge_p>,
|
||||
bool);
|
||||
tree clone_function_name (tree decl, const char *);
|
||||
struct cgraph_node * cgraph_create_virtual_clone (struct cgraph_node *old_node,
|
||||
VEC(cgraph_edge_p,heap)*,
|
||||
VEC(ipa_replace_map_p,gc)* tree_map,
|
||||
vec<cgraph_edge_p>,
|
||||
vec<ipa_replace_map_p, va_gc> *tree_map,
|
||||
bitmap args_to_skip,
|
||||
const char *clone_name);
|
||||
struct cgraph_node *cgraph_find_replacement_node (struct cgraph_node *);
|
||||
|
@ -708,13 +689,13 @@ void cgraph_create_edge_including_clones (struct cgraph_node *,
|
|||
cgraph_inline_failed_t);
|
||||
void cgraph_materialize_all_clones (void);
|
||||
struct cgraph_node * cgraph_copy_node_for_versioning (struct cgraph_node *,
|
||||
tree, VEC(cgraph_edge_p,heap)*, bitmap);
|
||||
tree, vec<cgraph_edge_p>, bitmap);
|
||||
struct cgraph_node *cgraph_function_versioning (struct cgraph_node *,
|
||||
VEC(cgraph_edge_p,heap)*,
|
||||
VEC(ipa_replace_map_p,gc)*,
|
||||
vec<cgraph_edge_p>,
|
||||
vec<ipa_replace_map_p, va_gc> *,
|
||||
bitmap, bool, bitmap,
|
||||
basic_block, const char *);
|
||||
void tree_function_versioning (tree, tree, VEC (ipa_replace_map_p,gc)*,
|
||||
void tree_function_versioning (tree, tree, vec<ipa_replace_map_p, va_gc> *,
|
||||
bool, bitmap, bool, bitmap, basic_block);
|
||||
|
||||
/* In cgraphbuild.c */
|
||||
|
@ -1051,7 +1032,7 @@ tree add_new_static_var (tree type);
|
|||
static inline bool
|
||||
csi_end_p (cgraph_node_set_iterator csi)
|
||||
{
|
||||
return csi.index >= VEC_length (cgraph_node_ptr, csi.set->nodes);
|
||||
return csi.index >= csi.set->nodes.length ();
|
||||
}
|
||||
|
||||
/* Advance iterator CSI. */
|
||||
|
@ -1065,7 +1046,7 @@ csi_next (cgraph_node_set_iterator *csi)
|
|||
static inline struct cgraph_node *
|
||||
csi_node (cgraph_node_set_iterator csi)
|
||||
{
|
||||
return VEC_index (cgraph_node_ptr, csi.set->nodes, csi.index);
|
||||
return csi.set->nodes[csi.index];
|
||||
}
|
||||
|
||||
/* Return an iterator to the first node in SET. */
|
||||
|
@ -1092,14 +1073,14 @@ cgraph_node_in_set_p (struct cgraph_node *node, cgraph_node_set set)
|
|||
static inline size_t
|
||||
cgraph_node_set_size (cgraph_node_set set)
|
||||
{
|
||||
return VEC_length (cgraph_node_ptr, set->nodes);
|
||||
return set->nodes.length ();
|
||||
}
|
||||
|
||||
/* Return true if iterator VSI points to nothing. */
|
||||
static inline bool
|
||||
vsi_end_p (varpool_node_set_iterator vsi)
|
||||
{
|
||||
return vsi.index >= VEC_length (varpool_node_ptr, vsi.set->nodes);
|
||||
return vsi.index >= vsi.set->nodes.length ();
|
||||
}
|
||||
|
||||
/* Advance iterator VSI. */
|
||||
|
@ -1113,7 +1094,7 @@ vsi_next (varpool_node_set_iterator *vsi)
|
|||
static inline struct varpool_node *
|
||||
vsi_node (varpool_node_set_iterator vsi)
|
||||
{
|
||||
return VEC_index (varpool_node_ptr, vsi.set->nodes, vsi.index);
|
||||
return vsi.set->nodes[vsi.index];
|
||||
}
|
||||
|
||||
/* Return an iterator to the first node in SET. */
|
||||
|
@ -1140,7 +1121,7 @@ varpool_node_in_set_p (struct varpool_node *node, varpool_node_set set)
|
|||
static inline size_t
|
||||
varpool_node_set_size (varpool_node_set set)
|
||||
{
|
||||
return VEC_length (varpool_node_ptr, set->nodes);
|
||||
return set->nodes.length ();
|
||||
}
|
||||
|
||||
/* Uniquize all constants that appear in memory.
|
||||
|
@ -1164,14 +1145,14 @@ struct GTY(()) constant_descriptor_tree {
|
|||
static inline bool
|
||||
cgraph_node_set_nonempty_p (cgraph_node_set set)
|
||||
{
|
||||
return !VEC_empty (cgraph_node_ptr, set->nodes);
|
||||
return !set->nodes.is_empty ();
|
||||
}
|
||||
|
||||
/* Return true if set is nonempty. */
|
||||
static inline bool
|
||||
varpool_node_set_nonempty_p (varpool_node_set set)
|
||||
{
|
||||
return !VEC_empty (varpool_node_ptr, set->nodes);
|
||||
return !set->nodes.is_empty ();
|
||||
}
|
||||
|
||||
/* Return true when function NODE is only called directly or it has alias.
|
||||
|
|
|
@ -173,7 +173,7 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
|
|||
struct cgraph_node *
|
||||
cgraph_clone_node (struct cgraph_node *n, tree decl, gcov_type count, int freq,
|
||||
bool update_original,
|
||||
VEC(cgraph_edge_p,heap) *redirect_callers,
|
||||
vec<cgraph_edge_p> redirect_callers,
|
||||
bool call_duplication_hook)
|
||||
{
|
||||
struct cgraph_node *new_node = cgraph_create_empty_node ();
|
||||
|
@ -198,7 +198,7 @@ cgraph_clone_node (struct cgraph_node *n, tree decl, gcov_type count, int freq,
|
|||
new_node->count = count;
|
||||
new_node->frequency = n->frequency;
|
||||
new_node->clone = n->clone;
|
||||
new_node->clone.tree_map = 0;
|
||||
new_node->clone.tree_map = NULL;
|
||||
if (n->count)
|
||||
{
|
||||
if (new_node->count > n->count)
|
||||
|
@ -215,7 +215,7 @@ cgraph_clone_node (struct cgraph_node *n, tree decl, gcov_type count, int freq,
|
|||
n->count = 0;
|
||||
}
|
||||
|
||||
FOR_EACH_VEC_ELT (cgraph_edge_p, redirect_callers, i, e)
|
||||
FOR_EACH_VEC_ELT (redirect_callers, i, e)
|
||||
{
|
||||
/* Redirect calls to the old version node to point to its new
|
||||
version. */
|
||||
|
@ -276,8 +276,8 @@ clone_function_name (tree decl, const char *suffix)
|
|||
*/
|
||||
struct cgraph_node *
|
||||
cgraph_create_virtual_clone (struct cgraph_node *old_node,
|
||||
VEC(cgraph_edge_p,heap) *redirect_callers,
|
||||
VEC(ipa_replace_map_p,gc) *tree_map,
|
||||
vec<cgraph_edge_p> redirect_callers,
|
||||
vec<ipa_replace_map_p, va_gc> *tree_map,
|
||||
bitmap args_to_skip,
|
||||
const char * suffix)
|
||||
{
|
||||
|
@ -323,7 +323,7 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
|
|||
DECL_STATIC_DESTRUCTOR (new_node->symbol.decl) = 0;
|
||||
new_node->clone.tree_map = tree_map;
|
||||
new_node->clone.args_to_skip = args_to_skip;
|
||||
FOR_EACH_VEC_ELT (ipa_replace_map_p, tree_map, i, map)
|
||||
FOR_EACH_VEC_SAFE_ELT (tree_map, i, map)
|
||||
{
|
||||
tree var = map->new_tree;
|
||||
symtab_node ref_node;
|
||||
|
@ -615,7 +615,7 @@ update_call_expr (struct cgraph_node *new_version)
|
|||
struct cgraph_node *
|
||||
cgraph_copy_node_for_versioning (struct cgraph_node *old_version,
|
||||
tree new_decl,
|
||||
VEC(cgraph_edge_p,heap) *redirect_callers,
|
||||
vec<cgraph_edge_p> redirect_callers,
|
||||
bitmap bbs_to_copy)
|
||||
{
|
||||
struct cgraph_node *new_version;
|
||||
|
@ -648,7 +648,7 @@ cgraph_copy_node_for_versioning (struct cgraph_node *old_version,
|
|||
e->lto_stmt_uid, REG_BR_PROB_BASE,
|
||||
CGRAPH_FREQ_BASE,
|
||||
true);
|
||||
FOR_EACH_VEC_ELT (cgraph_edge_p, redirect_callers, i, e)
|
||||
FOR_EACH_VEC_ELT (redirect_callers, i, e)
|
||||
{
|
||||
/* Redirect calls to the old version node to point to its new
|
||||
version. */
|
||||
|
@ -682,8 +682,8 @@ cgraph_copy_node_for_versioning (struct cgraph_node *old_version,
|
|||
|
||||
struct cgraph_node *
|
||||
cgraph_function_versioning (struct cgraph_node *old_version_node,
|
||||
VEC(cgraph_edge_p,heap) *redirect_callers,
|
||||
VEC (ipa_replace_map_p,gc)* tree_map,
|
||||
vec<cgraph_edge_p> redirect_callers,
|
||||
vec<ipa_replace_map_p, va_gc> *tree_map,
|
||||
bitmap args_to_skip,
|
||||
bool skip_return,
|
||||
bitmap bbs_to_copy,
|
||||
|
@ -822,14 +822,12 @@ cgraph_materialize_all_clones (void)
|
|||
{
|
||||
unsigned int i;
|
||||
fprintf (cgraph_dump_file, " replace map: ");
|
||||
for (i = 0; i < VEC_length (ipa_replace_map_p,
|
||||
node->clone.tree_map);
|
||||
i++)
|
||||
for (i = 0;
|
||||
i < vec_safe_length (node->clone.tree_map);
|
||||
i++)
|
||||
{
|
||||
struct ipa_replace_map *replace_info;
|
||||
replace_info = VEC_index (ipa_replace_map_p,
|
||||
node->clone.tree_map,
|
||||
i);
|
||||
replace_info = (*node->clone.tree_map)[i];
|
||||
print_generic_expr (cgraph_dump_file, replace_info->old_tree, 0);
|
||||
fprintf (cgraph_dump_file, " -> ");
|
||||
print_generic_expr (cgraph_dump_file, replace_info->new_tree, 0);
|
||||
|
|
|
@ -610,7 +610,7 @@ cgraph_analyze_function (struct cgraph_node *node)
|
|||
input_location = saved_loc;
|
||||
return;
|
||||
}
|
||||
if (!VEC_length (ipa_ref_t, node->symbol.ref_list.references))
|
||||
if (!vec_safe_length (node->symbol.ref_list.references))
|
||||
ipa_record_reference ((symtab_node)node, (symtab_node)tgt,
|
||||
IPA_REF_ALIAS, NULL);
|
||||
if (node->same_body_alias)
|
||||
|
@ -695,7 +695,7 @@ cgraph_process_same_body_aliases (void)
|
|||
struct cgraph_node *node;
|
||||
FOR_EACH_FUNCTION (node)
|
||||
if (node->same_body_alias
|
||||
&& !VEC_length (ipa_ref_t, node->symbol.ref_list.references))
|
||||
&& !vec_safe_length (node->symbol.ref_list.references))
|
||||
{
|
||||
struct cgraph_node *tgt = cgraph_get_node (node->thunk.alias);
|
||||
ipa_record_reference ((symtab_node)node, (symtab_node)tgt,
|
||||
|
@ -1060,7 +1060,7 @@ handle_alias_pairs (void)
|
|||
alias_pair *p;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; VEC_iterate (alias_pair, alias_pairs, i, p);)
|
||||
for (i = 0; alias_pairs && alias_pairs->iterate (i, &p);)
|
||||
{
|
||||
symtab_node target_node = symtab_node_for_asm (p->target);
|
||||
|
||||
|
@ -1074,13 +1074,13 @@ handle_alias_pairs (void)
|
|||
else
|
||||
varpool_get_node (p->decl)->alias = true;
|
||||
DECL_EXTERNAL (p->decl) = 1;
|
||||
VEC_unordered_remove (alias_pair, alias_pairs, i);
|
||||
alias_pairs->unordered_remove (i);
|
||||
continue;
|
||||
}
|
||||
else if (!target_node)
|
||||
{
|
||||
error ("%q+D aliased to undefined symbol %qE", p->decl, p->target);
|
||||
VEC_unordered_remove (alias_pair, alias_pairs, i);
|
||||
alias_pairs->unordered_remove (i);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1113,13 +1113,13 @@ handle_alias_pairs (void)
|
|||
if (src_node && src_node->local.finalized)
|
||||
cgraph_reset_node (src_node);
|
||||
cgraph_create_function_alias (p->decl, target_node->symbol.decl);
|
||||
VEC_unordered_remove (alias_pair, alias_pairs, i);
|
||||
alias_pairs->unordered_remove (i);
|
||||
}
|
||||
else if (TREE_CODE (p->decl) == VAR_DECL
|
||||
&& target_node && is_a <varpool_node> (target_node))
|
||||
{
|
||||
varpool_create_variable_alias (p->decl, target_node->symbol.decl);
|
||||
VEC_unordered_remove (alias_pair, alias_pairs, i);
|
||||
alias_pairs->unordered_remove (i);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1127,10 +1127,10 @@ handle_alias_pairs (void)
|
|||
p->decl);
|
||||
warning (0, "%q+D aliased declaration",
|
||||
target_node->symbol.decl);
|
||||
VEC_unordered_remove (alias_pair, alias_pairs, i);
|
||||
alias_pairs->unordered_remove (i);
|
||||
}
|
||||
}
|
||||
VEC_free (alias_pair, gc, alias_pairs);
|
||||
vec_free (alias_pairs);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1440,7 +1440,7 @@ assemble_thunk (struct cgraph_node *node)
|
|||
int i;
|
||||
tree resdecl;
|
||||
tree restmp = NULL;
|
||||
VEC(tree, heap) *vargs;
|
||||
vec<tree> vargs;
|
||||
|
||||
gimple call;
|
||||
gimple ret;
|
||||
|
@ -1482,18 +1482,16 @@ assemble_thunk (struct cgraph_node *node)
|
|||
|
||||
for (arg = a; arg; arg = DECL_CHAIN (arg))
|
||||
nargs++;
|
||||
vargs = VEC_alloc (tree, heap, nargs);
|
||||
vargs.create (nargs);
|
||||
if (this_adjusting)
|
||||
VEC_quick_push (tree, vargs,
|
||||
thunk_adjust (&bsi,
|
||||
a, 1, fixed_offset,
|
||||
virtual_offset));
|
||||
vargs.quick_push (thunk_adjust (&bsi, a, 1, fixed_offset,
|
||||
virtual_offset));
|
||||
else
|
||||
VEC_quick_push (tree, vargs, a);
|
||||
vargs.quick_push (a);
|
||||
for (i = 1, arg = DECL_CHAIN (a); i < nargs; i++, arg = DECL_CHAIN (arg))
|
||||
VEC_quick_push (tree, vargs, arg);
|
||||
vargs.quick_push (arg);
|
||||
call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
|
||||
VEC_free (tree, heap, vargs);
|
||||
vargs.release ();
|
||||
gimple_call_set_from_thunk (call, true);
|
||||
if (restmp)
|
||||
gimple_call_set_lhs (call, restmp);
|
||||
|
|
|
@ -252,10 +252,8 @@ typedef struct reg_stat_struct {
|
|||
ENUM_BITFIELD(machine_mode) truncated_to_mode : 8;
|
||||
} reg_stat_type;
|
||||
|
||||
DEF_VEC_O(reg_stat_type);
|
||||
DEF_VEC_ALLOC_O(reg_stat_type,heap);
|
||||
|
||||
static VEC(reg_stat_type,heap) *reg_stat;
|
||||
static vec<reg_stat_type> reg_stat;
|
||||
|
||||
/* Record the luid of the last insn that invalidated memory
|
||||
(anything that writes memory, and subroutine calls, but not pushes). */
|
||||
|
@ -510,8 +508,8 @@ combine_split_insns (rtx pattern, rtx insn)
|
|||
|
||||
ret = split_insns (pattern, insn);
|
||||
nregs = max_reg_num ();
|
||||
if (nregs > VEC_length (reg_stat_type, reg_stat))
|
||||
VEC_safe_grow_cleared (reg_stat_type, heap, reg_stat, nregs);
|
||||
if (nregs > reg_stat.length ())
|
||||
reg_stat.safe_grow_cleared (nregs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1121,7 +1119,7 @@ combine_instructions (rtx f, unsigned int nregs)
|
|||
|
||||
rtl_hooks = combine_rtl_hooks;
|
||||
|
||||
VEC_safe_grow_cleared (reg_stat_type, heap, reg_stat, nregs);
|
||||
reg_stat.safe_grow_cleared (nregs);
|
||||
|
||||
init_recog_no_volatile ();
|
||||
|
||||
|
@ -1446,7 +1444,7 @@ combine_instructions (rtx f, unsigned int nregs)
|
|||
obstack_free (&insn_link_obstack, NULL);
|
||||
free (uid_log_links);
|
||||
free (uid_insn_cost);
|
||||
VEC_free (reg_stat_type, heap, reg_stat);
|
||||
reg_stat.release ();
|
||||
|
||||
{
|
||||
struct undo *undo, *next;
|
||||
|
@ -1480,7 +1478,7 @@ init_reg_last (void)
|
|||
unsigned int i;
|
||||
reg_stat_type *p;
|
||||
|
||||
FOR_EACH_VEC_ELT (reg_stat_type, reg_stat, i, p)
|
||||
FOR_EACH_VEC_ELT (reg_stat, i, p)
|
||||
memset (p, 0, offsetof (reg_stat_type, sign_bit_copies));
|
||||
}
|
||||
|
||||
|
@ -1587,7 +1585,7 @@ set_nonzero_bits_and_sign_copies (rtx x, const_rtx set, void *data)
|
|||
(DF_LR_IN (ENTRY_BLOCK_PTR->next_bb), REGNO (x))
|
||||
&& HWI_COMPUTABLE_MODE_P (GET_MODE (x)))
|
||||
{
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
reg_stat_type *rsp = ®_stat[REGNO (x)];
|
||||
|
||||
if (set == 0 || GET_CODE (set) == CLOBBER)
|
||||
{
|
||||
|
@ -3637,22 +3635,18 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
|
|||
&& GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != STRICT_LOW_PART
|
||||
&& ! (temp = SET_DEST (XVECEXP (newpat, 0, 1)),
|
||||
(REG_P (temp)
|
||||
&& VEC_index (reg_stat_type, reg_stat,
|
||||
REGNO (temp)).nonzero_bits != 0
|
||||
&& reg_stat[REGNO (temp)].nonzero_bits != 0
|
||||
&& GET_MODE_PRECISION (GET_MODE (temp)) < BITS_PER_WORD
|
||||
&& GET_MODE_PRECISION (GET_MODE (temp)) < HOST_BITS_PER_INT
|
||||
&& (VEC_index (reg_stat_type, reg_stat,
|
||||
REGNO (temp)).nonzero_bits
|
||||
&& (reg_stat[REGNO (temp)].nonzero_bits
|
||||
!= GET_MODE_MASK (word_mode))))
|
||||
&& ! (GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) == SUBREG
|
||||
&& (temp = SUBREG_REG (SET_DEST (XVECEXP (newpat, 0, 1))),
|
||||
(REG_P (temp)
|
||||
&& VEC_index (reg_stat_type, reg_stat,
|
||||
REGNO (temp)).nonzero_bits != 0
|
||||
&& reg_stat[REGNO (temp)].nonzero_bits != 0
|
||||
&& GET_MODE_PRECISION (GET_MODE (temp)) < BITS_PER_WORD
|
||||
&& GET_MODE_PRECISION (GET_MODE (temp)) < HOST_BITS_PER_INT
|
||||
&& (VEC_index (reg_stat_type, reg_stat,
|
||||
REGNO (temp)).nonzero_bits
|
||||
&& (reg_stat[REGNO (temp)].nonzero_bits
|
||||
!= GET_MODE_MASK (word_mode)))))
|
||||
&& ! reg_overlap_mentioned_p (SET_DEST (XVECEXP (newpat, 0, 1)),
|
||||
SET_SRC (XVECEXP (newpat, 0, 1)))
|
||||
|
@ -9413,7 +9407,7 @@ reg_nonzero_bits_for_combine (const_rtx x, enum machine_mode mode,
|
|||
value. Otherwise, use the previously-computed global nonzero bits
|
||||
for this register. */
|
||||
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
rsp = ®_stat[REGNO (x)];
|
||||
if (rsp->last_set_value != 0
|
||||
&& (rsp->last_set_mode == mode
|
||||
|| (GET_MODE_CLASS (rsp->last_set_mode) == MODE_INT
|
||||
|
@ -9482,7 +9476,7 @@ reg_num_sign_bit_copies_for_combine (const_rtx x, enum machine_mode mode,
|
|||
rtx tem;
|
||||
reg_stat_type *rsp;
|
||||
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
rsp = ®_stat[REGNO (x)];
|
||||
if (rsp->last_set_value != 0
|
||||
&& rsp->last_set_mode == mode
|
||||
&& ((rsp->last_set_label >= label_tick_ebb_start
|
||||
|
@ -12046,7 +12040,7 @@ update_table_tick (rtx x)
|
|||
|
||||
for (r = regno; r < endregno; r++)
|
||||
{
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, r);
|
||||
reg_stat_type *rsp = ®_stat[r];
|
||||
rsp->last_set_table_tick = label_tick;
|
||||
}
|
||||
|
||||
|
@ -12148,7 +12142,7 @@ record_value_for_reg (rtx reg, rtx insn, rtx value)
|
|||
register. */
|
||||
for (i = regno; i < endregno; i++)
|
||||
{
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp = ®_stat[i];
|
||||
|
||||
if (insn)
|
||||
rsp->last_set = insn;
|
||||
|
@ -12174,7 +12168,7 @@ record_value_for_reg (rtx reg, rtx insn, rtx value)
|
|||
|
||||
for (i = regno; i < endregno; i++)
|
||||
{
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp = ®_stat[i];
|
||||
rsp->last_set_label = label_tick;
|
||||
if (!insn
|
||||
|| (value && rsp->last_set_table_tick >= label_tick_ebb_start))
|
||||
|
@ -12186,7 +12180,7 @@ record_value_for_reg (rtx reg, rtx insn, rtx value)
|
|||
/* The value being assigned might refer to X (like in "x++;"). In that
|
||||
case, we must replace it with (clobber (const_int 0)) to prevent
|
||||
infinite loops. */
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, regno);
|
||||
rsp = ®_stat[regno];
|
||||
if (value && !get_last_value_validate (&value, insn, label_tick, 0))
|
||||
{
|
||||
value = copy_rtx (value);
|
||||
|
@ -12284,7 +12278,7 @@ record_dead_and_set_regs (rtx insn)
|
|||
{
|
||||
reg_stat_type *rsp;
|
||||
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp = ®_stat[i];
|
||||
rsp->last_death = insn;
|
||||
}
|
||||
}
|
||||
|
@ -12299,7 +12293,7 @@ record_dead_and_set_regs (rtx insn)
|
|||
{
|
||||
reg_stat_type *rsp;
|
||||
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp = ®_stat[i];
|
||||
rsp->last_set_invalid = 1;
|
||||
rsp->last_set = insn;
|
||||
rsp->last_set_value = 0;
|
||||
|
@ -12357,7 +12351,7 @@ record_promoted_value (rtx insn, rtx subreg)
|
|||
continue;
|
||||
}
|
||||
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, regno);
|
||||
rsp = ®_stat[regno];
|
||||
if (rsp->last_set == insn)
|
||||
{
|
||||
if (SUBREG_PROMOTED_UNSIGNED_P (subreg) > 0)
|
||||
|
@ -12382,7 +12376,7 @@ record_promoted_value (rtx insn, rtx subreg)
|
|||
static bool
|
||||
reg_truncated_to_mode (enum machine_mode mode, const_rtx x)
|
||||
{
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
reg_stat_type *rsp = ®_stat[REGNO (x)];
|
||||
enum machine_mode truncated = rsp->truncated_to_mode;
|
||||
|
||||
if (truncated == 0
|
||||
|
@ -12427,7 +12421,7 @@ record_truncated_value (rtx *p, void *data ATTRIBUTE_UNUSED)
|
|||
else
|
||||
return 0;
|
||||
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
rsp = ®_stat[REGNO (x)];
|
||||
if (rsp->truncated_to_mode == 0
|
||||
|| rsp->truncation_label < label_tick_ebb_start
|
||||
|| (GET_MODE_SIZE (truncated_mode)
|
||||
|
@ -12506,7 +12500,7 @@ get_last_value_validate (rtx *loc, rtx insn, int tick, int replace)
|
|||
|
||||
for (j = regno; j < endregno; j++)
|
||||
{
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, j);
|
||||
reg_stat_type *rsp = ®_stat[j];
|
||||
if (rsp->last_set_invalid
|
||||
/* If this is a pseudo-register that was only set once and not
|
||||
live at the beginning of the function, it is always valid. */
|
||||
|
@ -12610,7 +12604,7 @@ get_last_value (const_rtx x)
|
|||
return 0;
|
||||
|
||||
regno = REGNO (x);
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, regno);
|
||||
rsp = ®_stat[regno];
|
||||
value = rsp->last_set_value;
|
||||
|
||||
/* If we don't have a value, or if it isn't for this basic block and
|
||||
|
@ -12674,7 +12668,7 @@ use_crosses_set_p (const_rtx x, int from_luid)
|
|||
#endif
|
||||
for (; regno < endreg; regno++)
|
||||
{
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, regno);
|
||||
reg_stat_type *rsp = ®_stat[regno];
|
||||
if (rsp->last_set
|
||||
&& rsp->last_set_label == label_tick
|
||||
&& DF_INSN_LUID (rsp->last_set) > from_luid)
|
||||
|
@ -12920,7 +12914,7 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_luid, rtx to_insn,
|
|||
if (code == REG)
|
||||
{
|
||||
unsigned int regno = REGNO (x);
|
||||
rtx where_dead = VEC_index (reg_stat_type, reg_stat, regno).last_death;
|
||||
rtx where_dead = reg_stat[regno].last_death;
|
||||
|
||||
/* Don't move the register if it gets killed in between from and to. */
|
||||
if (maybe_kill_insn && reg_set_p (x, maybe_kill_insn)
|
||||
|
@ -13535,7 +13529,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2, rtx elim_i2,
|
|||
if (place && REG_NOTE_KIND (note) == REG_DEAD)
|
||||
{
|
||||
unsigned int regno = REGNO (XEXP (note, 0));
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, regno);
|
||||
reg_stat_type *rsp = ®_stat[regno];
|
||||
|
||||
if (dead_or_set_p (place, XEXP (note, 0))
|
||||
|| reg_bitfield_target_p (XEXP (note, 0), PATTERN (place)))
|
||||
|
|
|
@ -120,10 +120,8 @@ struct comparison
|
|||
};
|
||||
|
||||
typedef struct comparison *comparison_struct_p;
|
||||
DEF_VEC_P(comparison_struct_p);
|
||||
DEF_VEC_ALLOC_P(comparison_struct_p, heap);
|
||||
|
||||
static VEC(comparison_struct_p, heap) *all_compares;
|
||||
static vec<comparison_struct_p> all_compares;
|
||||
|
||||
/* Look for a "conforming" comparison, as defined above. If valid, return
|
||||
the rtx for the COMPARE itself. */
|
||||
|
@ -337,7 +335,7 @@ find_comparisons_in_bb (struct dom_walk_data *data ATTRIBUTE_UNUSED,
|
|||
last_cmp->in_a = XEXP (src, 0);
|
||||
last_cmp->in_b = XEXP (src, 1);
|
||||
last_cmp->orig_mode = src_mode;
|
||||
VEC_safe_push (comparison_struct_p, heap, all_compares, last_cmp);
|
||||
all_compares.safe_push (last_cmp);
|
||||
|
||||
/* It's unusual, but be prepared for comparison patterns that
|
||||
also clobber an input, or perhaps a scratch. */
|
||||
|
@ -623,24 +621,23 @@ execute_compare_elim_after_reload (void)
|
|||
{
|
||||
df_analyze ();
|
||||
|
||||
gcc_checking_assert (all_compares == NULL);
|
||||
gcc_checking_assert (!all_compares.exists ());
|
||||
|
||||
/* Locate all comparisons and their uses, and eliminate duplicates. */
|
||||
find_comparisons ();
|
||||
if (all_compares)
|
||||
if (all_compares.exists ())
|
||||
{
|
||||
struct comparison *cmp;
|
||||
size_t i;
|
||||
|
||||
/* Eliminate comparisons that are redundant with flags computation. */
|
||||
FOR_EACH_VEC_ELT (comparison_struct_p, all_compares, i, cmp)
|
||||
FOR_EACH_VEC_ELT (all_compares, i, cmp)
|
||||
{
|
||||
try_eliminate_compare (cmp);
|
||||
XDELETE (cmp);
|
||||
}
|
||||
|
||||
VEC_free (comparison_struct_p, heap, all_compares);
|
||||
all_compares = NULL;
|
||||
all_compares.release ();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -3480,8 +3480,8 @@ hwloop_optimize (hwloop_info loop)
|
|||
insn = BB_END (loop->incoming_src);
|
||||
/* If we have to insert the LSETUP before a jump, count that jump in the
|
||||
length. */
|
||||
if (VEC_length (edge, loop->incoming) > 1
|
||||
|| !(VEC_last (edge, loop->incoming)->flags & EDGE_FALLTHRU))
|
||||
if (vec_safe_length (loop->incoming) > 1
|
||||
|| !(loop->incoming->last ()->flags & EDGE_FALLTHRU))
|
||||
{
|
||||
gcc_assert (JUMP_P (insn));
|
||||
insn = PREV_INSN (insn);
|
||||
|
@ -3749,8 +3749,8 @@ hwloop_optimize (hwloop_info loop)
|
|||
if (loop->incoming_src)
|
||||
{
|
||||
rtx prev = BB_END (loop->incoming_src);
|
||||
if (VEC_length (edge, loop->incoming) > 1
|
||||
|| !(VEC_last (edge, loop->incoming)->flags & EDGE_FALLTHRU))
|
||||
if (vec_safe_length (loop->incoming) > 1
|
||||
|| !(loop->incoming->last ()->flags & EDGE_FALLTHRU))
|
||||
{
|
||||
gcc_assert (JUMP_P (prev));
|
||||
prev = PREV_INSN (prev);
|
||||
|
|
|
@ -119,14 +119,12 @@ typedef struct
|
|||
unsigned int unit_mask;
|
||||
} c6x_sched_insn_info;
|
||||
|
||||
DEF_VEC_O(c6x_sched_insn_info);
|
||||
DEF_VEC_ALLOC_O(c6x_sched_insn_info, heap);
|
||||
|
||||
/* Record a c6x_sched_insn_info structure for every insn in the function. */
|
||||
static VEC(c6x_sched_insn_info, heap) *insn_info;
|
||||
static vec<c6x_sched_insn_info> insn_info;
|
||||
|
||||
#define INSN_INFO_LENGTH (VEC_length (c6x_sched_insn_info, insn_info))
|
||||
#define INSN_INFO_ENTRY(N) (VEC_index (c6x_sched_insn_info, insn_info, (N)))
|
||||
#define INSN_INFO_LENGTH (insn_info).length ()
|
||||
#define INSN_INFO_ENTRY(N) (insn_info[(N)])
|
||||
|
||||
static bool done_cfi_sections;
|
||||
|
||||
|
@ -1971,7 +1969,7 @@ c6x_get_unit_specifier (rtx insn)
|
|||
{
|
||||
enum attr_units units;
|
||||
|
||||
if (insn_info)
|
||||
if (insn_info.exists ())
|
||||
{
|
||||
int unit = INSN_INFO_ENTRY (INSN_UID (insn)).reservation;
|
||||
return c6x_unit_names[unit][0];
|
||||
|
@ -2023,7 +2021,7 @@ c6x_print_unit_specifier_field (FILE *file, rtx insn)
|
|||
return;
|
||||
}
|
||||
|
||||
if (insn_info)
|
||||
if (insn_info.exists ())
|
||||
{
|
||||
int unit = INSN_INFO_ENTRY (INSN_UID (insn)).reservation;
|
||||
fputs (".", file);
|
||||
|
@ -3422,7 +3420,7 @@ try_rename_operands (rtx head, rtx tail, unit_req_table reqs, rtx insn,
|
|||
int i;
|
||||
unsigned tmp_mask;
|
||||
int best_reg, old_reg;
|
||||
VEC (du_head_p, heap) *involved_chains = NULL;
|
||||
vec<du_head_p> involved_chains = vec<du_head_p>();
|
||||
unit_req_table new_reqs;
|
||||
|
||||
for (i = 0, tmp_mask = op_mask; tmp_mask; i++)
|
||||
|
@ -3433,14 +3431,14 @@ try_rename_operands (rtx head, rtx tail, unit_req_table reqs, rtx insn,
|
|||
if (info->op_info[i].n_chains != 1)
|
||||
goto out_fail;
|
||||
op_chain = regrename_chain_from_id (info->op_info[i].heads[0]->id);
|
||||
VEC_safe_push (du_head_p, heap, involved_chains, op_chain);
|
||||
involved_chains.safe_push (op_chain);
|
||||
tmp_mask &= ~(1 << i);
|
||||
}
|
||||
|
||||
if (VEC_length (du_head_p, involved_chains) > 1)
|
||||
if (involved_chains.length () > 1)
|
||||
goto out_fail;
|
||||
|
||||
this_head = VEC_index (du_head_p, involved_chains, 0);
|
||||
this_head = involved_chains[0];
|
||||
if (this_head->cannot_rename)
|
||||
goto out_fail;
|
||||
|
||||
|
@ -3448,8 +3446,7 @@ try_rename_operands (rtx head, rtx tail, unit_req_table reqs, rtx insn,
|
|||
{
|
||||
unsigned int mask1, mask2, mask_changed;
|
||||
int count, side1, side2, req1, req2;
|
||||
insn_rr_info *this_rr = &VEC_index (insn_rr_info, insn_rr,
|
||||
INSN_UID (chain->insn));
|
||||
insn_rr_info *this_rr = &insn_rr[INSN_UID (chain->insn)];
|
||||
|
||||
count = get_unit_reqs (chain->insn, &req1, &side1, &req2, &side2);
|
||||
|
||||
|
@ -3508,7 +3505,7 @@ try_rename_operands (rtx head, rtx tail, unit_req_table reqs, rtx insn,
|
|||
memcpy (reqs, new_reqs, sizeof (unit_req_table));
|
||||
|
||||
out_fail:
|
||||
VEC_free (du_head_p, heap, involved_chains);
|
||||
involved_chains.release ();
|
||||
}
|
||||
|
||||
/* Find insns in LOOP which would, if shifted to the other side
|
||||
|
@ -3555,7 +3552,7 @@ reshuffle_units (basic_block loop)
|
|||
if (!get_unit_operand_masks (insn, &mask1, &mask2))
|
||||
continue;
|
||||
|
||||
info = &VEC_index (insn_rr_info, insn_rr, INSN_UID (insn));
|
||||
info = &insn_rr[INSN_UID (insn)];
|
||||
if (info->op_info == NULL)
|
||||
continue;
|
||||
|
||||
|
@ -3707,7 +3704,7 @@ insn_set_clock (rtx insn, int cycle)
|
|||
unsigned uid = INSN_UID (insn);
|
||||
|
||||
if (uid >= INSN_INFO_LENGTH)
|
||||
VEC_safe_grow (c6x_sched_insn_info, heap, insn_info, uid * 5 / 4 + 10);
|
||||
insn_info.safe_grow (uid * 5 / 4 + 10);
|
||||
|
||||
INSN_INFO_ENTRY (uid).clock = cycle;
|
||||
INSN_INFO_ENTRY (uid).new_cond = NULL;
|
||||
|
@ -4361,7 +4358,7 @@ c6x_variable_issue (FILE *dump ATTRIBUTE_UNUSED,
|
|||
ss.last_scheduled_iter0 = insn;
|
||||
if (GET_CODE (PATTERN (insn)) != USE && GET_CODE (PATTERN (insn)) != CLOBBER)
|
||||
ss.issued_this_cycle++;
|
||||
if (insn_info)
|
||||
if (insn_info.exists ())
|
||||
{
|
||||
state_t st_after = alloca (dfa_state_size);
|
||||
int curr_clock = ss.curr_sched_clock;
|
||||
|
@ -5537,7 +5534,7 @@ hwloop_optimize (hwloop_info loop)
|
|||
gcc_assert (loop->incoming_dest == loop->head);
|
||||
|
||||
entry_edge = NULL;
|
||||
FOR_EACH_VEC_ELT (edge, loop->incoming, i, entry_edge)
|
||||
FOR_EACH_VEC_SAFE_ELT (loop->incoming, i, entry_edge)
|
||||
if (entry_edge->flags & EDGE_FALLTHRU)
|
||||
break;
|
||||
if (entry_edge == NULL)
|
||||
|
@ -5777,7 +5774,7 @@ hwloop_optimize (hwloop_info loop)
|
|||
|
||||
seq = get_insns ();
|
||||
|
||||
if (!single_succ_p (entry_bb) || VEC_length (edge, loop->incoming) > 1)
|
||||
if (!single_succ_p (entry_bb) || vec_safe_length (loop->incoming) > 1)
|
||||
{
|
||||
basic_block new_bb;
|
||||
edge e;
|
||||
|
@ -5809,7 +5806,7 @@ hwloop_optimize (hwloop_info loop)
|
|||
end_sequence ();
|
||||
|
||||
/* Make sure we don't try to schedule this loop again. */
|
||||
for (ix = 0; VEC_iterate (basic_block, loop->blocks, ix, bb); ix++)
|
||||
for (ix = 0; loop->blocks.iterate (ix, &bb); ix++)
|
||||
bb->flags |= BB_DISABLE_SCHEDULE;
|
||||
|
||||
return true;
|
||||
|
@ -5928,7 +5925,7 @@ c6x_reorg (void)
|
|||
{
|
||||
int sz = get_max_uid () * 3 / 2 + 1;
|
||||
|
||||
insn_info = VEC_alloc (c6x_sched_insn_info, heap, sz);
|
||||
insn_info.create (sz);
|
||||
}
|
||||
|
||||
/* Make sure the real-jump insns we create are not deleted. When modulo-
|
||||
|
@ -5993,9 +5990,7 @@ c6x_function_end (FILE *file, const char *fname)
|
|||
{
|
||||
c6x_output_fn_unwind (file);
|
||||
|
||||
if (insn_info)
|
||||
VEC_free (c6x_sched_insn_info, heap, insn_info);
|
||||
insn_info = NULL;
|
||||
insn_info.release ();
|
||||
|
||||
if (!flag_inhibit_size_directive)
|
||||
ASM_OUTPUT_MEASURED_SIZE (file, fname);
|
||||
|
|
|
@ -1791,10 +1791,8 @@ static unsigned int lto_section_num = 0;
|
|||
typedef struct GTY (()) darwin_lto_section_e {
|
||||
const char *sectname;
|
||||
} darwin_lto_section_e ;
|
||||
DEF_VEC_O(darwin_lto_section_e);
|
||||
DEF_VEC_ALLOC_O(darwin_lto_section_e, gc);
|
||||
|
||||
static GTY (()) VEC (darwin_lto_section_e, gc) * lto_section_names;
|
||||
static GTY (()) vec<darwin_lto_section_e, va_gc> *lto_section_names;
|
||||
|
||||
/* Segment for LTO data. */
|
||||
#define LTO_SEGMENT_NAME "__GNU_LTO"
|
||||
|
@ -1877,8 +1875,8 @@ darwin_asm_named_section (const char *name,
|
|||
TODO: check that we do not revisit sections, that would break
|
||||
the assumption of how this is done. */
|
||||
if (lto_section_names == NULL)
|
||||
lto_section_names = VEC_alloc (darwin_lto_section_e, gc, 16);
|
||||
VEC_safe_push (darwin_lto_section_e, gc, lto_section_names, e);
|
||||
vec_alloc (lto_section_names, 16);
|
||||
vec_safe_push (lto_section_names, e);
|
||||
}
|
||||
else if (strncmp (name, "__DWARF,", 8) == 0)
|
||||
darwin_asm_dwarf_section (name, flags, decl);
|
||||
|
@ -2635,7 +2633,7 @@ darwin_assemble_visibility (tree decl, int vis)
|
|||
"not supported in this configuration; ignored");
|
||||
}
|
||||
|
||||
/* VEC Used by darwin_asm_dwarf_section.
|
||||
/* vec used by darwin_asm_dwarf_section.
|
||||
Maybe a hash tab would be better here - but the intention is that this is
|
||||
a very short list (fewer than 16 items) and each entry should (ideally,
|
||||
eventually) only be presented once.
|
||||
|
@ -2648,11 +2646,9 @@ typedef struct GTY(()) dwarf_sect_used_entry {
|
|||
}
|
||||
dwarf_sect_used_entry;
|
||||
|
||||
DEF_VEC_O(dwarf_sect_used_entry);
|
||||
DEF_VEC_ALLOC_O(dwarf_sect_used_entry, gc);
|
||||
|
||||
/* A list of used __DWARF sections. */
|
||||
static GTY (()) VEC (dwarf_sect_used_entry, gc) * dwarf_sect_names_table;
|
||||
static GTY (()) vec<dwarf_sect_used_entry, va_gc> *dwarf_sect_names_table;
|
||||
|
||||
/* This is called when we are asked to assemble a named section and the
|
||||
name begins with __DWARF,. We keep a list of the section names (without
|
||||
|
@ -2675,10 +2671,10 @@ darwin_asm_dwarf_section (const char *name, unsigned int flags,
|
|||
namelen = strchr (sname, ',') - sname;
|
||||
gcc_assert (namelen);
|
||||
if (dwarf_sect_names_table == NULL)
|
||||
dwarf_sect_names_table = VEC_alloc (dwarf_sect_used_entry, gc, 16);
|
||||
vec_alloc (dwarf_sect_names_table, 16);
|
||||
else
|
||||
for (i = 0;
|
||||
VEC_iterate (dwarf_sect_used_entry, dwarf_sect_names_table, i, ref);
|
||||
dwarf_sect_names_table->iterate (i, &ref);
|
||||
i++)
|
||||
{
|
||||
if (!ref)
|
||||
|
@ -2698,7 +2694,7 @@ darwin_asm_dwarf_section (const char *name, unsigned int flags,
|
|||
fprintf (asm_out_file, "Lsection%.*s:\n", namelen, sname);
|
||||
e.count = 1;
|
||||
e.name = xstrdup (sname);
|
||||
VEC_safe_push (dwarf_sect_used_entry, gc, dwarf_sect_names_table, e);
|
||||
vec_safe_push (dwarf_sect_names_table, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2813,7 +2809,7 @@ darwin_file_end (void)
|
|||
}
|
||||
|
||||
/* Output the names and indices. */
|
||||
if (lto_section_names && VEC_length (darwin_lto_section_e, lto_section_names))
|
||||
if (lto_section_names && lto_section_names->length ())
|
||||
{
|
||||
int count;
|
||||
darwin_lto_section_e *ref;
|
||||
|
@ -2824,7 +2820,7 @@ darwin_file_end (void)
|
|||
/* Emit the names. */
|
||||
fprintf (asm_out_file, "\t.section %s,%s,regular,debug\n",
|
||||
LTO_SEGMENT_NAME, LTO_NAMES_SECTION);
|
||||
FOR_EACH_VEC_ELT (darwin_lto_section_e, lto_section_names, count, ref)
|
||||
FOR_EACH_VEC_ELT (*lto_section_names, count, ref)
|
||||
{
|
||||
fprintf (asm_out_file, "L_GNU_LTO_NAME%d:\n", count);
|
||||
/* We have to jump through hoops to get the values of the intra-section
|
||||
|
@ -2847,7 +2843,7 @@ darwin_file_end (void)
|
|||
fputs ("\t.align\t2\n", asm_out_file);
|
||||
fputs ("# Section offset, Section length, Name offset, Name length\n",
|
||||
asm_out_file);
|
||||
FOR_EACH_VEC_ELT (darwin_lto_section_e, lto_section_names, count, ref)
|
||||
FOR_EACH_VEC_ELT (*lto_section_names, count, ref)
|
||||
{
|
||||
fprintf (asm_out_file, "%s L$gnu$lto$offs%d\t;# %s\n",
|
||||
op, count, ref->sectname);
|
||||
|
@ -3338,7 +3334,7 @@ darwin_build_constant_cfstring (tree str)
|
|||
if (!desc)
|
||||
{
|
||||
tree var, constructor, field;
|
||||
VEC(constructor_elt,gc) *v = NULL;
|
||||
vec<constructor_elt, va_gc> *v = NULL;
|
||||
int length = TREE_STRING_LENGTH (str) - 1;
|
||||
|
||||
if (darwin_warn_nonportable_cfstrings)
|
||||
|
|
|
@ -56,12 +56,12 @@ resolve_sw_modes (void)
|
|||
{
|
||||
basic_block bb;
|
||||
rtx insn, src;
|
||||
VEC (basic_block, heap) *todo;
|
||||
vec<basic_block> todo;
|
||||
sbitmap pushed;
|
||||
bool need_commit = false;
|
||||
bool finalize_fp_sets = (MACHINE_FUNCTION (cfun)->unknown_mode_sets == 0);
|
||||
|
||||
todo = VEC_alloc (basic_block, heap, last_basic_block);
|
||||
todo.create (last_basic_block);
|
||||
pushed = sbitmap_alloc (last_basic_block);
|
||||
bitmap_clear (pushed);
|
||||
if (!finalize_fp_sets)
|
||||
|
@ -98,7 +98,7 @@ resolve_sw_modes (void)
|
|||
checking the total frequency of the affected edges. */
|
||||
selected_mode = (enum attr_fp_mode) epiphany_normal_fp_rounding;
|
||||
|
||||
VEC_quick_push (basic_block, todo, bb);
|
||||
todo.quick_push (bb);
|
||||
bitmap_set_bit (pushed, bb->index);
|
||||
}
|
||||
XVECEXP (XEXP (src, 0), 0, 0) = GEN_INT (selected_mode);
|
||||
|
@ -106,9 +106,9 @@ resolve_sw_modes (void)
|
|||
SET_SRC (XVECEXP (PATTERN (insn), 0, 2)) = copy_rtx (src);
|
||||
df_insn_rescan (insn);
|
||||
}
|
||||
while (VEC_length (basic_block, todo))
|
||||
while (todo.length ())
|
||||
{
|
||||
basic_block bb = VEC_pop (basic_block, todo);
|
||||
basic_block bb = todo.pop ();
|
||||
int selected_reg, jilted_reg;
|
||||
enum attr_fp_mode jilted_mode;
|
||||
edge e;
|
||||
|
@ -141,7 +141,7 @@ resolve_sw_modes (void)
|
|||
{
|
||||
if (bitmap_bit_p (pushed, succ->index))
|
||||
continue;
|
||||
VEC_quick_push (basic_block, todo, succ);
|
||||
todo.quick_push (succ);
|
||||
bitmap_set_bit (pushed, bb->index);
|
||||
continue;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ resolve_sw_modes (void)
|
|||
insert_insn_on_edge (seq, e);
|
||||
}
|
||||
}
|
||||
VEC_free (basic_block, heap, todo);
|
||||
todo.release ();
|
||||
sbitmap_free (pushed);
|
||||
if (need_commit)
|
||||
commit_edge_insertions ();
|
||||
|
|
|
@ -28737,7 +28737,7 @@ dispatch_function_versions (tree dispatch_decl,
|
|||
gimple_seq gseq;
|
||||
int ix;
|
||||
tree ele;
|
||||
VEC (tree, heap) *fndecls;
|
||||
vec<tree> *fndecls;
|
||||
unsigned int num_versions = 0;
|
||||
unsigned int actual_versions = 0;
|
||||
unsigned int i;
|
||||
|
@ -28754,17 +28754,17 @@ dispatch_function_versions (tree dispatch_decl,
|
|||
&& empty_bb != NULL);
|
||||
|
||||
/*fndecls_p is actually a vector. */
|
||||
fndecls = (VEC (tree, heap) *)fndecls_p;
|
||||
fndecls = static_cast<vec<tree> *> (fndecls_p);
|
||||
|
||||
/* At least one more version other than the default. */
|
||||
num_versions = VEC_length (tree, fndecls);
|
||||
num_versions = fndecls->length ();
|
||||
gcc_assert (num_versions >= 2);
|
||||
|
||||
function_version_info = (struct _function_version_info *)
|
||||
XNEWVEC (struct _function_version_info, (num_versions - 1));
|
||||
|
||||
/* The first version in the vector is the default decl. */
|
||||
default_decl = VEC_index (tree, fndecls, 0);
|
||||
default_decl = (*fndecls)[0];
|
||||
|
||||
push_cfun (DECL_STRUCT_FUNCTION (dispatch_decl));
|
||||
|
||||
|
@ -28772,7 +28772,7 @@ dispatch_function_versions (tree dispatch_decl,
|
|||
/* Function version dispatch is via IFUNC. IFUNC resolvers fire before
|
||||
constructors, so explicity call __builtin_cpu_init here. */
|
||||
ifunc_cpu_init_stmt = gimple_build_call_vec (
|
||||
ix86_builtins [(int) IX86_BUILTIN_CPU_INIT], NULL);
|
||||
ix86_builtins [(int) IX86_BUILTIN_CPU_INIT], vec<tree>());
|
||||
gimple_seq_add_stmt (&gseq, ifunc_cpu_init_stmt);
|
||||
gimple_set_bb (ifunc_cpu_init_stmt, *empty_bb);
|
||||
set_bb_seq (*empty_bb, gseq);
|
||||
|
@ -28780,7 +28780,7 @@ dispatch_function_versions (tree dispatch_decl,
|
|||
pop_cfun ();
|
||||
|
||||
|
||||
for (ix = 1; VEC_iterate (tree, fndecls, ix, ele); ++ix)
|
||||
for (ix = 1; fndecls->iterate (ix, &ele); ++ix)
|
||||
{
|
||||
tree version_decl = ele;
|
||||
tree predicate_chain = NULL_TREE;
|
||||
|
@ -29276,7 +29276,7 @@ ix86_generate_version_dispatcher_body (void *node_p)
|
|||
{
|
||||
tree resolver_decl;
|
||||
basic_block empty_bb;
|
||||
VEC (tree, heap) *fn_ver_vec = NULL;
|
||||
vec<tree> fn_ver_vec = vec<tree>();
|
||||
tree default_ver_decl;
|
||||
struct cgraph_node *versn;
|
||||
struct cgraph_node *node;
|
||||
|
@ -29306,7 +29306,7 @@ ix86_generate_version_dispatcher_body (void *node_p)
|
|||
|
||||
push_cfun (DECL_STRUCT_FUNCTION (resolver_decl));
|
||||
|
||||
fn_ver_vec = VEC_alloc (tree, heap, 2);
|
||||
fn_ver_vec.create (2);
|
||||
|
||||
for (versn_info = node_version_info->next; versn_info;
|
||||
versn_info = versn_info->next)
|
||||
|
@ -29320,10 +29320,10 @@ ix86_generate_version_dispatcher_body (void *node_p)
|
|||
if (DECL_VINDEX (versn->symbol.decl))
|
||||
error_at (DECL_SOURCE_LOCATION (versn->symbol.decl),
|
||||
"Virtual function multiversioning not supported");
|
||||
VEC_safe_push (tree, heap, fn_ver_vec, versn->symbol.decl);
|
||||
fn_ver_vec.safe_push (versn->symbol.decl);
|
||||
}
|
||||
|
||||
dispatch_function_versions (resolver_decl, fn_ver_vec, &empty_bb);
|
||||
dispatch_function_versions (resolver_decl, &fn_ver_vec, &empty_bb);
|
||||
|
||||
rebuild_cgraph_edges ();
|
||||
pop_cfun ();
|
||||
|
|
|
@ -5937,21 +5937,22 @@ ia64_option_override (void)
|
|||
{
|
||||
unsigned int i;
|
||||
cl_deferred_option *opt;
|
||||
VEC(cl_deferred_option,heap) *vec
|
||||
= (VEC(cl_deferred_option,heap) *) ia64_deferred_options;
|
||||
vec<cl_deferred_option> *v
|
||||
= (vec<cl_deferred_option> *) ia64_deferred_options;
|
||||
|
||||
FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
|
||||
{
|
||||
switch (opt->opt_index)
|
||||
{
|
||||
case OPT_mfixed_range_:
|
||||
fix_range (opt->arg);
|
||||
break;
|
||||
if (v)
|
||||
FOR_EACH_VEC_ELT (*v, i, opt)
|
||||
{
|
||||
switch (opt->opt_index)
|
||||
{
|
||||
case OPT_mfixed_range_:
|
||||
fix_range (opt->arg);
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
if (TARGET_AUTO_PIC)
|
||||
target_flags |= MASK_CONST_GP;
|
||||
|
|
|
@ -300,54 +300,54 @@ mep_option_override (void)
|
|||
unsigned int i;
|
||||
int j;
|
||||
cl_deferred_option *opt;
|
||||
VEC(cl_deferred_option,heap) *vec
|
||||
= (VEC(cl_deferred_option,heap) *) mep_deferred_options;
|
||||
vec<cl_deferred_option> *v = (vec<cl_deferred_option> *) mep_deferred_options;
|
||||
|
||||
FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
|
||||
{
|
||||
switch (opt->opt_index)
|
||||
{
|
||||
case OPT_mivc2:
|
||||
for (j = 0; j < 32; j++)
|
||||
fixed_regs[j + 48] = 0;
|
||||
for (j = 0; j < 32; j++)
|
||||
call_used_regs[j + 48] = 1;
|
||||
for (j = 6; j < 8; j++)
|
||||
call_used_regs[j + 48] = 0;
|
||||
if (v)
|
||||
FOR_EACH_VEC_ELT (*v, i, opt)
|
||||
{
|
||||
switch (opt->opt_index)
|
||||
{
|
||||
case OPT_mivc2:
|
||||
for (j = 0; j < 32; j++)
|
||||
fixed_regs[j + 48] = 0;
|
||||
for (j = 0; j < 32; j++)
|
||||
call_used_regs[j + 48] = 1;
|
||||
for (j = 6; j < 8; j++)
|
||||
call_used_regs[j + 48] = 0;
|
||||
|
||||
#define RN(n,s) reg_names[FIRST_CCR_REGNO + n] = s
|
||||
RN (0, "$csar0");
|
||||
RN (1, "$cc");
|
||||
RN (4, "$cofr0");
|
||||
RN (5, "$cofr1");
|
||||
RN (6, "$cofa0");
|
||||
RN (7, "$cofa1");
|
||||
RN (15, "$csar1");
|
||||
RN (0, "$csar0");
|
||||
RN (1, "$cc");
|
||||
RN (4, "$cofr0");
|
||||
RN (5, "$cofr1");
|
||||
RN (6, "$cofa0");
|
||||
RN (7, "$cofa1");
|
||||
RN (15, "$csar1");
|
||||
|
||||
RN (16, "$acc0_0");
|
||||
RN (17, "$acc0_1");
|
||||
RN (18, "$acc0_2");
|
||||
RN (19, "$acc0_3");
|
||||
RN (20, "$acc0_4");
|
||||
RN (21, "$acc0_5");
|
||||
RN (22, "$acc0_6");
|
||||
RN (23, "$acc0_7");
|
||||
RN (16, "$acc0_0");
|
||||
RN (17, "$acc0_1");
|
||||
RN (18, "$acc0_2");
|
||||
RN (19, "$acc0_3");
|
||||
RN (20, "$acc0_4");
|
||||
RN (21, "$acc0_5");
|
||||
RN (22, "$acc0_6");
|
||||
RN (23, "$acc0_7");
|
||||
|
||||
RN (24, "$acc1_0");
|
||||
RN (25, "$acc1_1");
|
||||
RN (26, "$acc1_2");
|
||||
RN (27, "$acc1_3");
|
||||
RN (28, "$acc1_4");
|
||||
RN (29, "$acc1_5");
|
||||
RN (30, "$acc1_6");
|
||||
RN (31, "$acc1_7");
|
||||
RN (24, "$acc1_0");
|
||||
RN (25, "$acc1_1");
|
||||
RN (26, "$acc1_2");
|
||||
RN (27, "$acc1_3");
|
||||
RN (28, "$acc1_4");
|
||||
RN (29, "$acc1_5");
|
||||
RN (30, "$acc1_6");
|
||||
RN (31, "$acc1_7");
|
||||
#undef RN
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
if (flag_pic == 1)
|
||||
warning (OPT_fpic, "-fpic is not supported");
|
||||
|
|
|
@ -4012,12 +4012,8 @@ struct mips_multi_member {
|
|||
};
|
||||
typedef struct mips_multi_member mips_multi_member;
|
||||
|
||||
/* Vector definitions for the above. */
|
||||
DEF_VEC_O(mips_multi_member);
|
||||
DEF_VEC_ALLOC_O(mips_multi_member, heap);
|
||||
|
||||
/* The instructions that make up the current multi-insn sequence. */
|
||||
static VEC (mips_multi_member, heap) *mips_multi_members;
|
||||
static vec<mips_multi_member> mips_multi_members;
|
||||
|
||||
/* How many instructions (as opposed to labels) are in the current
|
||||
multi-insn sequence. */
|
||||
|
@ -4028,7 +4024,7 @@ static unsigned int mips_multi_num_insns;
|
|||
static void
|
||||
mips_multi_start (void)
|
||||
{
|
||||
VEC_truncate (mips_multi_member, mips_multi_members, 0);
|
||||
mips_multi_members.truncate (0);
|
||||
mips_multi_num_insns = 0;
|
||||
}
|
||||
|
||||
|
@ -4038,7 +4034,7 @@ static struct mips_multi_member *
|
|||
mips_multi_add (void)
|
||||
{
|
||||
mips_multi_member empty;
|
||||
return VEC_safe_push (mips_multi_member, heap, mips_multi_members, empty);
|
||||
return mips_multi_members.safe_push (empty);
|
||||
}
|
||||
|
||||
/* Add a normal insn with the given asm format to the current multi-insn
|
||||
|
@ -4081,7 +4077,7 @@ mips_multi_add_label (const char *label)
|
|||
static unsigned int
|
||||
mips_multi_last_index (void)
|
||||
{
|
||||
return VEC_length (mips_multi_member, mips_multi_members) - 1;
|
||||
return mips_multi_members.length () - 1;
|
||||
}
|
||||
|
||||
/* Add a copy of an existing instruction to the current multi-insn
|
||||
|
@ -4093,8 +4089,7 @@ mips_multi_copy_insn (unsigned int i)
|
|||
struct mips_multi_member *member;
|
||||
|
||||
member = mips_multi_add ();
|
||||
memcpy (member, &VEC_index (mips_multi_member, mips_multi_members, i),
|
||||
sizeof (*member));
|
||||
memcpy (member, &mips_multi_members[i], sizeof (*member));
|
||||
gcc_assert (!member->is_label_p);
|
||||
}
|
||||
|
||||
|
@ -4105,7 +4100,7 @@ mips_multi_copy_insn (unsigned int i)
|
|||
static void
|
||||
mips_multi_set_operand (unsigned int i, unsigned int op, rtx x)
|
||||
{
|
||||
VEC_index (mips_multi_member, mips_multi_members, i).operands[op] = x;
|
||||
mips_multi_members[i].operands[op] = x;
|
||||
}
|
||||
|
||||
/* Write out the asm code for the current multi-insn sequence. */
|
||||
|
@ -4116,7 +4111,7 @@ mips_multi_write (void)
|
|||
struct mips_multi_member *member;
|
||||
unsigned int i;
|
||||
|
||||
FOR_EACH_VEC_ELT (mips_multi_member, mips_multi_members, i, member)
|
||||
FOR_EACH_VEC_ELT (mips_multi_members, i, member)
|
||||
if (member->is_label_p)
|
||||
fprintf (asm_out_file, "%s\n", member->format);
|
||||
else
|
||||
|
|
|
@ -469,21 +469,22 @@ pa_option_override (void)
|
|||
{
|
||||
unsigned int i;
|
||||
cl_deferred_option *opt;
|
||||
VEC(cl_deferred_option,heap) *vec
|
||||
= (VEC(cl_deferred_option,heap) *) pa_deferred_options;
|
||||
vec<cl_deferred_option> *v
|
||||
= (vec<cl_deferred_option> *) pa_deferred_options;
|
||||
|
||||
FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
|
||||
{
|
||||
switch (opt->opt_index)
|
||||
{
|
||||
case OPT_mfixed_range_:
|
||||
fix_range (opt->arg);
|
||||
break;
|
||||
if (v)
|
||||
FOR_EACH_VEC_ELT (*v, i, opt)
|
||||
{
|
||||
switch (opt->opt_index)
|
||||
{
|
||||
case OPT_mfixed_range_:
|
||||
fix_range (opt->arg);
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
/* Unconditional branches in the delay slot are not compatible with dwarf2
|
||||
call frame information. There is no benefit in using this optimization
|
||||
|
@ -4401,7 +4402,7 @@ hppa_pic_save_rtx (void)
|
|||
|
||||
|
||||
/* Vector of funcdef numbers. */
|
||||
static VEC(int,heap) *funcdef_nos;
|
||||
static vec<int> funcdef_nos;
|
||||
|
||||
/* Output deferred profile counters. */
|
||||
static void
|
||||
|
@ -4410,20 +4411,20 @@ output_deferred_profile_counters (void)
|
|||
unsigned int i;
|
||||
int align, n;
|
||||
|
||||
if (VEC_empty (int, funcdef_nos))
|
||||
if (funcdef_nos.is_empty ())
|
||||
return;
|
||||
|
||||
switch_to_section (data_section);
|
||||
align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
|
||||
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
|
||||
|
||||
for (i = 0; VEC_iterate (int, funcdef_nos, i, n); i++)
|
||||
for (i = 0; funcdef_nos.iterate (i, &n); i++)
|
||||
{
|
||||
targetm.asm_out.internal_label (asm_out_file, "LP", n);
|
||||
assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, align, 1);
|
||||
}
|
||||
|
||||
VEC_free (int, heap, funcdef_nos);
|
||||
funcdef_nos.release ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -4465,7 +4466,7 @@ hppa_profile_hook (int label_no)
|
|||
rtx count_label_rtx, addr, r24;
|
||||
char count_label_name[16];
|
||||
|
||||
VEC_safe_push (int, heap, funcdef_nos, label_no);
|
||||
funcdef_nos.safe_push (label_no);
|
||||
ASM_GENERATE_INTERNAL_LABEL (count_label_name, "LP", label_no);
|
||||
count_label_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (count_label_name));
|
||||
|
||||
|
@ -9948,11 +9949,9 @@ typedef struct GTY(()) extern_symbol
|
|||
} extern_symbol;
|
||||
|
||||
/* Define gc'd vector type for extern_symbol. */
|
||||
DEF_VEC_O(extern_symbol);
|
||||
DEF_VEC_ALLOC_O(extern_symbol,gc);
|
||||
|
||||
/* Vector of extern_symbol pointers. */
|
||||
static GTY(()) VEC(extern_symbol,gc) *extern_symbols;
|
||||
static GTY(()) vec<extern_symbol, va_gc> *extern_symbols;
|
||||
|
||||
#ifdef ASM_OUTPUT_EXTERNAL_REAL
|
||||
/* Mark DECL (name NAME) as an external reference (assembler output
|
||||
|
@ -9964,7 +9963,7 @@ pa_hpux_asm_output_external (FILE *file, tree decl, const char *name)
|
|||
{
|
||||
gcc_assert (file == asm_out_file);
|
||||
extern_symbol p = {decl, name};
|
||||
VEC_safe_push (extern_symbol, gc, extern_symbols, p);
|
||||
vec_safe_push (extern_symbols, p);
|
||||
}
|
||||
|
||||
/* Output text required at the end of an assembler file.
|
||||
|
@ -9982,7 +9981,7 @@ pa_hpux_file_end (void)
|
|||
|
||||
output_deferred_plabels ();
|
||||
|
||||
for (i = 0; VEC_iterate (extern_symbol, extern_symbols, i, p); i++)
|
||||
for (i = 0; vec_safe_iterate (extern_symbols, i, &p); i++)
|
||||
{
|
||||
tree decl = p->decl;
|
||||
|
||||
|
@ -9991,7 +9990,7 @@ pa_hpux_file_end (void)
|
|||
ASM_OUTPUT_EXTERNAL_REAL (asm_out_file, decl, p->name);
|
||||
}
|
||||
|
||||
VEC_free (extern_symbol, gc, extern_symbols);
|
||||
vec_free (extern_symbols);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -3505,8 +3505,8 @@ tree
|
|||
altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
|
||||
void *passed_arglist)
|
||||
{
|
||||
VEC(tree,gc) *arglist = (VEC(tree,gc) *) passed_arglist;
|
||||
unsigned int nargs = VEC_length (tree, arglist);
|
||||
vec<tree, va_gc> *arglist = static_cast<vec<tree, va_gc> *> (passed_arglist);
|
||||
unsigned int nargs = vec_safe_length (arglist);
|
||||
enum rs6000_builtins fcode
|
||||
= (enum rs6000_builtins)DECL_FUNCTION_CODE (fndecl);
|
||||
tree fnargs = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
|
||||
|
@ -3529,7 +3529,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
|
|||
int size;
|
||||
int i;
|
||||
bool unsigned_p;
|
||||
VEC(constructor_elt,gc) *vec;
|
||||
vec<constructor_elt, va_gc> *vec;
|
||||
const char *name = fcode == ALTIVEC_BUILTIN_VEC_SPLATS ? "vec_splats": "vec_promote";
|
||||
|
||||
if (nargs == 0)
|
||||
|
@ -3549,10 +3549,10 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
|
|||
}
|
||||
/* Ignore promote's element argument. */
|
||||
if (fcode == ALTIVEC_BUILTIN_VEC_PROMOTE
|
||||
&& !INTEGRAL_TYPE_P (TREE_TYPE (VEC_index (tree, arglist, 1))))
|
||||
&& !INTEGRAL_TYPE_P (TREE_TYPE ((*arglist)[1])))
|
||||
goto bad;
|
||||
|
||||
arg = VEC_index (tree, arglist, 0);
|
||||
arg = (*arglist)[0];
|
||||
type = TREE_TYPE (arg);
|
||||
if (!SCALAR_FLOAT_TYPE_P (type)
|
||||
&& !INTEGRAL_TYPE_P (type))
|
||||
|
@ -3582,11 +3582,11 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
|
|||
goto bad;
|
||||
}
|
||||
arg = save_expr (fold_convert (TREE_TYPE (type), arg));
|
||||
vec = VEC_alloc (constructor_elt, gc, size);
|
||||
vec_alloc (vec, size);
|
||||
for(i = 0; i < size; i++)
|
||||
{
|
||||
constructor_elt elt = {NULL_TREE, arg};
|
||||
VEC_quick_push (constructor_elt, vec, elt);
|
||||
vec->quick_push (elt);
|
||||
}
|
||||
return build_constructor (type, vec);
|
||||
}
|
||||
|
@ -3610,8 +3610,8 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
|
|||
return error_mark_node;
|
||||
}
|
||||
|
||||
arg2 = VEC_index (tree, arglist, 1);
|
||||
arg1 = VEC_index (tree, arglist, 0);
|
||||
arg2 = (*arglist)[1];
|
||||
arg1 = (*arglist)[0];
|
||||
arg1_type = TREE_TYPE (arg1);
|
||||
|
||||
if (TREE_CODE (arg1_type) != VECTOR_TYPE)
|
||||
|
@ -3686,10 +3686,10 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
|
|||
return error_mark_node;
|
||||
}
|
||||
|
||||
arg0 = VEC_index (tree, arglist, 0);
|
||||
arg1 = VEC_index (tree, arglist, 1);
|
||||
arg0 = (*arglist)[0];
|
||||
arg1 = (*arglist)[1];
|
||||
arg1_type = TREE_TYPE (arg1);
|
||||
arg2 = VEC_index (tree, arglist, 2);
|
||||
arg2 = (*arglist)[2];
|
||||
|
||||
if (TREE_CODE (arg1_type) != VECTOR_TYPE)
|
||||
goto bad;
|
||||
|
@ -3752,7 +3752,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
|
|||
fnargs = TREE_CHAIN (fnargs), n++)
|
||||
{
|
||||
tree decl_type = TREE_VALUE (fnargs);
|
||||
tree arg = VEC_index (tree, arglist, n);
|
||||
tree arg = (*arglist)[n];
|
||||
tree type;
|
||||
|
||||
if (arg == error_mark_node)
|
||||
|
|
|
@ -24928,10 +24928,8 @@ typedef struct branch_island_d {
|
|||
int line_number;
|
||||
} branch_island;
|
||||
|
||||
DEF_VEC_O(branch_island);
|
||||
DEF_VEC_ALLOC_O(branch_island,gc);
|
||||
|
||||
static VEC(branch_island,gc) *branch_islands;
|
||||
static vec<branch_island, va_gc> *branch_islands;
|
||||
|
||||
/* Remember to generate a branch island for far calls to the given
|
||||
function. */
|
||||
|
@ -24941,7 +24939,7 @@ add_compiler_branch_island (tree label_name, tree function_name,
|
|||
int line_number)
|
||||
{
|
||||
branch_island bi = {function_name, label_name, line_number};
|
||||
VEC_safe_push (branch_island, gc, branch_islands, bi);
|
||||
vec_safe_push (branch_islands, bi);
|
||||
}
|
||||
|
||||
/* Generate far-jump branch islands for everything recorded in
|
||||
|
@ -24955,9 +24953,9 @@ macho_branch_islands (void)
|
|||
{
|
||||
char tmp_buf[512];
|
||||
|
||||
while (!VEC_empty (branch_island, branch_islands))
|
||||
while (!vec_safe_is_empty (branch_islands))
|
||||
{
|
||||
branch_island *bi = &VEC_last (branch_island, branch_islands);
|
||||
branch_island *bi = &branch_islands->last ();
|
||||
const char *label = IDENTIFIER_POINTER (bi->label_name);
|
||||
const char *name = IDENTIFIER_POINTER (bi->function_name);
|
||||
char name_buf[512];
|
||||
|
@ -25025,7 +25023,7 @@ macho_branch_islands (void)
|
|||
if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
|
||||
dbxout_stabd (N_SLINE, bi->line_number);
|
||||
#endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
|
||||
VEC_pop (branch_island, branch_islands);
|
||||
branch_islands->pop ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25038,7 +25036,7 @@ no_previous_def (tree function_name)
|
|||
branch_island *bi;
|
||||
unsigned ix;
|
||||
|
||||
FOR_EACH_VEC_ELT (branch_island, branch_islands, ix, bi)
|
||||
FOR_EACH_VEC_SAFE_ELT (branch_islands, ix, bi)
|
||||
if (function_name == bi->function_name)
|
||||
return 0;
|
||||
return 1;
|
||||
|
@ -25053,7 +25051,7 @@ get_prev_label (tree function_name)
|
|||
branch_island *bi;
|
||||
unsigned ix;
|
||||
|
||||
FOR_EACH_VEC_ELT (branch_island, branch_islands, ix, bi)
|
||||
FOR_EACH_VEC_SAFE_ELT (branch_islands, ix, bi)
|
||||
if (function_name == bi->function_name)
|
||||
return bi->label_name;
|
||||
return NULL_TREE;
|
||||
|
|
|
@ -2614,43 +2614,43 @@ rx_option_override (void)
|
|||
{
|
||||
unsigned int i;
|
||||
cl_deferred_option *opt;
|
||||
VEC(cl_deferred_option,heap) *vec
|
||||
= (VEC(cl_deferred_option,heap) *) rx_deferred_options;
|
||||
vec<cl_deferred_option> *v = (vec<cl_deferred_option> *) rx_deferred_options;
|
||||
|
||||
FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
|
||||
{
|
||||
switch (opt->opt_index)
|
||||
{
|
||||
case OPT_mint_register_:
|
||||
switch (opt->value)
|
||||
{
|
||||
case 4:
|
||||
fixed_regs[10] = call_used_regs [10] = 1;
|
||||
/* Fall through. */
|
||||
case 3:
|
||||
fixed_regs[11] = call_used_regs [11] = 1;
|
||||
/* Fall through. */
|
||||
case 2:
|
||||
fixed_regs[12] = call_used_regs [12] = 1;
|
||||
/* Fall through. */
|
||||
case 1:
|
||||
fixed_regs[13] = call_used_regs [13] = 1;
|
||||
/* Fall through. */
|
||||
case 0:
|
||||
rx_num_interrupt_regs = opt->value;
|
||||
break;
|
||||
default:
|
||||
rx_num_interrupt_regs = 0;
|
||||
/* Error message already given because rx_handle_option
|
||||
returned false. */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
if (v)
|
||||
FOR_EACH_VEC_ELT (*v, i, opt)
|
||||
{
|
||||
switch (opt->opt_index)
|
||||
{
|
||||
case OPT_mint_register_:
|
||||
switch (opt->value)
|
||||
{
|
||||
case 4:
|
||||
fixed_regs[10] = call_used_regs [10] = 1;
|
||||
/* Fall through. */
|
||||
case 3:
|
||||
fixed_regs[11] = call_used_regs [11] = 1;
|
||||
/* Fall through. */
|
||||
case 2:
|
||||
fixed_regs[12] = call_used_regs [12] = 1;
|
||||
/* Fall through. */
|
||||
case 1:
|
||||
fixed_regs[13] = call_used_regs [13] = 1;
|
||||
/* Fall through. */
|
||||
case 0:
|
||||
rx_num_interrupt_regs = opt->value;
|
||||
break;
|
||||
default:
|
||||
rx_num_interrupt_regs = 0;
|
||||
/* Error message already given because rx_handle_option
|
||||
returned false. */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
/* This target defaults to strict volatile bitfields. */
|
||||
if (flag_strict_volatile_bitfields < 0 && abi_version_at_least(2))
|
||||
|
|
|
@ -93,8 +93,8 @@ spu_resolve_overloaded_builtin (location_t loc, tree fndecl, void *passed_args)
|
|||
#define SCALAR_TYPE_P(t) (INTEGRAL_TYPE_P (t) \
|
||||
|| SCALAR_FLOAT_TYPE_P (t) \
|
||||
|| POINTER_TYPE_P (t))
|
||||
VEC(tree,gc) *fnargs = (VEC(tree,gc) *) passed_args;
|
||||
unsigned int nargs = VEC_length (tree, fnargs);
|
||||
vec<tree, va_gc> *fnargs = static_cast <vec<tree, va_gc> *> (passed_args);
|
||||
unsigned int nargs = vec_safe_length (fnargs);
|
||||
int new_fcode, fcode = DECL_FUNCTION_CODE (fndecl);
|
||||
struct spu_builtin_description *desc;
|
||||
tree match = NULL_TREE;
|
||||
|
@ -137,7 +137,7 @@ spu_resolve_overloaded_builtin (location_t loc, tree fndecl, void *passed_args)
|
|||
return error_mark_node;
|
||||
}
|
||||
|
||||
var = VEC_index (tree, fnargs, p);
|
||||
var = (*fnargs)[p];
|
||||
|
||||
if (TREE_CODE (var) == NON_LVALUE_EXPR)
|
||||
var = TREE_OPERAND (var, 0);
|
||||
|
|
|
@ -101,7 +101,7 @@ static const struct vms_crtl_name vms_crtl_names[] =
|
|||
|
||||
/* List of aliased identifiers. They must be persistent across gc. */
|
||||
|
||||
static GTY(()) VEC(tree,gc) *aliases_id;
|
||||
static GTY(()) vec<tree, va_gc> *aliases_id;
|
||||
|
||||
/* Add a CRTL translation. This simply use the transparent alias
|
||||
mechanism, which is platform independent and works with the
|
||||
|
@ -120,7 +120,7 @@ vms_add_crtl_xlat (const char *name, size_t nlen,
|
|||
IDENTIFIER_TRANSPARENT_ALIAS (targ) = 1;
|
||||
TREE_CHAIN (targ) = get_identifier_with_length (id_str, id_len);
|
||||
|
||||
VEC_safe_push (tree, gc, aliases_id, targ);
|
||||
vec_safe_push (aliases_id, targ);
|
||||
}
|
||||
|
||||
/* Do VMS specific stuff on builtins: disable the ones that are not
|
||||
|
|
|
@ -96,23 +96,24 @@ vxworks_emutls_var_fields (tree type, tree *name)
|
|||
static tree
|
||||
vxworks_emutls_var_init (tree var, tree decl, tree tmpl_addr)
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 3);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, 3);
|
||||
|
||||
tree type = TREE_TYPE (var);
|
||||
tree field = TYPE_FIELDS (type);
|
||||
|
||||
constructor_elt elt = {field, fold_convert (TREE_TYPE (field), tmpl_addr)};
|
||||
VEC_quick_push (constructor_elt, v, elt);
|
||||
v->quick_push (elt);
|
||||
|
||||
field = DECL_CHAIN (field);
|
||||
elt.index = field;
|
||||
elt.value = build_int_cst (TREE_TYPE (field), 0);
|
||||
VEC_quick_push (constructor_elt, v, elt);
|
||||
v->quick_push (elt);
|
||||
|
||||
field = DECL_CHAIN (field);
|
||||
elt.index = field;
|
||||
elt.value = fold_convert (TREE_TYPE (field), DECL_SIZE_UNIT (decl));
|
||||
VEC_quick_push (constructor_elt, v, elt);
|
||||
v->quick_push (elt);
|
||||
|
||||
return build_constructor (type, v);
|
||||
}
|
||||
|
|
|
@ -200,5 +200,8 @@ enum memmodel
|
|||
is a pointer to a pointer, the second a cookie. */
|
||||
typedef void (*gt_pointer_operator) (void *, void *);
|
||||
|
||||
#endif /* coretypes.h */
|
||||
#if !defined (HAVE_UCHAR)
|
||||
typedef unsigned char uchar;
|
||||
#endif
|
||||
|
||||
#endif /* coretypes.h */
|
||||
|
|
|
@ -128,9 +128,9 @@ static void build_info_type (tree, tree);
|
|||
static tree build_fn_info (const struct coverage_data *, tree, tree);
|
||||
static tree build_info (tree, tree);
|
||||
static bool coverage_obj_init (void);
|
||||
static VEC(constructor_elt,gc) *coverage_obj_fn
|
||||
(VEC(constructor_elt,gc) *, tree, struct coverage_data const *);
|
||||
static void coverage_obj_finish (VEC(constructor_elt,gc) *);
|
||||
static vec<constructor_elt, va_gc> *coverage_obj_fn
|
||||
(vec<constructor_elt, va_gc> *, tree, struct coverage_data const *);
|
||||
static void coverage_obj_finish (vec<constructor_elt, va_gc> *);
|
||||
|
||||
/* Return the type node for gcov_type. */
|
||||
|
||||
|
@ -764,8 +764,8 @@ build_fn_info (const struct coverage_data *data, tree type, tree key)
|
|||
tree fields = TYPE_FIELDS (type);
|
||||
tree ctr_type;
|
||||
unsigned ix;
|
||||
VEC(constructor_elt,gc) *v1 = NULL;
|
||||
VEC(constructor_elt,gc) *v2 = NULL;
|
||||
vec<constructor_elt, va_gc> *v1 = NULL;
|
||||
vec<constructor_elt, va_gc> *v2 = NULL;
|
||||
|
||||
/* key */
|
||||
CONSTRUCTOR_APPEND_ELT (v1, fields,
|
||||
|
@ -795,7 +795,7 @@ build_fn_info (const struct coverage_data *data, tree type, tree key)
|
|||
for (ix = 0; ix != GCOV_COUNTERS; ix++)
|
||||
if (prg_ctr_mask & (1 << ix))
|
||||
{
|
||||
VEC(constructor_elt,gc) *ctr = NULL;
|
||||
vec<constructor_elt, va_gc> *ctr = NULL;
|
||||
tree var = data->ctr_vars[ix];
|
||||
unsigned count = 0;
|
||||
|
||||
|
@ -898,8 +898,8 @@ build_info (tree info_type, tree fn_ary)
|
|||
unsigned ix;
|
||||
tree filename_string;
|
||||
int da_file_name_len;
|
||||
VEC(constructor_elt,gc) *v1 = NULL;
|
||||
VEC(constructor_elt,gc) *v2 = NULL;
|
||||
vec<constructor_elt, va_gc> *v1 = NULL;
|
||||
vec<constructor_elt, va_gc> *v2 = NULL;
|
||||
|
||||
/* Version ident */
|
||||
CONSTRUCTOR_APPEND_ELT (v1, info_fields,
|
||||
|
@ -1043,8 +1043,8 @@ coverage_obj_init (void)
|
|||
/* Generate the coverage function info for FN and DATA. Append a
|
||||
pointer to that object to CTOR and return the appended CTOR. */
|
||||
|
||||
static VEC(constructor_elt,gc) *
|
||||
coverage_obj_fn (VEC(constructor_elt,gc) *ctor, tree fn,
|
||||
static vec<constructor_elt, va_gc> *
|
||||
coverage_obj_fn (vec<constructor_elt, va_gc> *ctor, tree fn,
|
||||
struct coverage_data const *data)
|
||||
{
|
||||
tree init = build_fn_info (data, gcov_fn_info_type, gcov_info_var);
|
||||
|
@ -1062,9 +1062,9 @@ coverage_obj_fn (VEC(constructor_elt,gc) *ctor, tree fn,
|
|||
function objects from CTOR. Generate the gcov_info initializer. */
|
||||
|
||||
static void
|
||||
coverage_obj_finish (VEC(constructor_elt,gc) *ctor)
|
||||
coverage_obj_finish (vec<constructor_elt, va_gc> *ctor)
|
||||
{
|
||||
unsigned n_functions = VEC_length(constructor_elt, ctor);
|
||||
unsigned n_functions = vec_safe_length (ctor);
|
||||
tree fn_info_ary_type = build_array_type
|
||||
(build_qualified_type (gcov_fn_info_ptr_type, TYPE_QUAL_CONST),
|
||||
build_index_type (size_int (n_functions - 1)));
|
||||
|
@ -1153,7 +1153,7 @@ coverage_finish (void)
|
|||
|
||||
if (coverage_obj_init ())
|
||||
{
|
||||
VEC(constructor_elt,gc) *fn_ctor = NULL;
|
||||
vec<constructor_elt, va_gc> *fn_ctor = NULL;
|
||||
struct coverage_data *fn;
|
||||
|
||||
for (fn = functions_head; fn; fn = fn->next)
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
2012-11-17 Diego Novillo <dnovillo@google.com>
|
||||
|
||||
Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
|
||||
|
||||
* Make-lang.in: Remove dependencies on vecir.h and vecprim.h everywhere.
|
||||
* call.c: Use new vec API in vec.h.
|
||||
* class.c: Likewise.
|
||||
* cp-gimplify.c: Likewise.
|
||||
* cp-tree.h: Likewise.
|
||||
* cvt.c: Likewise.
|
||||
* decl.c: Likewise.
|
||||
* decl2.c: Likewise.
|
||||
* error.c: Likewise.
|
||||
* except.c: Likewise.
|
||||
* init.c: Likewise.
|
||||
* mangle.c: Likewise.
|
||||
* method.c: Likewise.
|
||||
* name-lookup.c: Likewise.
|
||||
* name-lookup.h: Likewise.
|
||||
* parser.c: Likewise.
|
||||
* parser.h: Likewise.
|
||||
* pt.c: Likewise.
|
||||
* repo.c: Likewise.
|
||||
* rtti.c: Likewise.
|
||||
* search.c: Likewise.
|
||||
* semantics.c: Likewise.
|
||||
* tree.c: Likewise.
|
||||
* typeck.c: Likewise.
|
||||
* typeck2.c: Likewise.
|
||||
|
||||
2012-11-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
* semantics.c (finish_id_expression): Tidy diagnostic message.
|
||||
|
|
|
@ -317,7 +317,7 @@ cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
|
|||
cp/cfns.h $(TREE_INLINE_H) $(TARGET_H) gt-cp-except.h
|
||||
cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(TM_P_H)
|
||||
cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \
|
||||
toplev.h $(TREE_INLINE_H) pointer-set.h gt-cp-pt.h vecprim.h intl.h \
|
||||
toplev.h $(TREE_INLINE_H) pointer-set.h gt-cp-pt.h intl.h \
|
||||
c-family/c-objc.h
|
||||
cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) \
|
||||
$(FLAGS_H) $(REAL_H) $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H) \
|
||||
|
|
218
gcc/cp/call.c
218
gcc/cp/call.c
|
@ -169,14 +169,14 @@ static tree build_this (tree);
|
|||
static struct z_candidate *splice_viable (struct z_candidate *, bool, bool *);
|
||||
static bool any_strictly_viable (struct z_candidate *);
|
||||
static struct z_candidate *add_template_candidate
|
||||
(struct z_candidate **, tree, tree, tree, tree, const VEC(tree,gc) *,
|
||||
(struct z_candidate **, tree, tree, tree, tree, const vec<tree, va_gc> *,
|
||||
tree, tree, tree, int, unification_kind_t, tsubst_flags_t);
|
||||
static struct z_candidate *add_template_candidate_real
|
||||
(struct z_candidate **, tree, tree, tree, tree, const VEC(tree,gc) *,
|
||||
(struct z_candidate **, tree, tree, tree, tree, const vec<tree, va_gc> *,
|
||||
tree, tree, tree, int, tree, unification_kind_t, tsubst_flags_t);
|
||||
static struct z_candidate *add_template_conv_candidate
|
||||
(struct z_candidate **, tree, tree, tree, const VEC(tree,gc) *, tree,
|
||||
tree, tree, tsubst_flags_t);
|
||||
(struct z_candidate **, tree, tree, tree, const vec<tree, va_gc> *,
|
||||
tree, tree, tree, tsubst_flags_t);
|
||||
static void add_builtin_candidates
|
||||
(struct z_candidate **, enum tree_code, enum tree_code,
|
||||
tree, tree *, int, tsubst_flags_t);
|
||||
|
@ -188,10 +188,10 @@ static void build_builtin_candidate
|
|||
(struct z_candidate **, tree, tree, tree, tree *, tree *,
|
||||
int, tsubst_flags_t);
|
||||
static struct z_candidate *add_conv_candidate
|
||||
(struct z_candidate **, tree, tree, tree, const VEC(tree,gc) *, tree,
|
||||
(struct z_candidate **, tree, tree, tree, const vec<tree, va_gc> *, tree,
|
||||
tree, tsubst_flags_t);
|
||||
static struct z_candidate *add_function_candidate
|
||||
(struct z_candidate **, tree, tree, tree, const VEC(tree,gc) *, tree,
|
||||
(struct z_candidate **, tree, tree, tree, const vec<tree, va_gc> *, tree,
|
||||
tree, int, tsubst_flags_t);
|
||||
static conversion *implicit_conversion (tree, tree, tree, bool, int,
|
||||
tsubst_flags_t);
|
||||
|
@ -205,7 +205,7 @@ static bool is_subseq (conversion *, conversion *);
|
|||
static conversion *maybe_handle_ref_bind (conversion **);
|
||||
static void maybe_handle_implicit_object (conversion **);
|
||||
static struct z_candidate *add_candidate
|
||||
(struct z_candidate **, tree, tree, const VEC(tree,gc) *, size_t,
|
||||
(struct z_candidate **, tree, tree, const vec<tree, va_gc> *, size_t,
|
||||
conversion **, tree, tree, int, struct rejection_reason *);
|
||||
static tree source_type (conversion *);
|
||||
static void add_warning (struct z_candidate *, struct z_candidate *);
|
||||
|
@ -215,8 +215,8 @@ static bool promoted_arithmetic_type_p (tree);
|
|||
static conversion *conditional_conversion (tree, tree, tsubst_flags_t);
|
||||
static char *name_as_c_string (tree, tree, bool *);
|
||||
static tree prep_operand (tree);
|
||||
static void add_candidates (tree, tree, const VEC(tree,gc) *, tree, tree, bool,
|
||||
tree, tree, int, struct z_candidate **,
|
||||
static void add_candidates (tree, tree, const vec<tree, va_gc> *, tree, tree,
|
||||
bool, tree, tree, int, struct z_candidate **,
|
||||
tsubst_flags_t);
|
||||
static conversion *merge_conversion_sequences (conversion *, conversion *);
|
||||
static bool magic_varargs_p (tree);
|
||||
|
@ -511,7 +511,7 @@ struct z_candidate {
|
|||
/* The rest of the arguments to use when calling this function. If
|
||||
there are no further arguments this may be NULL or it may be an
|
||||
empty vector. */
|
||||
const VEC(tree,gc) *args;
|
||||
const vec<tree, va_gc> *args;
|
||||
/* The implicit conversion sequences for each of the arguments to
|
||||
FN. */
|
||||
conversion **convs;
|
||||
|
@ -1772,7 +1772,7 @@ implicit_conversion (tree to, tree from, tree expr, bool c_cast_p,
|
|||
|
||||
static struct z_candidate *
|
||||
add_candidate (struct z_candidate **candidates,
|
||||
tree fn, tree first_arg, const VEC(tree,gc) *args,
|
||||
tree fn, tree first_arg, const vec<tree, va_gc> *args,
|
||||
size_t num_convs, conversion **convs,
|
||||
tree access_path, tree conversion_path,
|
||||
int viable, struct rejection_reason *reason)
|
||||
|
@ -1822,7 +1822,7 @@ remaining_arguments (tree arg)
|
|||
static struct z_candidate *
|
||||
add_function_candidate (struct z_candidate **candidates,
|
||||
tree fn, tree ctype, tree first_arg,
|
||||
const VEC(tree,gc) *args, tree access_path,
|
||||
const vec<tree, va_gc> *args, tree access_path,
|
||||
tree conversion_path, int flags,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
|
@ -1855,7 +1855,7 @@ add_function_candidate (struct z_candidate **candidates,
|
|||
else
|
||||
skip = 0;
|
||||
|
||||
len = VEC_length (tree, args) - skip + (first_arg != NULL_TREE ? 1 : 0);
|
||||
len = vec_safe_length (args) - skip + (first_arg != NULL_TREE ? 1 : 0);
|
||||
convs = alloc_conversions (len);
|
||||
|
||||
/* 13.3.2 - Viable functions [over.match.viable]
|
||||
|
@ -1927,8 +1927,7 @@ add_function_candidate (struct z_candidate **candidates,
|
|||
arg = first_arg;
|
||||
else
|
||||
arg = CONST_CAST_TREE (
|
||||
VEC_index (tree, args,
|
||||
i + skip - (first_arg != NULL_TREE ? 1 : 0)));
|
||||
(*args)[i + skip - (first_arg != NULL_TREE ? 1 : 0)]);
|
||||
argtype = lvalue_type (arg);
|
||||
|
||||
is_this = (i == 0 && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
|
||||
|
@ -2032,7 +2031,7 @@ add_function_candidate (struct z_candidate **candidates,
|
|||
|
||||
static struct z_candidate *
|
||||
add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj,
|
||||
tree first_arg, const VEC(tree,gc) *arglist,
|
||||
tree first_arg, const vec<tree, va_gc> *arglist,
|
||||
tree access_path, tree conversion_path,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
|
@ -2046,7 +2045,7 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj,
|
|||
parmlist = TREE_TYPE (parmlist);
|
||||
parmlist = TYPE_ARG_TYPES (parmlist);
|
||||
|
||||
len = VEC_length (tree, arglist) + (first_arg != NULL_TREE ? 1 : 0) + 1;
|
||||
len = vec_safe_length (arglist) + (first_arg != NULL_TREE ? 1 : 0) + 1;
|
||||
convs = alloc_conversions (len);
|
||||
parmnode = parmlist;
|
||||
viable = 1;
|
||||
|
@ -2067,8 +2066,7 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj,
|
|||
else if (i == 1 && first_arg != NULL_TREE)
|
||||
arg = first_arg;
|
||||
else
|
||||
arg = VEC_index (tree, arglist,
|
||||
i - (first_arg != NULL_TREE ? 1 : 0) - 1);
|
||||
arg = (*arglist)[i - (first_arg != NULL_TREE ? 1 : 0) - 1];
|
||||
argtype = lvalue_type (arg);
|
||||
|
||||
if (i == 0)
|
||||
|
@ -2676,7 +2674,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
|
|||
tree type, argtypes[3], t;
|
||||
/* TYPES[i] is the set of possible builtin-operator parameter types
|
||||
we will consider for the Ith argument. */
|
||||
VEC(tree,gc) *types[2];
|
||||
vec<tree, va_gc> *types[2];
|
||||
unsigned ix;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
|
@ -2758,11 +2756,9 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
|
|||
if (code == COND_EXPR)
|
||||
{
|
||||
if (real_lvalue_p (args[i]))
|
||||
VEC_safe_push (tree, gc, types[i],
|
||||
build_reference_type (argtypes[i]));
|
||||
vec_safe_push (types[i], build_reference_type (argtypes[i]));
|
||||
|
||||
VEC_safe_push (tree, gc, types[i],
|
||||
TYPE_MAIN_VARIANT (argtypes[i]));
|
||||
vec_safe_push (types[i], TYPE_MAIN_VARIANT (argtypes[i]));
|
||||
}
|
||||
|
||||
else if (! convs)
|
||||
|
@ -2778,49 +2774,48 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
|
|||
continue;
|
||||
|
||||
if (code == COND_EXPR && TREE_CODE (type) == REFERENCE_TYPE)
|
||||
VEC_safe_push (tree, gc, types[i], type);
|
||||
vec_safe_push (types[i], type);
|
||||
|
||||
type = non_reference (type);
|
||||
if (i != 0 || ! ref1)
|
||||
{
|
||||
type = cv_unqualified (type_decays_to (type));
|
||||
if (enum_p && TREE_CODE (type) == ENUMERAL_TYPE)
|
||||
VEC_safe_push (tree, gc, types[i], type);
|
||||
vec_safe_push (types[i], type);
|
||||
if (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (type))
|
||||
type = type_promotes_to (type);
|
||||
}
|
||||
|
||||
if (! vec_member (type, types[i]))
|
||||
VEC_safe_push (tree, gc, types[i], type);
|
||||
vec_safe_push (types[i], type);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (code == COND_EXPR && real_lvalue_p (args[i]))
|
||||
VEC_safe_push (tree, gc, types[i],
|
||||
build_reference_type (argtypes[i]));
|
||||
vec_safe_push (types[i], build_reference_type (argtypes[i]));
|
||||
type = non_reference (argtypes[i]);
|
||||
if (i != 0 || ! ref1)
|
||||
{
|
||||
type = cv_unqualified (type_decays_to (type));
|
||||
if (enum_p && UNSCOPED_ENUM_P (type))
|
||||
VEC_safe_push (tree, gc, types[i], type);
|
||||
vec_safe_push (types[i], type);
|
||||
if (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (type))
|
||||
type = type_promotes_to (type);
|
||||
}
|
||||
VEC_safe_push (tree, gc, types[i], type);
|
||||
vec_safe_push (types[i], type);
|
||||
}
|
||||
}
|
||||
|
||||
/* Run through the possible parameter types of both arguments,
|
||||
creating candidates with those parameter types. */
|
||||
FOR_EACH_VEC_ELT_REVERSE (tree, types[0], ix, t)
|
||||
FOR_EACH_VEC_ELT_REVERSE (*(types[0]), ix, t)
|
||||
{
|
||||
unsigned jx;
|
||||
tree u;
|
||||
|
||||
if (!VEC_empty (tree, types[1]))
|
||||
FOR_EACH_VEC_ELT_REVERSE (tree, types[1], jx, u)
|
||||
if (!types[1]->is_empty ())
|
||||
FOR_EACH_VEC_ELT_REVERSE (*(types[1]), jx, u)
|
||||
add_builtin_candidate
|
||||
(candidates, code, code2, fnname, t,
|
||||
u, args, argtypes, flags, complain);
|
||||
|
@ -2848,14 +2843,14 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
|
|||
static struct z_candidate*
|
||||
add_template_candidate_real (struct z_candidate **candidates, tree tmpl,
|
||||
tree ctype, tree explicit_targs, tree first_arg,
|
||||
const VEC(tree,gc) *arglist, tree return_type,
|
||||
const vec<tree, va_gc> *arglist, tree return_type,
|
||||
tree access_path, tree conversion_path,
|
||||
int flags, tree obj, unification_kind_t strict,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
int ntparms = DECL_NTPARMS (tmpl);
|
||||
tree targs = make_tree_vec (ntparms);
|
||||
unsigned int len = VEC_length (tree, arglist);
|
||||
unsigned int len = vec_safe_length (arglist);
|
||||
unsigned int nargs = (first_arg == NULL_TREE ? 0 : 1) + len;
|
||||
unsigned int skip_without_in_chrg = 0;
|
||||
tree first_arg_without_in_chrg = first_arg;
|
||||
|
@ -2901,7 +2896,7 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl,
|
|||
++ia;
|
||||
}
|
||||
for (ix = skip_without_in_chrg;
|
||||
VEC_iterate (tree, arglist, ix, arg);
|
||||
vec_safe_iterate (arglist, ix, &arg);
|
||||
++ix)
|
||||
{
|
||||
args_without_in_chrg[ia] = arg;
|
||||
|
@ -3002,7 +2997,7 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl,
|
|||
static struct z_candidate *
|
||||
add_template_candidate (struct z_candidate **candidates, tree tmpl, tree ctype,
|
||||
tree explicit_targs, tree first_arg,
|
||||
const VEC(tree,gc) *arglist, tree return_type,
|
||||
const vec<tree, va_gc> *arglist, tree return_type,
|
||||
tree access_path, tree conversion_path, int flags,
|
||||
unification_kind_t strict, tsubst_flags_t complain)
|
||||
{
|
||||
|
@ -3017,7 +3012,7 @@ add_template_candidate (struct z_candidate **candidates, tree tmpl, tree ctype,
|
|||
static struct z_candidate *
|
||||
add_template_conv_candidate (struct z_candidate **candidates, tree tmpl,
|
||||
tree obj, tree first_arg,
|
||||
const VEC(tree,gc) *arglist,
|
||||
const vec<tree, va_gc> *arglist,
|
||||
tree return_type, tree access_path,
|
||||
tree conversion_path, tsubst_flags_t complain)
|
||||
{
|
||||
|
@ -3336,7 +3331,7 @@ merge_conversion_sequences (conversion *user_seq, conversion *std_seq)
|
|||
non-list constructor.
|
||||
|
||||
Parameters are as for add_candidates, except that the arguments are in
|
||||
the form of a CONSTRUCTOR (the initializer list) rather than a VEC, and
|
||||
the form of a CONSTRUCTOR (the initializer list) rather than a vector, and
|
||||
the RETURN_TYPE parameter is replaced by TOTYPE, the desired type. */
|
||||
|
||||
static void
|
||||
|
@ -3348,7 +3343,7 @@ add_list_candidates (tree fns, tree first_arg,
|
|||
struct z_candidate **candidates,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
VEC(tree,gc) *args;
|
||||
vec<tree, va_gc> *args;
|
||||
|
||||
gcc_assert (*candidates == NULL);
|
||||
|
||||
|
@ -3403,7 +3398,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags,
|
|||
tree conv_fns = NULL_TREE;
|
||||
conversion *conv = NULL;
|
||||
tree first_arg = NULL_TREE;
|
||||
VEC(tree,gc) *args = NULL;
|
||||
vec<tree, va_gc> *args = NULL;
|
||||
bool any_viable_p;
|
||||
int convflags;
|
||||
|
||||
|
@ -3734,13 +3729,13 @@ build_integral_nontype_arg_conv (tree type, tree expr, tsubst_flags_t complain)
|
|||
|
||||
/* Do any initial processing on the arguments to a function call. */
|
||||
|
||||
static VEC(tree,gc) *
|
||||
resolve_args (VEC(tree,gc) *args, tsubst_flags_t complain)
|
||||
static vec<tree, va_gc> *
|
||||
resolve_args (vec<tree, va_gc> *args, tsubst_flags_t complain)
|
||||
{
|
||||
unsigned int ix;
|
||||
tree arg;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, args, ix, arg)
|
||||
FOR_EACH_VEC_SAFE_ELT (args, ix, arg)
|
||||
{
|
||||
if (error_operand_p (arg))
|
||||
return NULL;
|
||||
|
@ -3770,7 +3765,7 @@ resolve_args (VEC(tree,gc) *args, tsubst_flags_t complain)
|
|||
|
||||
static struct z_candidate *
|
||||
perform_overload_resolution (tree fn,
|
||||
const VEC(tree,gc) *args,
|
||||
const vec<tree, va_gc> *args,
|
||||
struct z_candidate **candidates,
|
||||
bool *any_viable_p, tsubst_flags_t complain)
|
||||
{
|
||||
|
@ -3823,7 +3818,7 @@ perform_overload_resolution (tree fn,
|
|||
functions. */
|
||||
|
||||
static void
|
||||
print_error_for_call_failure (tree fn, VEC(tree,gc) *args, bool any_viable_p,
|
||||
print_error_for_call_failure (tree fn, vec<tree, va_gc> *args, bool any_viable_p,
|
||||
struct z_candidate *candidates)
|
||||
{
|
||||
tree name = DECL_NAME (OVL_CURRENT (fn));
|
||||
|
@ -3844,7 +3839,7 @@ print_error_for_call_failure (tree fn, VEC(tree,gc) *args, bool any_viable_p,
|
|||
ARGS. */
|
||||
|
||||
tree
|
||||
build_new_function_call (tree fn, VEC(tree,gc) **args, bool koenig_p,
|
||||
build_new_function_call (tree fn, vec<tree, va_gc> **args, bool koenig_p,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
struct z_candidate *candidates, *cand;
|
||||
|
@ -3929,7 +3924,7 @@ build_new_function_call (tree fn, VEC(tree,gc) **args, bool koenig_p,
|
|||
function called. */
|
||||
|
||||
tree
|
||||
build_operator_new_call (tree fnname, VEC(tree,gc) **args,
|
||||
build_operator_new_call (tree fnname, vec<tree, va_gc> **args,
|
||||
tree *size, tree *cookie_size, tree size_check,
|
||||
tree *fn, tsubst_flags_t complain)
|
||||
{
|
||||
|
@ -3945,7 +3940,7 @@ build_operator_new_call (tree fnname, VEC(tree,gc) **args,
|
|||
if (size_check != NULL_TREE)
|
||||
*size = fold_build3 (COND_EXPR, sizetype, size_check,
|
||||
original_size, TYPE_MAX_VALUE (sizetype));
|
||||
VEC_safe_insert (tree, gc, *args, 0, *size);
|
||||
vec_safe_insert (*args, 0, *size);
|
||||
*args = resolve_args (*args, complain);
|
||||
if (*args == NULL)
|
||||
return error_mark_node;
|
||||
|
@ -3985,9 +3980,8 @@ build_operator_new_call (tree fnname, VEC(tree,gc) **args,
|
|||
/* In G++ 3.2, the check was implemented incorrectly; it
|
||||
looked at the placement expression, rather than the
|
||||
type of the function. */
|
||||
if (VEC_length (tree, *args) == 2
|
||||
&& same_type_p (TREE_TYPE (VEC_index (tree, *args, 1)),
|
||||
ptr_type_node))
|
||||
if ((*args)->length () == 2
|
||||
&& same_type_p (TREE_TYPE ((**args)[1]), ptr_type_node))
|
||||
use_cookie = false;
|
||||
}
|
||||
else
|
||||
|
@ -4014,7 +4008,7 @@ build_operator_new_call (tree fnname, VEC(tree,gc) **args,
|
|||
*size = fold_build3 (COND_EXPR, sizetype, size_check,
|
||||
*size, TYPE_MAX_VALUE (sizetype));
|
||||
/* Update the argument list to reflect the adjusted size. */
|
||||
VEC_replace (tree, *args, 0, *size);
|
||||
(**args)[0] = *size;
|
||||
}
|
||||
else
|
||||
*cookie_size = NULL_TREE;
|
||||
|
@ -4031,7 +4025,7 @@ build_operator_new_call (tree fnname, VEC(tree,gc) **args,
|
|||
/* Build a new call to operator(). This may change ARGS. */
|
||||
|
||||
static tree
|
||||
build_op_call_1 (tree obj, VEC(tree,gc) **args, tsubst_flags_t complain)
|
||||
build_op_call_1 (tree obj, vec<tree, va_gc> **args, tsubst_flags_t complain)
|
||||
{
|
||||
struct z_candidate *candidates = 0, *cand;
|
||||
tree fns, convs, first_mem_arg = NULL_TREE;
|
||||
|
@ -4165,7 +4159,7 @@ build_op_call_1 (tree obj, VEC(tree,gc) **args, tsubst_flags_t complain)
|
|||
/* Wrapper for above. */
|
||||
|
||||
tree
|
||||
build_op_call (tree obj, VEC(tree,gc) **args, tsubst_flags_t complain)
|
||||
build_op_call (tree obj, vec<tree, va_gc> **args, tsubst_flags_t complain)
|
||||
{
|
||||
tree ret;
|
||||
bool subtime = timevar_cond_start (TV_OVERLOAD);
|
||||
|
@ -4899,7 +4893,7 @@ prep_operand (tree operand)
|
|||
add_function_candidate. */
|
||||
|
||||
static void
|
||||
add_candidates (tree fns, tree first_arg, const VEC(tree,gc) *args,
|
||||
add_candidates (tree fns, tree first_arg, const vec<tree, va_gc> *args,
|
||||
tree return_type,
|
||||
tree explicit_targs, bool template_only,
|
||||
tree conversion_path, tree access_path,
|
||||
|
@ -4908,7 +4902,7 @@ add_candidates (tree fns, tree first_arg, const VEC(tree,gc) *args,
|
|||
tsubst_flags_t complain)
|
||||
{
|
||||
tree ctype;
|
||||
const VEC(tree,gc) *non_static_args;
|
||||
const vec<tree, va_gc> *non_static_args;
|
||||
bool check_list_ctor;
|
||||
bool check_converting;
|
||||
unification_kind_t strict;
|
||||
|
@ -4964,7 +4958,7 @@ add_candidates (tree fns, tree first_arg, const VEC(tree,gc) *args,
|
|||
for (; fns; fns = OVL_NEXT (fns))
|
||||
{
|
||||
tree fn_first_arg;
|
||||
const VEC(tree,gc) *fn_args;
|
||||
const vec<tree, va_gc> *fn_args;
|
||||
|
||||
fn = OVL_CURRENT (fns);
|
||||
|
||||
|
@ -4982,12 +4976,12 @@ add_candidates (tree fns, tree first_arg, const VEC(tree,gc) *args,
|
|||
{
|
||||
unsigned int ix;
|
||||
tree arg;
|
||||
VEC(tree,gc) *tempvec
|
||||
= VEC_alloc (tree, gc, VEC_length (tree, args) - 1);
|
||||
for (ix = 1; VEC_iterate (tree, args, ix, arg); ++ix)
|
||||
VEC_quick_push (tree, tempvec, arg);
|
||||
vec<tree, va_gc> *tempvec;
|
||||
vec_alloc (tempvec, args->length () - 1);
|
||||
for (ix = 1; args->iterate (ix, &arg); ++ix)
|
||||
tempvec->quick_push (arg);
|
||||
non_static_args = tempvec;
|
||||
first_arg = build_this (VEC_index (tree, args, 0));
|
||||
first_arg = build_this ((*args)[0]);
|
||||
}
|
||||
|
||||
fn_first_arg = first_arg;
|
||||
|
@ -5031,7 +5025,7 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1,
|
|||
tree arg2, tree arg3, tree *overload, tsubst_flags_t complain)
|
||||
{
|
||||
struct z_candidate *candidates = 0, *cand;
|
||||
VEC(tree,gc) *arglist;
|
||||
vec<tree, va_gc> *arglist;
|
||||
tree fnname;
|
||||
tree args[3];
|
||||
tree result = NULL_TREE;
|
||||
|
@ -5098,12 +5092,12 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1,
|
|||
if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR)
|
||||
arg2 = integer_zero_node;
|
||||
|
||||
arglist = VEC_alloc (tree, gc, 3);
|
||||
VEC_quick_push (tree, arglist, arg1);
|
||||
vec_alloc (arglist, 3);
|
||||
arglist->quick_push (arg1);
|
||||
if (arg2 != NULL_TREE)
|
||||
VEC_quick_push (tree, arglist, arg2);
|
||||
arglist->quick_push (arg2);
|
||||
if (arg3 != NULL_TREE)
|
||||
VEC_quick_push (tree, arglist, arg3);
|
||||
arglist->quick_push (arg3);
|
||||
|
||||
/* Get the high-water mark for the CONVERSION_OBSTACK. */
|
||||
p = conversion_obstack_alloc (0);
|
||||
|
@ -5645,12 +5639,13 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
|
|||
else
|
||||
{
|
||||
tree ret;
|
||||
VEC(tree,gc) *args = VEC_alloc (tree, gc, 2);
|
||||
VEC_quick_push (tree, args, addr);
|
||||
vec<tree, va_gc> *args;
|
||||
vec_alloc (args, 2);
|
||||
args->quick_push (addr);
|
||||
if (FUNCTION_ARG_CHAIN (fn) != void_list_node)
|
||||
VEC_quick_push (tree, args, size);
|
||||
args->quick_push (size);
|
||||
ret = cp_build_function_call_vec (fn, &args, complain);
|
||||
VEC_free (tree, gc, args);
|
||||
vec_free (args);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -5715,7 +5710,7 @@ build_temp (tree expr, tree type, int flags,
|
|||
diagnostic_t *diagnostic_kind, tsubst_flags_t complain)
|
||||
{
|
||||
int savew, savee;
|
||||
VEC(tree,gc) *args;
|
||||
vec<tree, va_gc> *args;
|
||||
|
||||
savew = warningcount, savee = errorcount;
|
||||
args = make_tree_vector_single (expr);
|
||||
|
@ -5965,7 +5960,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
|
|||
tree new_ctor = build_constructor (init_list_type_node, NULL);
|
||||
unsigned len = CONSTRUCTOR_NELTS (expr);
|
||||
tree array, val, field;
|
||||
VEC(constructor_elt,gc) *vec = NULL;
|
||||
vec<constructor_elt, va_gc> *vec = NULL;
|
||||
unsigned ix;
|
||||
|
||||
/* Convert all the elements. */
|
||||
|
@ -6340,13 +6335,14 @@ cxx_type_promotes_to (tree type)
|
|||
zero-based argument number. Do any required conversions. Return
|
||||
the converted value. */
|
||||
|
||||
static GTY(()) VEC(tree,gc) *default_arg_context;
|
||||
static GTY(()) vec<tree, va_gc> *default_arg_context;
|
||||
void
|
||||
push_defarg_context (tree fn)
|
||||
{ VEC_safe_push (tree, gc, default_arg_context, fn); }
|
||||
{ vec_safe_push (default_arg_context, fn); }
|
||||
|
||||
void
|
||||
pop_defarg_context (void)
|
||||
{ VEC_pop (tree, default_arg_context); }
|
||||
{ default_arg_context->pop (); }
|
||||
|
||||
tree
|
||||
convert_default_arg (tree type, tree arg, tree fn, int parmnum,
|
||||
|
@ -6359,7 +6355,7 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum,
|
|||
fn = DECL_ORIGIN (fn);
|
||||
|
||||
/* Detect recursion. */
|
||||
FOR_EACH_VEC_ELT (tree, default_arg_context, i, t)
|
||||
FOR_EACH_VEC_SAFE_ELT (default_arg_context, i, t)
|
||||
if (t == fn)
|
||||
{
|
||||
if (complain & tf_error)
|
||||
|
@ -6581,7 +6577,7 @@ static tree
|
|||
build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
|
||||
{
|
||||
tree fn = cand->fn;
|
||||
const VEC(tree,gc) *args = cand->args;
|
||||
const vec<tree, va_gc> *args = cand->args;
|
||||
tree first_arg = cand->first_arg;
|
||||
conversion **convs = cand->convs;
|
||||
conversion *conv;
|
||||
|
@ -6608,9 +6604,9 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
|
|||
unsigned int nargs;
|
||||
|
||||
return_type = TREE_TYPE (TREE_TYPE (fn));
|
||||
nargs = VEC_length (tree, args);
|
||||
nargs = vec_safe_length (args);
|
||||
if (first_arg == NULL_TREE)
|
||||
argarray = VEC_address (tree, CONST_CAST (VEC(tree,gc) *, args));
|
||||
argarray = args->address ();
|
||||
else
|
||||
{
|
||||
tree *alcarray;
|
||||
|
@ -6620,7 +6616,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
|
|||
++nargs;
|
||||
alcarray = XALLOCAVEC (tree, nargs);
|
||||
alcarray[0] = first_arg;
|
||||
FOR_EACH_VEC_ELT (tree, args, ix, arg)
|
||||
FOR_EACH_VEC_SAFE_ELT (args, ix, arg)
|
||||
alcarray[ix + 1] = arg;
|
||||
argarray = alcarray;
|
||||
}
|
||||
|
@ -6705,7 +6701,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
|
|||
|
||||
/* Find maximum size of vector to hold converted arguments. */
|
||||
parmlen = list_length (parm);
|
||||
nargs = VEC_length (tree, args) + (first_arg != NULL_TREE ? 1 : 0);
|
||||
nargs = vec_safe_length (args) + (first_arg != NULL_TREE ? 1 : 0);
|
||||
if (parmlen > nargs)
|
||||
nargs = parmlen;
|
||||
argarray = XALLOCAVEC (tree, nargs);
|
||||
|
@ -6721,7 +6717,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
|
|||
}
|
||||
else
|
||||
{
|
||||
argarray[j++] = VEC_index (tree, args, arg_index);
|
||||
argarray[j++] = (*args)[arg_index];
|
||||
++arg_index;
|
||||
}
|
||||
parm = TREE_CHAIN (parm);
|
||||
|
@ -6730,7 +6726,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
|
|||
|
||||
if (DECL_HAS_VTT_PARM_P (fn))
|
||||
{
|
||||
argarray[j++] = VEC_index (tree, args, arg_index);
|
||||
argarray[j++] = (*args)[arg_index];
|
||||
++arg_index;
|
||||
parm = TREE_CHAIN (parm);
|
||||
}
|
||||
|
@ -6741,7 +6737,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
|
|||
tree parmtype = TREE_VALUE (parm);
|
||||
tree arg = (first_arg != NULL_TREE
|
||||
? first_arg
|
||||
: VEC_index (tree, args, arg_index));
|
||||
: (*args)[arg_index]);
|
||||
tree argtype = TREE_TYPE (arg);
|
||||
tree converted_arg;
|
||||
tree base_binfo;
|
||||
|
@ -6800,11 +6796,11 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
|
|||
}
|
||||
|
||||
gcc_assert (first_arg == NULL_TREE);
|
||||
for (; arg_index < VEC_length (tree, args) && parm;
|
||||
for (; arg_index < vec_safe_length (args) && parm;
|
||||
parm = TREE_CHAIN (parm), ++arg_index, ++i)
|
||||
{
|
||||
tree type = TREE_VALUE (parm);
|
||||
tree arg = VEC_index (tree, args, arg_index);
|
||||
tree arg = (*args)[arg_index];
|
||||
bool conversion_warning = true;
|
||||
|
||||
conv = convs[i];
|
||||
|
@ -6889,9 +6885,9 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
|
|||
}
|
||||
|
||||
/* Ellipsis */
|
||||
for (; arg_index < VEC_length (tree, args); ++arg_index)
|
||||
for (; arg_index < vec_safe_length (args); ++arg_index)
|
||||
{
|
||||
tree a = VEC_index (tree, args, arg_index);
|
||||
tree a = (*args)[arg_index];
|
||||
if (magic_varargs_p (fn))
|
||||
/* Do no conversions for magic varargs. */
|
||||
a = mark_type_use (a);
|
||||
|
@ -7221,13 +7217,13 @@ in_charge_arg_for_name (tree name)
|
|||
store the newly constructed object into a VAR_DECL. */
|
||||
|
||||
tree
|
||||
build_special_member_call (tree instance, tree name, VEC(tree,gc) **args,
|
||||
build_special_member_call (tree instance, tree name, vec<tree, va_gc> **args,
|
||||
tree binfo, int flags, tsubst_flags_t complain)
|
||||
{
|
||||
tree fns;
|
||||
/* The type of the subobject to be constructed or destroyed. */
|
||||
tree class_type;
|
||||
VEC(tree,gc) *allocated = NULL;
|
||||
vec<tree, va_gc> *allocated = NULL;
|
||||
tree ret;
|
||||
|
||||
gcc_assert (name == complete_ctor_identifier
|
||||
|
@ -7260,7 +7256,7 @@ build_special_member_call (tree instance, tree name, VEC(tree,gc) **args,
|
|||
if (name == complete_dtor_identifier
|
||||
|| name == base_dtor_identifier
|
||||
|| name == deleting_dtor_identifier)
|
||||
gcc_assert (args == NULL || VEC_empty (tree, *args));
|
||||
gcc_assert (args == NULL || vec_safe_is_empty (*args));
|
||||
|
||||
/* Convert to the base class, if necessary. */
|
||||
if (!same_type_ignoring_top_level_qualifiers_p
|
||||
|
@ -7318,7 +7314,7 @@ build_special_member_call (tree instance, tree name, VEC(tree,gc) **args,
|
|||
args = &allocated;
|
||||
}
|
||||
|
||||
VEC_safe_insert (tree, gc, *args, 0, sub_vtt);
|
||||
vec_safe_insert (*args, 0, sub_vtt);
|
||||
}
|
||||
|
||||
ret = build_new_method_call (instance, fns, args,
|
||||
|
@ -7382,7 +7378,7 @@ name_as_c_string (tree name, tree type, bool *free_p)
|
|||
This may change ARGS. */
|
||||
|
||||
static tree
|
||||
build_new_method_call_1 (tree instance, tree fns, VEC(tree,gc) **args,
|
||||
build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
|
||||
tree conversion_path, int flags,
|
||||
tree *fn_p, tsubst_flags_t complain)
|
||||
{
|
||||
|
@ -7395,14 +7391,14 @@ build_new_method_call_1 (tree instance, tree fns, VEC(tree,gc) **args,
|
|||
tree instance_ptr;
|
||||
tree name;
|
||||
bool skip_first_for_error;
|
||||
VEC(tree,gc) *user_args;
|
||||
vec<tree, va_gc> *user_args;
|
||||
tree call;
|
||||
tree fn;
|
||||
int template_only = 0;
|
||||
bool any_viable_p;
|
||||
tree orig_instance;
|
||||
tree orig_fns;
|
||||
VEC(tree,gc) *orig_args = NULL;
|
||||
vec<tree, va_gc> *orig_args = NULL;
|
||||
void *p;
|
||||
|
||||
gcc_assert (instance != NULL_TREE);
|
||||
|
@ -7522,14 +7518,14 @@ build_new_method_call_1 (tree instance, tree fns, VEC(tree,gc) **args,
|
|||
|
||||
/* If CONSTRUCTOR_IS_DIRECT_INIT is set, this was a T{ } form
|
||||
initializer, not T({ }). */
|
||||
if (DECL_CONSTRUCTOR_P (fn) && args != NULL && !VEC_empty (tree, *args)
|
||||
&& BRACE_ENCLOSED_INITIALIZER_P (VEC_index (tree, *args, 0))
|
||||
&& CONSTRUCTOR_IS_DIRECT_INIT (VEC_index (tree, *args, 0)))
|
||||
if (DECL_CONSTRUCTOR_P (fn) && args != NULL && !vec_safe_is_empty (*args)
|
||||
&& BRACE_ENCLOSED_INITIALIZER_P ((**args)[0])
|
||||
&& CONSTRUCTOR_IS_DIRECT_INIT ((**args)[0]))
|
||||
{
|
||||
tree init_list = VEC_index (tree, *args, 0);
|
||||
tree init_list = (**args)[0];
|
||||
tree init = NULL_TREE;
|
||||
|
||||
gcc_assert (VEC_length (tree, *args) == 1
|
||||
gcc_assert ((*args)->length () == 1
|
||||
&& !(flags & LOOKUP_ONLYCONVERTING));
|
||||
|
||||
/* If the initializer list has no elements and T is a class type with
|
||||
|
@ -7732,7 +7728,7 @@ build_new_method_call_1 (tree instance, tree fns, VEC(tree,gc) **args,
|
|||
/* Wrapper for above. */
|
||||
|
||||
tree
|
||||
build_new_method_call (tree instance, tree fns, VEC(tree,gc) **args,
|
||||
build_new_method_call (tree instance, tree fns, vec<tree, va_gc> **args,
|
||||
tree conversion_path, int flags,
|
||||
tree *fn_p, tsubst_flags_t complain)
|
||||
{
|
||||
|
@ -8896,7 +8892,7 @@ perform_direct_initialization_if_possible (tree type,
|
|||
ill-formed. */
|
||||
if (CLASS_TYPE_P (type))
|
||||
{
|
||||
VEC(tree,gc) *args = make_tree_vector_single (expr);
|
||||
vec<tree, va_gc> *args = make_tree_vector_single (expr);
|
||||
expr = build_special_member_call (NULL_TREE, complete_ctor_identifier,
|
||||
&args, type, LOOKUP_NORMAL, complain);
|
||||
release_tree_vector (args);
|
||||
|
@ -9003,7 +8999,7 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type)
|
|||
code to initialize the new variable is returned through INITP. */
|
||||
|
||||
static tree
|
||||
set_up_extended_ref_temp (tree decl, tree expr, VEC(tree,gc) **cleanups,
|
||||
set_up_extended_ref_temp (tree decl, tree expr, vec<tree, va_gc> **cleanups,
|
||||
tree *initp)
|
||||
{
|
||||
tree init;
|
||||
|
@ -9076,7 +9072,7 @@ set_up_extended_ref_temp (tree decl, tree expr, VEC(tree,gc) **cleanups,
|
|||
{
|
||||
tree cleanup = cxx_maybe_build_cleanup (var, tf_warning_or_error);
|
||||
if (cleanup)
|
||||
VEC_safe_push (tree, gc, *cleanups, cleanup);
|
||||
vec_safe_push (*cleanups, cleanup);
|
||||
}
|
||||
|
||||
/* We must be careful to destroy the temporary only
|
||||
|
@ -9170,7 +9166,7 @@ initialize_reference (tree type, tree expr,
|
|||
which is bound either to a reference or a std::initializer_list. */
|
||||
|
||||
static tree
|
||||
extend_ref_init_temps_1 (tree decl, tree init, VEC(tree,gc) **cleanups)
|
||||
extend_ref_init_temps_1 (tree decl, tree init, vec<tree, va_gc> **cleanups)
|
||||
{
|
||||
tree sub = init;
|
||||
tree *p;
|
||||
|
@ -9201,7 +9197,7 @@ extend_ref_init_temps_1 (tree decl, tree init, VEC(tree,gc) **cleanups)
|
|||
lifetime to match that of DECL. */
|
||||
|
||||
tree
|
||||
extend_ref_init_temps (tree decl, tree init, VEC(tree,gc) **cleanups)
|
||||
extend_ref_init_temps (tree decl, tree init, vec<tree, va_gc> **cleanups)
|
||||
{
|
||||
tree type = TREE_TYPE (init);
|
||||
if (processing_template_decl)
|
||||
|
@ -9226,8 +9222,8 @@ extend_ref_init_temps (tree decl, tree init, VEC(tree,gc) **cleanups)
|
|||
{
|
||||
unsigned i;
|
||||
constructor_elt *p;
|
||||
VEC(constructor_elt,gc) *elts = CONSTRUCTOR_ELTS (init);
|
||||
FOR_EACH_VEC_ELT (constructor_elt, elts, i, p)
|
||||
vec<constructor_elt, va_gc> *elts = CONSTRUCTOR_ELTS (init);
|
||||
FOR_EACH_VEC_SAFE_ELT (elts, i, p)
|
||||
p->value = extend_ref_init_temps (decl, p->value, cleanups);
|
||||
}
|
||||
|
||||
|
|
173
gcc/cp/class.c
173
gcc/cp/class.c
|
@ -79,13 +79,13 @@ typedef struct vtbl_init_data_s
|
|||
tree rtti_binfo;
|
||||
/* The negative-index vtable initializers built up so far. These
|
||||
are in order from least negative index to most negative index. */
|
||||
VEC(constructor_elt,gc) *inits;
|
||||
vec<constructor_elt, va_gc> *inits;
|
||||
/* The binfo for the virtual base for which we're building
|
||||
vcall offset initializers. */
|
||||
tree vbase;
|
||||
/* The functions in vbase for which we have already provided vcall
|
||||
offsets. */
|
||||
VEC(tree,gc) *fns;
|
||||
vec<tree, va_gc> *fns;
|
||||
/* The vtable index of the next vcall or vbase offset. */
|
||||
tree index;
|
||||
/* Nonzero if we are building the initializer for the primary
|
||||
|
@ -112,7 +112,7 @@ static GTY (()) tree sizeof_biggest_empty_class;
|
|||
|
||||
/* An array of all local classes present in this translation unit, in
|
||||
declaration order. */
|
||||
VEC(tree,gc) *local_classes;
|
||||
vec<tree, va_gc> *local_classes;
|
||||
|
||||
static tree get_vfield_name (tree);
|
||||
static void finish_struct_anon (tree);
|
||||
|
@ -137,7 +137,7 @@ static tree fixed_type_or_null (tree, int *, int *);
|
|||
static tree build_simple_base_path (tree expr, tree binfo);
|
||||
static tree build_vtbl_ref_1 (tree, tree);
|
||||
static void build_vtbl_initializer (tree, tree, tree, tree, int *,
|
||||
VEC(constructor_elt,gc) **);
|
||||
vec<constructor_elt, va_gc> **);
|
||||
static int count_fields (tree);
|
||||
static int add_fields_to_record_type (tree, struct sorted_fields_type*, int);
|
||||
static void insert_into_classtype_sorted_fields (tree, tree, int);
|
||||
|
@ -175,15 +175,15 @@ static void dump_vtable (tree, tree, tree);
|
|||
static void dump_vtt (tree, tree);
|
||||
static void dump_thunk (FILE *, int, tree);
|
||||
static tree build_vtable (tree, tree, tree);
|
||||
static void initialize_vtable (tree, VEC(constructor_elt,gc) *);
|
||||
static void initialize_vtable (tree, vec<constructor_elt, va_gc> *);
|
||||
static void layout_nonempty_base_or_field (record_layout_info,
|
||||
tree, tree, splay_tree);
|
||||
static tree end_of_class (tree, int);
|
||||
static bool layout_empty_base (record_layout_info, tree, tree, splay_tree);
|
||||
static void accumulate_vtbl_inits (tree, tree, tree, tree, tree,
|
||||
VEC(constructor_elt,gc) **);
|
||||
vec<constructor_elt, va_gc> **);
|
||||
static void dfs_accumulate_vtbl_inits (tree, tree, tree, tree, tree,
|
||||
VEC(constructor_elt,gc) **);
|
||||
vec<constructor_elt, va_gc> **);
|
||||
static void build_rtti_vtbl_entries (tree, vtbl_init_data *);
|
||||
static void build_vcall_and_vbase_vtbl_entries (tree, vtbl_init_data *);
|
||||
static void clone_constructors_and_destructors (tree);
|
||||
|
@ -192,7 +192,8 @@ static void update_vtable_entry_for_fn (tree, tree, tree, tree *, unsigned);
|
|||
static void build_ctor_vtbl_group (tree, tree);
|
||||
static void build_vtt (tree);
|
||||
static tree binfo_ctor_vtable (tree);
|
||||
static void build_vtt_inits (tree, tree, VEC(constructor_elt,gc) **, tree *);
|
||||
static void build_vtt_inits (tree, tree, vec<constructor_elt, va_gc> **,
|
||||
tree *);
|
||||
static tree dfs_build_secondary_vptr_vtt_inits (tree, void *);
|
||||
static tree dfs_fixup_binfo_vtbls (tree, void *);
|
||||
static int record_subobject_offset (tree, tree, splay_tree);
|
||||
|
@ -948,7 +949,7 @@ add_method (tree type, tree method, tree using_decl)
|
|||
tree overload;
|
||||
bool template_conv_p = false;
|
||||
bool conv_p;
|
||||
VEC(tree,gc) *method_vec;
|
||||
vec<tree, va_gc> *method_vec;
|
||||
bool complete_p;
|
||||
bool insert_p = false;
|
||||
tree current_fns;
|
||||
|
@ -970,10 +971,10 @@ add_method (tree type, tree method, tree using_decl)
|
|||
allocate at least two (for constructors and destructors), and
|
||||
we're going to end up with an assignment operator at some
|
||||
point as well. */
|
||||
method_vec = VEC_alloc (tree, gc, 8);
|
||||
vec_alloc (method_vec, 8);
|
||||
/* Create slots for constructors and destructors. */
|
||||
VEC_quick_push (tree, method_vec, NULL_TREE);
|
||||
VEC_quick_push (tree, method_vec, NULL_TREE);
|
||||
method_vec->quick_push (NULL_TREE);
|
||||
method_vec->quick_push (NULL_TREE);
|
||||
CLASSTYPE_METHOD_VEC (type) = method_vec;
|
||||
}
|
||||
|
||||
|
@ -1004,7 +1005,7 @@ add_method (tree type, tree method, tree using_decl)
|
|||
insert_p = true;
|
||||
/* See if we already have an entry with this name. */
|
||||
for (slot = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
VEC_iterate (tree, method_vec, slot, m);
|
||||
vec_safe_iterate (method_vec, slot, &m);
|
||||
++slot)
|
||||
{
|
||||
m = OVL_CURRENT (m);
|
||||
|
@ -1028,7 +1029,7 @@ add_method (tree type, tree method, tree using_decl)
|
|||
break;
|
||||
}
|
||||
}
|
||||
current_fns = insert_p ? NULL_TREE : VEC_index (tree, method_vec, slot);
|
||||
current_fns = insert_p ? NULL_TREE : (*method_vec)[slot];
|
||||
|
||||
/* Check to see if we've already got this method. */
|
||||
for (fns = current_fns; fns; fns = OVL_NEXT (fns))
|
||||
|
@ -1175,19 +1176,19 @@ add_method (tree type, tree method, tree using_decl)
|
|||
/* We only expect to add few methods in the COMPLETE_P case, so
|
||||
just make room for one more method in that case. */
|
||||
if (complete_p)
|
||||
reallocated = VEC_reserve_exact (tree, gc, method_vec, 1);
|
||||
reallocated = vec_safe_reserve_exact (method_vec, 1);
|
||||
else
|
||||
reallocated = VEC_reserve (tree, gc, method_vec, 1);
|
||||
reallocated = vec_safe_reserve (method_vec, 1);
|
||||
if (reallocated)
|
||||
CLASSTYPE_METHOD_VEC (type) = method_vec;
|
||||
if (slot == VEC_length (tree, method_vec))
|
||||
VEC_quick_push (tree, method_vec, overload);
|
||||
if (slot == method_vec->length ())
|
||||
method_vec->quick_push (overload);
|
||||
else
|
||||
VEC_quick_insert (tree, method_vec, slot, overload);
|
||||
method_vec->quick_insert (slot, overload);
|
||||
}
|
||||
else
|
||||
/* Replace the current slot. */
|
||||
VEC_replace (tree, method_vec, slot, overload);
|
||||
(*method_vec)[slot] = overload;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1953,15 +1954,15 @@ resort_type_method_vec (void* obj,
|
|||
gt_pointer_operator new_value,
|
||||
void* cookie)
|
||||
{
|
||||
VEC(tree,gc) *method_vec = (VEC(tree,gc) *) obj;
|
||||
int len = VEC_length (tree, method_vec);
|
||||
vec<tree, va_gc> *method_vec = (vec<tree, va_gc> *) obj;
|
||||
int len = vec_safe_length (method_vec);
|
||||
size_t slot;
|
||||
tree fn;
|
||||
|
||||
/* The type conversion ops have to live at the front of the vec, so we
|
||||
can't sort them. */
|
||||
for (slot = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
VEC_iterate (tree, method_vec, slot, fn);
|
||||
vec_safe_iterate (method_vec, slot, &fn);
|
||||
++slot)
|
||||
if (!DECL_CONV_FN_P (OVL_CURRENT (fn)))
|
||||
break;
|
||||
|
@ -1970,7 +1971,7 @@ resort_type_method_vec (void* obj,
|
|||
{
|
||||
resort_data.new_value = new_value;
|
||||
resort_data.cookie = cookie;
|
||||
qsort (VEC_address (tree, method_vec) + slot, len - slot, sizeof (tree),
|
||||
qsort (method_vec->address () + slot, len - slot, sizeof (tree),
|
||||
resort_method_name_cmp);
|
||||
}
|
||||
}
|
||||
|
@ -1985,14 +1986,14 @@ static void
|
|||
finish_struct_methods (tree t)
|
||||
{
|
||||
tree fn_fields;
|
||||
VEC(tree,gc) *method_vec;
|
||||
vec<tree, va_gc> *method_vec;
|
||||
int slot, len;
|
||||
|
||||
method_vec = CLASSTYPE_METHOD_VEC (t);
|
||||
if (!method_vec)
|
||||
return;
|
||||
|
||||
len = VEC_length (tree, method_vec);
|
||||
len = method_vec->length ();
|
||||
|
||||
/* Clear DECL_IN_AGGR_P for all functions. */
|
||||
for (fn_fields = TYPE_METHODS (t); fn_fields;
|
||||
|
@ -2006,12 +2007,12 @@ finish_struct_methods (tree t)
|
|||
/* The type conversion ops have to live at the front of the vec, so we
|
||||
can't sort them. */
|
||||
for (slot = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
VEC_iterate (tree, method_vec, slot, fn_fields);
|
||||
method_vec->iterate (slot, &fn_fields);
|
||||
++slot)
|
||||
if (!DECL_CONV_FN_P (OVL_CURRENT (fn_fields)))
|
||||
break;
|
||||
if (len - slot > 1)
|
||||
qsort (VEC_address (tree, method_vec) + slot,
|
||||
qsort (method_vec->address () + slot,
|
||||
len-slot, sizeof (tree), method_name_cmp);
|
||||
}
|
||||
|
||||
|
@ -2103,7 +2104,7 @@ typedef struct find_final_overrider_data_s {
|
|||
/* The candidate overriders. */
|
||||
tree candidates;
|
||||
/* Path to most derived. */
|
||||
VEC(tree,heap) *path;
|
||||
vec<tree> path;
|
||||
} find_final_overrider_data;
|
||||
|
||||
/* Add the overrider along the current path to FFOD->CANDIDATES.
|
||||
|
@ -2122,7 +2123,7 @@ dfs_find_final_overrider_1 (tree binfo,
|
|||
{
|
||||
depth--;
|
||||
if (dfs_find_final_overrider_1
|
||||
(VEC_index (tree, ffod->path, depth), ffod, depth))
|
||||
(ffod->path[depth], ffod, depth))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2161,8 +2162,8 @@ dfs_find_final_overrider_pre (tree binfo, void *data)
|
|||
find_final_overrider_data *ffod = (find_final_overrider_data *) data;
|
||||
|
||||
if (binfo == ffod->declaring_base)
|
||||
dfs_find_final_overrider_1 (binfo, ffod, VEC_length (tree, ffod->path));
|
||||
VEC_safe_push (tree, heap, ffod->path, binfo);
|
||||
dfs_find_final_overrider_1 (binfo, ffod, ffod->path.length ());
|
||||
ffod->path.safe_push (binfo);
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
@ -2171,7 +2172,7 @@ static tree
|
|||
dfs_find_final_overrider_post (tree /*binfo*/, void *data)
|
||||
{
|
||||
find_final_overrider_data *ffod = (find_final_overrider_data *) data;
|
||||
VEC_pop (tree, ffod->path);
|
||||
ffod->path.pop ();
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
@ -2211,12 +2212,12 @@ find_final_overrider (tree derived, tree binfo, tree fn)
|
|||
ffod.fn = fn;
|
||||
ffod.declaring_base = binfo;
|
||||
ffod.candidates = NULL_TREE;
|
||||
ffod.path = VEC_alloc (tree, heap, 30);
|
||||
ffod.path.create (30);
|
||||
|
||||
dfs_walk_all (derived, dfs_find_final_overrider_pre,
|
||||
dfs_find_final_overrider_post, &ffod);
|
||||
|
||||
VEC_free (tree, heap, ffod.path);
|
||||
ffod.path.release ();
|
||||
|
||||
/* If there was no winner, issue an error message. */
|
||||
if (!ffod.candidates || TREE_CHAIN (ffod.candidates))
|
||||
|
@ -2231,11 +2232,11 @@ find_final_overrider (tree derived, tree binfo, tree fn)
|
|||
static tree
|
||||
get_vcall_index (tree fn, tree type)
|
||||
{
|
||||
VEC(tree_pair_s,gc) *indices = CLASSTYPE_VCALL_INDICES (type);
|
||||
vec<tree_pair_s, va_gc> *indices = CLASSTYPE_VCALL_INDICES (type);
|
||||
tree_pair_p p;
|
||||
unsigned ix;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree_pair_s, indices, ix, p)
|
||||
FOR_EACH_VEC_SAFE_ELT (indices, ix, p)
|
||||
if ((DECL_DESTRUCTOR_P (fn) && DECL_DESTRUCTOR_P (p->purpose))
|
||||
|| same_signature_p (fn, p->purpose))
|
||||
return p->value;
|
||||
|
@ -2589,7 +2590,7 @@ get_basefndecls (tree name, tree t)
|
|||
/* Find virtual functions in T with the indicated NAME. */
|
||||
i = lookup_fnfields_1 (t, name);
|
||||
if (i != -1)
|
||||
for (methods = VEC_index (tree, CLASSTYPE_METHOD_VEC (t), i);
|
||||
for (methods = (*CLASSTYPE_METHOD_VEC (t))[i];
|
||||
methods;
|
||||
methods = OVL_NEXT (methods))
|
||||
{
|
||||
|
@ -2660,13 +2661,13 @@ check_for_override (tree decl, tree ctype)
|
|||
static void
|
||||
warn_hidden (tree t)
|
||||
{
|
||||
VEC(tree,gc) *method_vec = CLASSTYPE_METHOD_VEC (t);
|
||||
vec<tree, va_gc> *method_vec = CLASSTYPE_METHOD_VEC (t);
|
||||
tree fns;
|
||||
size_t i;
|
||||
|
||||
/* We go through each separately named virtual function. */
|
||||
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
VEC_iterate (tree, method_vec, i, fns);
|
||||
vec_safe_iterate (method_vec, i, &fns);
|
||||
++i)
|
||||
{
|
||||
tree fn;
|
||||
|
@ -3704,7 +3705,7 @@ walk_subobject_offsets (tree type,
|
|||
if (abi_version_at_least (2) && CLASSTYPE_VBASECLASSES (type))
|
||||
{
|
||||
unsigned ix;
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
|
||||
/* Iterate through the virtual base classes of TYPE. In G++
|
||||
3.2, we included virtual bases in the direct base class
|
||||
|
@ -3713,7 +3714,7 @@ walk_subobject_offsets (tree type,
|
|||
working with the most derived type. */
|
||||
if (vbases_p)
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (type), ix = 0;
|
||||
VEC_iterate (tree, vbases, ix, binfo); ix++)
|
||||
vec_safe_iterate (vbases, ix, &binfo); ix++)
|
||||
{
|
||||
r = walk_subobject_offsets (binfo,
|
||||
f,
|
||||
|
@ -4221,7 +4222,7 @@ check_methods (tree t)
|
|||
{
|
||||
TYPE_POLYMORPHIC_P (t) = 1;
|
||||
if (DECL_PURE_VIRTUAL_P (x))
|
||||
VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x);
|
||||
vec_safe_push (CLASSTYPE_PURE_VIRTUALS (t), x);
|
||||
}
|
||||
/* All user-provided destructors are non-trivial.
|
||||
Constructors and assignment ops are handled in
|
||||
|
@ -5620,7 +5621,7 @@ static tree
|
|||
end_of_class (tree t, int include_virtuals_p)
|
||||
{
|
||||
tree result = size_zero_node;
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
tree binfo;
|
||||
tree base_binfo;
|
||||
tree offset;
|
||||
|
@ -5643,7 +5644,7 @@ end_of_class (tree t, int include_virtuals_p)
|
|||
/* G++ 3.2 did not check indirect virtual bases. */
|
||||
if (abi_version_at_least (2) && include_virtuals_p)
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (t), i = 0;
|
||||
VEC_iterate (tree, vbases, i, base_binfo); i++)
|
||||
vec_safe_iterate (vbases, i, &base_binfo); i++)
|
||||
{
|
||||
offset = end_of_base (base_binfo);
|
||||
if (INT_CST_LT_UNSIGNED (result, offset))
|
||||
|
@ -5667,7 +5668,7 @@ static void
|
|||
warn_about_ambiguous_bases (tree t)
|
||||
{
|
||||
int i;
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
tree basetype;
|
||||
tree binfo;
|
||||
tree base_binfo;
|
||||
|
@ -5690,7 +5691,7 @@ warn_about_ambiguous_bases (tree t)
|
|||
/* Check for ambiguous virtual bases. */
|
||||
if (extra_warnings)
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (t), i = 0;
|
||||
VEC_iterate (tree, vbases, i, binfo); i++)
|
||||
vec_safe_iterate (vbases, i, &binfo); i++)
|
||||
{
|
||||
basetype = BINFO_TYPE (binfo);
|
||||
|
||||
|
@ -6520,7 +6521,7 @@ finish_struct (tree t, tree attributes)
|
|||
CLASSTYPE_PURE_VIRTUALS (t) = NULL;
|
||||
for (x = TYPE_METHODS (t); x; x = DECL_CHAIN (x))
|
||||
if (DECL_PURE_VIRTUAL_P (x))
|
||||
VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x);
|
||||
vec_safe_push (CLASSTYPE_PURE_VIRTUALS (t), x);
|
||||
complete_vars (t);
|
||||
/* We need to add the target functions to the CLASSTYPE_METHOD_VEC if
|
||||
an enclosing scope is a template class, so that this function be
|
||||
|
@ -6766,7 +6767,7 @@ init_class_processing (void)
|
|||
current_class_stack_size = 10;
|
||||
current_class_stack
|
||||
= XNEWVEC (struct class_stack_node, current_class_stack_size);
|
||||
local_classes = VEC_alloc (tree, gc, 8);
|
||||
vec_alloc (local_classes, 8);
|
||||
sizeof_biggest_empty_class = size_zero_node;
|
||||
|
||||
ridpointers[(int) RID_PUBLIC] = access_public_node;
|
||||
|
@ -7028,7 +7029,7 @@ pop_nested_class (void)
|
|||
int
|
||||
current_lang_depth (void)
|
||||
{
|
||||
return VEC_length (tree, current_lang_base);
|
||||
return vec_safe_length (current_lang_base);
|
||||
}
|
||||
|
||||
/* Set global variables CURRENT_LANG_NAME to appropriate value
|
||||
|
@ -7037,7 +7038,7 @@ current_lang_depth (void)
|
|||
void
|
||||
push_lang_context (tree name)
|
||||
{
|
||||
VEC_safe_push (tree, gc, current_lang_base, current_lang_name);
|
||||
vec_safe_push (current_lang_base, current_lang_name);
|
||||
|
||||
if (name == lang_name_cplusplus)
|
||||
{
|
||||
|
@ -7072,7 +7073,7 @@ push_lang_context (tree name)
|
|||
void
|
||||
pop_lang_context (void)
|
||||
{
|
||||
current_lang_name = VEC_pop (tree, current_lang_base);
|
||||
current_lang_name = current_lang_base->pop ();
|
||||
}
|
||||
|
||||
/* Type instantiation routines. */
|
||||
|
@ -8051,7 +8052,7 @@ static void
|
|||
finish_vtbls (tree t)
|
||||
{
|
||||
tree vbase;
|
||||
VEC(constructor_elt,gc) *v = NULL;
|
||||
vec<constructor_elt, va_gc> *v = NULL;
|
||||
tree vtable = BINFO_VTABLE (TYPE_BINFO (t));
|
||||
|
||||
/* We lay out the primary and secondary vtables in one contiguous
|
||||
|
@ -8075,11 +8076,11 @@ finish_vtbls (tree t)
|
|||
/* Initialize the vtable for BINFO with the INITS. */
|
||||
|
||||
static void
|
||||
initialize_vtable (tree binfo, VEC(constructor_elt,gc) *inits)
|
||||
initialize_vtable (tree binfo, vec<constructor_elt, va_gc> *inits)
|
||||
{
|
||||
tree decl;
|
||||
|
||||
layout_vtable_decl (binfo, VEC_length (constructor_elt, inits));
|
||||
layout_vtable_decl (binfo, vec_safe_length (inits));
|
||||
decl = get_vtbl_decl_for_binfo (binfo);
|
||||
initialize_artificial_var (decl, inits);
|
||||
dump_vtable (BINFO_TYPE (binfo), binfo, decl);
|
||||
|
@ -8104,7 +8105,7 @@ build_vtt (tree t)
|
|||
tree type;
|
||||
tree vtt;
|
||||
tree index;
|
||||
VEC(constructor_elt,gc) *inits;
|
||||
vec<constructor_elt, va_gc> *inits;
|
||||
|
||||
/* Build up the initializers for the VTT. */
|
||||
inits = NULL;
|
||||
|
@ -8117,7 +8118,7 @@ build_vtt (tree t)
|
|||
|
||||
/* Figure out the type of the VTT. */
|
||||
type = build_array_of_n_type (const_ptr_type_node,
|
||||
VEC_length (constructor_elt, inits));
|
||||
inits->length ());
|
||||
|
||||
/* Now, build the VTT object itself. */
|
||||
vtt = build_vtable (t, mangle_vtt_for_type (t), type);
|
||||
|
@ -8163,7 +8164,7 @@ typedef struct secondary_vptr_vtt_init_data_s
|
|||
tree index;
|
||||
|
||||
/* Vector of initializers built up. */
|
||||
VEC(constructor_elt,gc) *inits;
|
||||
vec<constructor_elt, va_gc> *inits;
|
||||
|
||||
/* The type being constructed by this secondary VTT. */
|
||||
tree type_being_constructed;
|
||||
|
@ -8178,7 +8179,8 @@ typedef struct secondary_vptr_vtt_init_data_s
|
|||
vtables for the BINFO-in-T variant. */
|
||||
|
||||
static void
|
||||
build_vtt_inits (tree binfo, tree t, VEC(constructor_elt,gc) **inits, tree *index)
|
||||
build_vtt_inits (tree binfo, tree t, vec<constructor_elt, va_gc> **inits,
|
||||
tree *index)
|
||||
{
|
||||
int i;
|
||||
tree b;
|
||||
|
@ -8338,7 +8340,7 @@ build_ctor_vtbl_group (tree binfo, tree t)
|
|||
tree vtbl;
|
||||
tree id;
|
||||
tree vbase;
|
||||
VEC(constructor_elt,gc) *v;
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
|
||||
/* See if we've already created this construction vtable group. */
|
||||
id = mangle_ctor_vtbl_for_type (t, binfo);
|
||||
|
@ -8372,8 +8374,7 @@ build_ctor_vtbl_group (tree binfo, tree t)
|
|||
}
|
||||
|
||||
/* Figure out the type of the construction vtable. */
|
||||
type = build_array_of_n_type (vtable_entry_type,
|
||||
VEC_length (constructor_elt, v));
|
||||
type = build_array_of_n_type (vtable_entry_type, v->length ());
|
||||
layout_type (type);
|
||||
TREE_TYPE (vtbl) = type;
|
||||
DECL_SIZE (vtbl) = DECL_SIZE_UNIT (vtbl) = NULL_TREE;
|
||||
|
@ -8401,7 +8402,7 @@ accumulate_vtbl_inits (tree binfo,
|
|||
tree rtti_binfo,
|
||||
tree vtbl,
|
||||
tree t,
|
||||
VEC(constructor_elt,gc) **inits)
|
||||
vec<constructor_elt, va_gc> **inits)
|
||||
{
|
||||
int i;
|
||||
tree base_binfo;
|
||||
|
@ -8449,7 +8450,7 @@ dfs_accumulate_vtbl_inits (tree binfo,
|
|||
tree rtti_binfo,
|
||||
tree orig_vtbl,
|
||||
tree t,
|
||||
VEC(constructor_elt,gc) **l)
|
||||
vec<constructor_elt, va_gc> **l)
|
||||
{
|
||||
tree vtbl = NULL_TREE;
|
||||
int ctor_vtbl_p = !SAME_BINFO_TYPE_P (BINFO_TYPE (rtti_binfo), t);
|
||||
|
@ -8509,7 +8510,7 @@ dfs_accumulate_vtbl_inits (tree binfo,
|
|||
else if (!BINFO_NEW_VTABLE_MARKED (orig_binfo))
|
||||
return;
|
||||
|
||||
n_inits = VEC_length (constructor_elt, *l);
|
||||
n_inits = vec_safe_length (*l);
|
||||
|
||||
if (!vtbl)
|
||||
{
|
||||
|
@ -8535,7 +8536,7 @@ dfs_accumulate_vtbl_inits (tree binfo,
|
|||
BINFO_VTABLE (binfo) = tree_cons (rtti_binfo, vtbl, BINFO_VTABLE (binfo));
|
||||
else if (BINFO_PRIMARY_P (binfo) && BINFO_VIRTUAL_P (binfo))
|
||||
/* Throw away any unneeded intializers. */
|
||||
VEC_truncate (constructor_elt, *l, n_inits);
|
||||
(*l)->truncate (n_inits);
|
||||
else
|
||||
/* For an ordinary vtable, set BINFO_VTABLE. */
|
||||
BINFO_VTABLE (binfo) = vtbl;
|
||||
|
@ -8572,13 +8573,13 @@ build_vtbl_initializer (tree binfo,
|
|||
tree t,
|
||||
tree rtti_binfo,
|
||||
int* non_fn_entries_p,
|
||||
VEC(constructor_elt,gc) **inits)
|
||||
vec<constructor_elt, va_gc> **inits)
|
||||
{
|
||||
tree v;
|
||||
vtbl_init_data vid;
|
||||
unsigned ix, jx;
|
||||
tree vbinfo;
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
constructor_elt *e;
|
||||
|
||||
/* Initialize VID. */
|
||||
|
@ -8598,41 +8599,39 @@ build_vtbl_initializer (tree binfo,
|
|||
/* Create an array for keeping track of the functions we've
|
||||
processed. When we see multiple functions with the same
|
||||
signature, we share the vcall offsets. */
|
||||
vid.fns = VEC_alloc (tree, gc, 32);
|
||||
vec_alloc (vid.fns, 32);
|
||||
/* Add the vcall and vbase offset entries. */
|
||||
build_vcall_and_vbase_vtbl_entries (binfo, &vid);
|
||||
|
||||
/* Clear BINFO_VTABLE_PATH_MARKED; it's set by
|
||||
build_vbase_offset_vtbl_entries. */
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (t), ix = 0;
|
||||
VEC_iterate (tree, vbases, ix, vbinfo); ix++)
|
||||
vec_safe_iterate (vbases, ix, &vbinfo); ix++)
|
||||
BINFO_VTABLE_PATH_MARKED (vbinfo) = 0;
|
||||
|
||||
/* If the target requires padding between data entries, add that now. */
|
||||
if (TARGET_VTABLE_DATA_ENTRY_DISTANCE > 1)
|
||||
{
|
||||
int n_entries = VEC_length (constructor_elt, vid.inits);
|
||||
int n_entries = vec_safe_length (vid.inits);
|
||||
|
||||
VEC_safe_grow (constructor_elt, gc, vid.inits,
|
||||
TARGET_VTABLE_DATA_ENTRY_DISTANCE * n_entries);
|
||||
vec_safe_grow (vid.inits, TARGET_VTABLE_DATA_ENTRY_DISTANCE * n_entries);
|
||||
|
||||
/* Move data entries into their new positions and add padding
|
||||
after the new positions. Iterate backwards so we don't
|
||||
overwrite entries that we would need to process later. */
|
||||
for (ix = n_entries - 1;
|
||||
VEC_iterate (constructor_elt, vid.inits, ix, e);
|
||||
vid.inits->iterate (ix, &e);
|
||||
ix--)
|
||||
{
|
||||
int j;
|
||||
int new_position = (TARGET_VTABLE_DATA_ENTRY_DISTANCE * ix
|
||||
+ (TARGET_VTABLE_DATA_ENTRY_DISTANCE - 1));
|
||||
|
||||
VEC_replace (constructor_elt, vid.inits, new_position, *e);
|
||||
(*vid.inits)[new_position] = *e;
|
||||
|
||||
for (j = 1; j < TARGET_VTABLE_DATA_ENTRY_DISTANCE; ++j)
|
||||
{
|
||||
constructor_elt *f = &VEC_index (constructor_elt, vid.inits,
|
||||
new_position - j);
|
||||
constructor_elt *f = &(*vid.inits)[new_position - j];
|
||||
f->index = NULL_TREE;
|
||||
f->value = build1 (NOP_EXPR, vtable_entry_type,
|
||||
null_pointer_node);
|
||||
|
@ -8641,19 +8640,18 @@ build_vtbl_initializer (tree binfo,
|
|||
}
|
||||
|
||||
if (non_fn_entries_p)
|
||||
*non_fn_entries_p = VEC_length (constructor_elt, vid.inits);
|
||||
*non_fn_entries_p = vec_safe_length (vid.inits);
|
||||
|
||||
/* The initializers for virtual functions were built up in reverse
|
||||
order. Straighten them out and add them to the running list in one
|
||||
step. */
|
||||
jx = VEC_length (constructor_elt, *inits);
|
||||
VEC_safe_grow (constructor_elt, gc, *inits,
|
||||
(jx + VEC_length (constructor_elt, vid.inits)));
|
||||
jx = vec_safe_length (*inits);
|
||||
vec_safe_grow (*inits, jx + vid.inits->length ());
|
||||
|
||||
for (ix = VEC_length (constructor_elt, vid.inits) - 1;
|
||||
VEC_iterate (constructor_elt, vid.inits, ix, e);
|
||||
for (ix = vid.inits->length () - 1;
|
||||
vid.inits->iterate (ix, &e);
|
||||
ix--, jx++)
|
||||
VEC_replace (constructor_elt, *inits, jx, *e);
|
||||
(**inits)[jx] = *e;
|
||||
|
||||
/* Go through all the ordinary virtual functions, building up
|
||||
initializers. */
|
||||
|
@ -9053,7 +9051,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid)
|
|||
signature as FN, then we do not need a second vcall offset.
|
||||
Check the list of functions already present in the derived
|
||||
class vtable. */
|
||||
FOR_EACH_VEC_ELT (tree, vid->fns, i, derived_entry)
|
||||
FOR_EACH_VEC_SAFE_ELT (vid->fns, i, derived_entry)
|
||||
{
|
||||
if (same_signature_p (derived_entry, orig_fn)
|
||||
/* We only use one vcall offset for virtual destructors,
|
||||
|
@ -9069,8 +9067,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid)
|
|||
if (vid->binfo == TYPE_BINFO (vid->derived))
|
||||
{
|
||||
tree_pair_s elt = {orig_fn, vid->index};
|
||||
VEC_safe_push (tree_pair_s, gc, CLASSTYPE_VCALL_INDICES (vid->derived),
|
||||
elt);
|
||||
vec_safe_push (CLASSTYPE_VCALL_INDICES (vid->derived), elt);
|
||||
}
|
||||
|
||||
/* The next vcall offset will be found at a more negative
|
||||
|
@ -9079,7 +9076,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid)
|
|||
ssize_int (TARGET_VTABLE_DATA_ENTRY_DISTANCE));
|
||||
|
||||
/* Keep track of this function. */
|
||||
VEC_safe_push (tree, gc, vid->fns, orig_fn);
|
||||
vec_safe_push (vid->fns, orig_fn);
|
||||
|
||||
if (vid->generate_vcall_entries)
|
||||
{
|
||||
|
|
|
@ -824,7 +824,7 @@ omp_cxx_notice_variable (struct cp_genericize_omp_taskreg *omp_ctx, tree decl)
|
|||
struct cp_genericize_data
|
||||
{
|
||||
struct pointer_set_t *p_set;
|
||||
VEC (tree, heap) *bind_expr_stack;
|
||||
vec<tree> bind_expr_stack;
|
||||
struct cp_genericize_omp_taskreg *omp_ctx;
|
||||
};
|
||||
|
||||
|
@ -1015,10 +1015,10 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
|
|||
: OMP_CLAUSE_DEFAULT_PRIVATE);
|
||||
}
|
||||
}
|
||||
VEC_safe_push (tree, heap, wtd->bind_expr_stack, stmt);
|
||||
wtd->bind_expr_stack.safe_push (stmt);
|
||||
cp_walk_tree (&BIND_EXPR_BODY (stmt),
|
||||
cp_genericize_r, data, NULL);
|
||||
VEC_pop (tree, wtd->bind_expr_stack);
|
||||
wtd->bind_expr_stack.pop ();
|
||||
}
|
||||
|
||||
else if (TREE_CODE (stmt) == USING_STMT)
|
||||
|
@ -1028,12 +1028,11 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
|
|||
/* Get the innermost inclosing GIMPLE_BIND that has a non NULL
|
||||
BLOCK, and append an IMPORTED_DECL to its
|
||||
BLOCK_VARS chained list. */
|
||||
if (wtd->bind_expr_stack)
|
||||
if (wtd->bind_expr_stack.exists ())
|
||||
{
|
||||
int i;
|
||||
for (i = VEC_length (tree, wtd->bind_expr_stack) - 1; i >= 0; i--)
|
||||
if ((block = BIND_EXPR_BLOCK (VEC_index (tree,
|
||||
wtd->bind_expr_stack, i))))
|
||||
for (i = wtd->bind_expr_stack.length () - 1; i >= 0; i--)
|
||||
if ((block = BIND_EXPR_BLOCK (wtd->bind_expr_stack[i])))
|
||||
break;
|
||||
}
|
||||
if (block)
|
||||
|
@ -1151,11 +1150,11 @@ cp_genericize_tree (tree* t_p)
|
|||
struct cp_genericize_data wtd;
|
||||
|
||||
wtd.p_set = pointer_set_create ();
|
||||
wtd.bind_expr_stack = NULL;
|
||||
wtd.bind_expr_stack.create (0);
|
||||
wtd.omp_ctx = NULL;
|
||||
cp_walk_tree (t_p, cp_genericize_r, &wtd, NULL);
|
||||
pointer_set_destroy (wtd.p_set);
|
||||
VEC_free (tree, heap, wtd.bind_expr_stack);
|
||||
wtd.bind_expr_stack.release ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -535,7 +535,7 @@ typedef enum impl_conv_void {
|
|||
struct GTY (()) tree_default_arg {
|
||||
struct tree_common common;
|
||||
struct cp_token_cache *tokens;
|
||||
VEC(tree,gc) *instantiations;
|
||||
vec<tree, va_gc> *instantiations;
|
||||
};
|
||||
|
||||
|
||||
|
@ -709,7 +709,7 @@ struct GTY (()) tree_lambda_expr
|
|||
tree return_type;
|
||||
tree extra_scope;
|
||||
tree closure;
|
||||
VEC(tree,gc)* pending_proxies;
|
||||
vec<tree, va_gc> *pending_proxies;
|
||||
location_t locus;
|
||||
enum cp_lambda_default_capture_mode_type default_capture_mode;
|
||||
int discriminator;
|
||||
|
@ -735,8 +735,6 @@ struct GTY(()) qualified_typedef_usage_s {
|
|||
location_t locus;
|
||||
};
|
||||
typedef struct qualified_typedef_usage_s qualified_typedef_usage_t;
|
||||
DEF_VEC_O (qualified_typedef_usage_t);
|
||||
DEF_VEC_ALLOC_O (qualified_typedef_usage_t,gc);
|
||||
|
||||
/* Non-zero if this template specialization has access violations that
|
||||
should be rechecked when the function is instantiated outside argument
|
||||
|
@ -748,7 +746,7 @@ DEF_VEC_ALLOC_O (qualified_typedef_usage_t,gc);
|
|||
|
||||
struct GTY(()) tree_template_info {
|
||||
struct tree_common common;
|
||||
VEC(qualified_typedef_usage_t,gc) *typedefs_needing_access_checking;
|
||||
vec<qualified_typedef_usage_t, va_gc> *typedefs_needing_access_checking;
|
||||
};
|
||||
|
||||
enum cp_tree_node_structure_enum {
|
||||
|
@ -986,14 +984,14 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
|
|||
/* Global state. */
|
||||
|
||||
struct GTY(()) saved_scope {
|
||||
VEC(cxx_saved_binding,gc) *old_bindings;
|
||||
vec<cxx_saved_binding, va_gc> *old_bindings;
|
||||
tree old_namespace;
|
||||
VEC(tree,gc) *decl_ns_list;
|
||||
vec<tree, va_gc> *decl_ns_list;
|
||||
tree class_name;
|
||||
tree class_type;
|
||||
tree access_specifier;
|
||||
tree function_decl;
|
||||
VEC(tree,gc) *lang_base;
|
||||
vec<tree, va_gc> *lang_base;
|
||||
tree lang_name;
|
||||
tree template_parms;
|
||||
cp_binding_level *x_previous_class_level;
|
||||
|
@ -1102,7 +1100,7 @@ struct GTY(()) language_function {
|
|||
|
||||
htab_t GTY((param_is(struct named_label_entry))) x_named_labels;
|
||||
cp_binding_level *bindings;
|
||||
VEC(tree,gc) *x_local_names;
|
||||
vec<tree, va_gc> *x_local_names;
|
||||
htab_t GTY((param_is (struct cxx_int_tree_map))) extern_decl_map;
|
||||
};
|
||||
|
||||
|
@ -1304,8 +1302,6 @@ typedef struct GTY (()) tree_pair_s {
|
|||
tree value;
|
||||
} tree_pair_s;
|
||||
typedef tree_pair_s *tree_pair_p;
|
||||
DEF_VEC_O (tree_pair_s);
|
||||
DEF_VEC_ALLOC_O (tree_pair_s,gc);
|
||||
|
||||
/* This is a few header flags for 'struct lang_type'. Actually,
|
||||
all but the first are used only for lang_type_class; they
|
||||
|
@ -1401,15 +1397,15 @@ struct GTY(()) lang_type_class {
|
|||
unsigned dummy : 2;
|
||||
|
||||
tree primary_base;
|
||||
VEC(tree_pair_s,gc) *vcall_indices;
|
||||
vec<tree_pair_s, va_gc> *vcall_indices;
|
||||
tree vtables;
|
||||
tree typeinfo_var;
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
binding_table nested_udts;
|
||||
tree as_base;
|
||||
VEC(tree,gc) *pure_virtuals;
|
||||
vec<tree, va_gc> *pure_virtuals;
|
||||
tree friend_classes;
|
||||
VEC(tree,gc) * GTY((reorder ("resort_type_method_vec"))) methods;
|
||||
vec<tree, va_gc> * GTY((reorder ("resort_type_method_vec"))) methods;
|
||||
tree key_method;
|
||||
tree decl_list;
|
||||
tree template_info;
|
||||
|
@ -1603,7 +1599,7 @@ struct GTY((variable_size)) lang_type {
|
|||
/* A FUNCTION_DECL or OVERLOAD for the constructors for NODE. These
|
||||
are the constructors that take an in-charge parameter. */
|
||||
#define CLASSTYPE_CONSTRUCTORS(NODE) \
|
||||
(VEC_index (tree, CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_CONSTRUCTOR_SLOT))
|
||||
((*CLASSTYPE_METHOD_VEC (NODE))[CLASSTYPE_CONSTRUCTOR_SLOT])
|
||||
|
||||
/* A FUNCTION_DECL for the destructor for NODE. These are the
|
||||
destructors that take an in-charge parameter. If
|
||||
|
@ -1611,7 +1607,7 @@ struct GTY((variable_size)) lang_type {
|
|||
until the destructor is created with lazily_declare_fn. */
|
||||
#define CLASSTYPE_DESTRUCTORS(NODE) \
|
||||
(CLASSTYPE_METHOD_VEC (NODE) \
|
||||
? VEC_index (tree, CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_DESTRUCTOR_SLOT) \
|
||||
? (*CLASSTYPE_METHOD_VEC (NODE))[CLASSTYPE_DESTRUCTOR_SLOT] \
|
||||
: NULL_TREE)
|
||||
|
||||
/* A dictionary of the nested user-defined-types (class-types, or enums)
|
||||
|
@ -1665,7 +1661,7 @@ struct GTY((variable_size)) lang_type {
|
|||
#define TYPE_JAVA_INTERFACE(NODE) \
|
||||
(LANG_TYPE_CLASS_CHECK (NODE)->java_interface)
|
||||
|
||||
/* A VEC(tree) of virtual functions which cannot be inherited by
|
||||
/* A vec<tree> of virtual functions which cannot be inherited by
|
||||
derived classes. When deriving from this type, the derived
|
||||
class must provide its own definition for each of these functions. */
|
||||
#define CLASSTYPE_PURE_VIRTUALS(NODE) \
|
||||
|
@ -1815,7 +1811,7 @@ struct GTY((variable_size)) lang_type {
|
|||
/* Used by various search routines. */
|
||||
#define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
|
||||
|
||||
/* A VEC(tree_pair_s) of the vcall indices associated with the class
|
||||
/* A vec<tree_pair_s> of the vcall indices associated with the class
|
||||
NODE. The PURPOSE of each element is a FUNCTION_DECL for a virtual
|
||||
function. The VALUE is the index into the virtual table where the
|
||||
vcall offset for that function is stored, when NODE is a virtual
|
||||
|
@ -3345,8 +3341,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
|
|||
(TREE_CODE (NODE) == CONSTRUCTOR && TREE_HAS_CONSTRUCTOR (NODE))
|
||||
|
||||
#define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR \
|
||||
&& VEC_empty (constructor_elt, \
|
||||
CONSTRUCTOR_ELTS (NODE)) \
|
||||
&& vec_safe_is_empty(CONSTRUCTOR_ELTS(NODE))\
|
||||
&& !TREE_HAS_CONSTRUCTOR (NODE))
|
||||
|
||||
/* True if NODE is a init-list used as a direct-initializer, i.e.
|
||||
|
@ -4281,7 +4276,7 @@ extern int current_class_depth;
|
|||
|
||||
/* An array of all local classes present in this translation unit, in
|
||||
declaration order. */
|
||||
extern GTY(()) VEC(tree,gc) *local_classes;
|
||||
extern GTY(()) vec<tree, va_gc> *local_classes;
|
||||
|
||||
/* Here's where we control how name mangling takes place. */
|
||||
|
||||
|
@ -4917,20 +4912,20 @@ extern bool sufficient_parms_p (const_tree);
|
|||
extern tree type_decays_to (tree);
|
||||
extern tree build_user_type_conversion (tree, tree, int,
|
||||
tsubst_flags_t);
|
||||
extern tree build_new_function_call (tree, VEC(tree,gc) **, bool,
|
||||
extern tree build_new_function_call (tree, vec<tree, va_gc> **, bool,
|
||||
tsubst_flags_t);
|
||||
extern tree build_operator_new_call (tree, VEC(tree,gc) **, tree *,
|
||||
extern tree build_operator_new_call (tree, vec<tree, va_gc> **, tree *,
|
||||
tree *, tree, tree *,
|
||||
tsubst_flags_t);
|
||||
extern tree build_new_method_call (tree, tree, VEC(tree,gc) **,
|
||||
extern tree build_new_method_call (tree, tree, vec<tree, va_gc> **,
|
||||
tree, int, tree *,
|
||||
tsubst_flags_t);
|
||||
extern tree build_special_member_call (tree, tree, VEC(tree,gc) **,
|
||||
extern tree build_special_member_call (tree, tree, vec<tree, va_gc> **,
|
||||
tree, int, tsubst_flags_t);
|
||||
extern tree build_new_op (location_t, enum tree_code,
|
||||
int, tree, tree, tree, tree *,
|
||||
tsubst_flags_t);
|
||||
extern tree build_op_call (tree, VEC(tree,gc) **,
|
||||
extern tree build_op_call (tree, vec<tree, va_gc> **,
|
||||
tsubst_flags_t);
|
||||
extern tree build_op_delete_call (enum tree_code, tree, tree,
|
||||
bool, tree, tree,
|
||||
|
@ -4954,7 +4949,7 @@ extern tree convert_for_arg_passing (tree, tree, tsubst_flags_t);
|
|||
extern bool is_properly_derived_from (tree, tree);
|
||||
extern tree initialize_reference (tree, tree, int,
|
||||
tsubst_flags_t);
|
||||
extern tree extend_ref_init_temps (tree, tree, VEC(tree,gc)**);
|
||||
extern tree extend_ref_init_temps (tree, tree, vec<tree, va_gc>**);
|
||||
extern tree make_temporary_var_for_ref_to_temp (tree, tree);
|
||||
extern tree strip_top_quals (tree);
|
||||
extern bool reference_related_p (tree, tree);
|
||||
|
@ -5161,13 +5156,13 @@ extern tree check_elaborated_type_specifier (enum tag_types, tree, bool);
|
|||
extern void warn_extern_redeclared_static (tree, tree);
|
||||
extern tree cxx_comdat_group (tree);
|
||||
extern bool cp_missing_noreturn_ok_p (tree);
|
||||
extern void initialize_artificial_var (tree, VEC(constructor_elt,gc) *);
|
||||
extern void initialize_artificial_var (tree, vec<constructor_elt, va_gc> *);
|
||||
extern tree check_var_type (tree, tree);
|
||||
extern tree reshape_init (tree, tree, tsubst_flags_t);
|
||||
extern tree next_initializable_field (tree);
|
||||
|
||||
extern bool defer_mark_used_calls;
|
||||
extern GTY(()) VEC(tree, gc) *deferred_mark_used_calls;
|
||||
extern GTY(()) vec<tree, va_gc> *deferred_mark_used_calls;
|
||||
extern tree finish_case_label (location_t, tree, tree);
|
||||
extern tree cxx_maybe_build_cleanup (tree, tsubst_flags_t);
|
||||
|
||||
|
@ -5199,7 +5194,7 @@ extern void determine_visibility (tree);
|
|||
extern void constrain_class_visibility (tree);
|
||||
extern void import_export_decl (tree);
|
||||
extern tree build_cleanup (tree);
|
||||
extern tree build_offset_ref_call_from_tree (tree, VEC(tree,gc) **,
|
||||
extern tree build_offset_ref_call_from_tree (tree, vec<tree, va_gc> **,
|
||||
tsubst_flags_t);
|
||||
extern bool decl_constant_var_p (tree);
|
||||
extern bool decl_maybe_constant_var_p (tree);
|
||||
|
@ -5285,8 +5280,8 @@ extern tree build_zero_init (tree, tree, bool);
|
|||
extern tree build_value_init (tree, tsubst_flags_t);
|
||||
extern tree build_value_init_noctor (tree, tsubst_flags_t);
|
||||
extern tree build_offset_ref (tree, tree, bool);
|
||||
extern tree build_new (VEC(tree,gc) **, tree, tree,
|
||||
VEC(tree,gc) **, int,
|
||||
extern tree build_new (vec<tree, va_gc> **, tree, tree,
|
||||
vec<tree, va_gc> **, int,
|
||||
tsubst_flags_t);
|
||||
extern tree get_temp_regvar (tree, tree);
|
||||
extern tree build_vec_init (tree, tree, tree, bool, int,
|
||||
|
@ -5408,7 +5403,7 @@ extern tree make_pack_expansion (tree);
|
|||
extern bool check_for_bare_parameter_packs (tree);
|
||||
extern tree build_template_info (tree, tree);
|
||||
extern tree get_template_info (const_tree);
|
||||
extern VEC(qualified_typedef_usage_t,gc)* get_types_needing_access_check (tree);
|
||||
extern vec<qualified_typedef_usage_t, va_gc> *get_types_needing_access_check (tree);
|
||||
extern int template_class_depth (tree);
|
||||
extern int is_specialization_of (tree, tree);
|
||||
extern bool is_specialization_of_friend (tree, tree);
|
||||
|
@ -5435,7 +5430,7 @@ extern bool any_dependent_template_arguments_p (const_tree);
|
|||
extern bool dependent_template_p (tree);
|
||||
extern bool dependent_template_id_p (tree, tree);
|
||||
extern bool type_dependent_expression_p (tree);
|
||||
extern bool any_type_dependent_arguments_p (const VEC(tree,gc) *);
|
||||
extern bool any_type_dependent_arguments_p (const vec<tree, va_gc> *);
|
||||
extern bool any_type_dependent_elements_p (const_tree);
|
||||
extern bool type_dependent_expression_p_push (tree);
|
||||
extern bool value_dependent_expression_p (tree);
|
||||
|
@ -5445,7 +5440,7 @@ extern bool dependent_omp_for_p (tree, tree, tree, tree);
|
|||
extern tree resolve_typename_type (tree, bool);
|
||||
extern tree template_for_substitution (tree);
|
||||
extern tree build_non_dependent_expr (tree);
|
||||
extern void make_args_non_dependent (VEC(tree,gc) *);
|
||||
extern void make_args_non_dependent (vec<tree, va_gc> *);
|
||||
extern bool reregister_specialization (tree, tree, tree);
|
||||
extern tree fold_non_dependent_expr (tree);
|
||||
extern tree fold_non_dependent_expr_sfinae (tree, tsubst_flags_t);
|
||||
|
@ -5476,7 +5471,7 @@ extern void finish_repo (void);
|
|||
|
||||
/* in rtti.c */
|
||||
/* A vector of all tinfo decls that haven't been emitted yet. */
|
||||
extern GTY(()) VEC(tree,gc) *unemitted_tinfo_decls;
|
||||
extern GTY(()) vec<tree, va_gc> *unemitted_tinfo_decls;
|
||||
|
||||
extern void init_rtti_processing (void);
|
||||
extern tree build_typeid (tree);
|
||||
|
@ -5543,17 +5538,15 @@ typedef struct GTY(()) deferred_access_check {
|
|||
/* The location of this access. */
|
||||
location_t loc;
|
||||
} deferred_access_check;
|
||||
DEF_VEC_O(deferred_access_check);
|
||||
DEF_VEC_ALLOC_O(deferred_access_check,gc);
|
||||
|
||||
/* in semantics.c */
|
||||
extern void push_deferring_access_checks (deferring_kind);
|
||||
extern void resume_deferring_access_checks (void);
|
||||
extern void stop_deferring_access_checks (void);
|
||||
extern void pop_deferring_access_checks (void);
|
||||
extern VEC (deferred_access_check,gc)* get_deferred_access_checks (void);
|
||||
extern vec<deferred_access_check, va_gc> *get_deferred_access_checks (void);
|
||||
extern void pop_to_parent_deferring_access_checks (void);
|
||||
extern bool perform_access_checks (VEC (deferred_access_check,gc)*,
|
||||
extern bool perform_access_checks (vec<deferred_access_check, va_gc> *,
|
||||
tsubst_flags_t);
|
||||
extern bool perform_deferred_access_checks (tsubst_flags_t);
|
||||
extern bool perform_or_defer_access_check (tree, tree, tree,
|
||||
|
@ -5617,7 +5610,7 @@ extern tree maybe_constant_init (tree);
|
|||
extern bool is_sub_constant_expr (tree);
|
||||
extern bool reduced_constant_expression_p (tree);
|
||||
extern void explain_invalid_constexpr_fn (tree);
|
||||
extern VEC(tree,heap)* cx_error_context (void);
|
||||
extern vec<tree> cx_error_context (void);
|
||||
|
||||
enum {
|
||||
BCS_NO_SCOPE = 1,
|
||||
|
@ -5638,9 +5631,9 @@ extern tree finish_stmt_expr_expr (tree, tree);
|
|||
extern tree finish_stmt_expr (tree, bool);
|
||||
extern tree stmt_expr_value_expr (tree);
|
||||
bool empty_expr_stmt_p (tree);
|
||||
extern tree perform_koenig_lookup (tree, VEC(tree,gc) *, bool,
|
||||
extern tree perform_koenig_lookup (tree, vec<tree, va_gc> *, bool,
|
||||
tsubst_flags_t);
|
||||
extern tree finish_call_expr (tree, VEC(tree,gc) **, bool,
|
||||
extern tree finish_call_expr (tree, vec<tree, va_gc> **, bool,
|
||||
bool, tsubst_flags_t);
|
||||
extern tree finish_increment_expr (tree, enum tree_code);
|
||||
extern tree finish_this_expr (void);
|
||||
|
@ -5766,7 +5759,7 @@ extern tree build_min (enum tree_code, tree, ...);
|
|||
extern tree build_min_nt_loc (location_t, enum tree_code,
|
||||
...);
|
||||
extern tree build_min_non_dep (enum tree_code, tree, ...);
|
||||
extern tree build_min_non_dep_call_vec (tree, tree, VEC(tree,gc) *);
|
||||
extern tree build_min_non_dep_call_vec (tree, tree, vec<tree, va_gc> *);
|
||||
extern tree build_cplus_new (tree, tree, tsubst_flags_t);
|
||||
extern tree build_aggr_init_expr (tree, tree, tsubst_flags_t);
|
||||
extern tree get_target_expr (tree);
|
||||
|
@ -5887,7 +5880,7 @@ extern tree get_member_function_from_ptrfunc (tree *, tree, tsubst_flags_t);
|
|||
extern tree cp_build_function_call (tree, tree, tsubst_flags_t);
|
||||
extern tree cp_build_function_call_nary (tree, tsubst_flags_t, ...)
|
||||
ATTRIBUTE_SENTINEL;
|
||||
extern tree cp_build_function_call_vec (tree, VEC(tree,gc) **,
|
||||
extern tree cp_build_function_call_vec (tree, vec<tree, va_gc> **,
|
||||
tsubst_flags_t);
|
||||
extern tree build_x_binary_op (location_t,
|
||||
enum tree_code, tree,
|
||||
|
@ -5908,8 +5901,8 @@ extern tree build_x_conditional_expr (location_t, tree, tree, tree,
|
|||
tsubst_flags_t);
|
||||
extern tree build_x_compound_expr_from_list (tree, expr_list_kind,
|
||||
tsubst_flags_t);
|
||||
extern tree build_x_compound_expr_from_vec (VEC(tree,gc) *, const char *,
|
||||
tsubst_flags_t);
|
||||
extern tree build_x_compound_expr_from_vec (vec<tree, va_gc> *,
|
||||
const char *, tsubst_flags_t);
|
||||
extern tree build_x_compound_expr (location_t, tree, tree,
|
||||
tsubst_flags_t);
|
||||
extern tree build_compound_expr (location_t, tree, tree);
|
||||
|
@ -5985,7 +5978,7 @@ extern void complete_type_check_abstract (tree);
|
|||
extern int abstract_virtuals_error (tree, tree);
|
||||
extern int abstract_virtuals_error_sfinae (tree, tree, tsubst_flags_t);
|
||||
|
||||
extern tree store_init_value (tree, tree, VEC(tree,gc)**, int);
|
||||
extern tree store_init_value (tree, tree, vec<tree, va_gc>**, int);
|
||||
extern void check_narrowing (tree, tree);
|
||||
extern tree digest_init (tree, tree, tsubst_flags_t);
|
||||
extern tree digest_init_flags (tree, tree, int);
|
||||
|
|
|
@ -561,7 +561,7 @@ force_rvalue (tree expr, tsubst_flags_t complain)
|
|||
tree type = TREE_TYPE (expr);
|
||||
if (MAYBE_CLASS_TYPE_P (type) && TREE_CODE (expr) != TARGET_EXPR)
|
||||
{
|
||||
VEC(tree,gc) *args = make_tree_vector_single (expr);
|
||||
vec<tree, va_gc> *args = make_tree_vector_single (expr);
|
||||
expr = build_special_member_call (NULL_TREE, complete_ctor_identifier,
|
||||
&args, type, LOOKUP_NORMAL, complain);
|
||||
release_tree_vector (args);
|
||||
|
@ -855,7 +855,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags,
|
|||
ctor = build_user_type_conversion (type, ctor, flags, complain);
|
||||
else
|
||||
{
|
||||
VEC(tree,gc) *ctor_vec = make_tree_vector_single (ctor);
|
||||
vec<tree, va_gc> *ctor_vec = make_tree_vector_single (ctor);
|
||||
ctor = build_special_member_call (NULL_TREE,
|
||||
complete_ctor_identifier,
|
||||
&ctor_vec,
|
||||
|
|
126
gcc/cp/decl.c
126
gcc/cp/decl.c
|
@ -91,7 +91,7 @@ static tree lookup_and_check_tag (enum tag_types, tree, tag_scope, bool);
|
|||
static int walk_namespaces_r (tree, walk_namespaces_fn, void *);
|
||||
static void maybe_deduce_size_from_array_init (tree, tree);
|
||||
static void layout_var_decl (tree);
|
||||
static tree check_initializer (tree, tree, int, VEC(tree,gc) **);
|
||||
static tree check_initializer (tree, tree, int, vec<tree, va_gc> **);
|
||||
static void make_rtl_for_nonlocal_decl (tree, tree, const char *);
|
||||
static void save_function_data (tree);
|
||||
static void copy_type_enum (tree , tree);
|
||||
|
@ -218,7 +218,7 @@ struct GTY(()) named_label_entry {
|
|||
tree names_in_scope;
|
||||
/* A vector of all decls from all binding levels that would be
|
||||
crossed by a backward branch to the label. */
|
||||
VEC(tree,gc) *bad_decls;
|
||||
vec<tree, va_gc> *bad_decls;
|
||||
|
||||
/* A list of uses of the label, before the label is defined. */
|
||||
struct named_label_use_entry *uses;
|
||||
|
@ -241,7 +241,7 @@ int function_depth;
|
|||
/* To avoid unwanted recursion, finish_function defers all mark_used calls
|
||||
encountered during its execution until it finishes. */
|
||||
bool defer_mark_used_calls;
|
||||
VEC(tree, gc) *deferred_mark_used_calls;
|
||||
vec<tree, va_gc> *deferred_mark_used_calls;
|
||||
|
||||
/* States indicating how grokdeclarator() should handle declspecs marked
|
||||
with __attribute__((deprecated)). An object declared as
|
||||
|
@ -258,10 +258,8 @@ typedef struct GTY(()) incomplete_var_d {
|
|||
tree incomplete_type;
|
||||
} incomplete_var;
|
||||
|
||||
DEF_VEC_O(incomplete_var);
|
||||
DEF_VEC_ALLOC_O(incomplete_var,gc);
|
||||
|
||||
static GTY(()) VEC(incomplete_var,gc) *incomplete_vars;
|
||||
static GTY(()) vec<incomplete_var, va_gc> *incomplete_vars;
|
||||
|
||||
/* Returns the kind of template specialization we are currently
|
||||
processing, given that it's declaration contained N_CLASS_SCOPES
|
||||
|
@ -486,7 +484,7 @@ poplevel_named_label_1 (void **slot, void *data)
|
|||
? DECL_CHAIN (decl)
|
||||
: TREE_CHAIN (decl)))
|
||||
if (decl_jump_unsafe (decl))
|
||||
VEC_safe_push (tree, gc, ent->bad_decls, decl);
|
||||
vec_safe_push (ent->bad_decls, decl);
|
||||
|
||||
ent->binding_level = obl;
|
||||
ent->names_in_scope = obl->names;
|
||||
|
@ -567,8 +565,7 @@ poplevel (int keep, int reverse, int functionbody)
|
|||
functionbody = 0;
|
||||
subblocks = functionbody >= 0 ? current_binding_level->blocks : 0;
|
||||
|
||||
gcc_assert (!VEC_length(cp_class_binding,
|
||||
current_binding_level->class_shadowed));
|
||||
gcc_assert (!vec_safe_length (current_binding_level->class_shadowed));
|
||||
|
||||
/* We used to use KEEP == 2 to indicate that the new block should go
|
||||
at the beginning of the list of blocks at this binding level,
|
||||
|
@ -708,9 +705,9 @@ poplevel (int keep, int reverse, int functionbody)
|
|||
/* Add it to the list of dead variables in the next
|
||||
outermost binding to that we can remove these when we
|
||||
leave that binding. */
|
||||
VEC_safe_push (tree, gc,
|
||||
current_binding_level->level_chain->dead_vars_from_for,
|
||||
link);
|
||||
vec_safe_push (
|
||||
current_binding_level->level_chain->dead_vars_from_for,
|
||||
link);
|
||||
|
||||
/* Although we don't pop the cxx_binding, we do clear
|
||||
its SCOPE since the scope is going away now. */
|
||||
|
@ -739,8 +736,8 @@ poplevel (int keep, int reverse, int functionbody)
|
|||
|
||||
/* Remove declarations for any `for' variables from inner scopes
|
||||
that we kept around. */
|
||||
FOR_EACH_VEC_ELT_REVERSE (tree, current_binding_level->dead_vars_from_for,
|
||||
ix, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT_REVERSE (current_binding_level->dead_vars_from_for,
|
||||
ix, decl)
|
||||
pop_binding (DECL_NAME (decl), decl);
|
||||
|
||||
/* Restore the IDENTIFIER_TYPE_VALUEs. */
|
||||
|
@ -749,9 +746,8 @@ poplevel (int keep, int reverse, int functionbody)
|
|||
SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (link), TREE_VALUE (link));
|
||||
|
||||
/* Restore the IDENTIFIER_LABEL_VALUEs for local labels. */
|
||||
FOR_EACH_VEC_ELT_REVERSE (cp_label_binding,
|
||||
current_binding_level->shadowed_labels,
|
||||
ix, label_bind)
|
||||
FOR_EACH_VEC_SAFE_ELT_REVERSE (current_binding_level->shadowed_labels,
|
||||
ix, label_bind)
|
||||
pop_local_label (label_bind->label, label_bind->prev_value);
|
||||
|
||||
/* There may be OVERLOADs (wrapped in TREE_LISTs) on the BLOCK_VARs
|
||||
|
@ -866,9 +862,9 @@ int
|
|||
wrapup_globals_for_namespace (tree name_space, void* data)
|
||||
{
|
||||
cp_binding_level *level = NAMESPACE_LEVEL (name_space);
|
||||
VEC(tree,gc) *statics = level->static_decls;
|
||||
tree *vec = VEC_address (tree, statics);
|
||||
int len = VEC_length (tree, statics);
|
||||
vec<tree, va_gc> *statics = level->static_decls;
|
||||
tree *vec = statics->address ();
|
||||
int len = statics->length ();
|
||||
int last_time = (data != 0);
|
||||
|
||||
if (last_time)
|
||||
|
@ -917,10 +913,10 @@ push_local_name (tree decl)
|
|||
|
||||
name = DECL_NAME (decl);
|
||||
|
||||
nelts = VEC_length (tree, local_names);
|
||||
nelts = vec_safe_length (local_names);
|
||||
for (i = 0; i < nelts; i++)
|
||||
{
|
||||
t = VEC_index (tree, local_names, i);
|
||||
t = (*local_names)[i];
|
||||
if (DECL_NAME (t) == name)
|
||||
{
|
||||
if (!DECL_LANG_SPECIFIC (decl))
|
||||
|
@ -931,13 +927,13 @@ push_local_name (tree decl)
|
|||
else
|
||||
DECL_DISCRIMINATOR (decl) = 1;
|
||||
|
||||
VEC_replace (tree, local_names, i, decl);
|
||||
(*local_names)[i] = decl;
|
||||
timevar_stop (TV_NAME_LOOKUP);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
VEC_safe_push (tree, gc, local_names, decl);
|
||||
vec_safe_push (local_names, decl);
|
||||
timevar_stop (TV_NAME_LOOKUP);
|
||||
}
|
||||
|
||||
|
@ -2706,8 +2702,7 @@ declare_local_label (tree id)
|
|||
|
||||
decl = make_label_decl (id, /*local_p=*/1);
|
||||
bind.label = decl;
|
||||
VEC_safe_push (cp_label_binding, gc, current_binding_level->shadowed_labels,
|
||||
bind);
|
||||
vec_safe_push (current_binding_level->shadowed_labels, bind);
|
||||
|
||||
return decl;
|
||||
}
|
||||
|
@ -2890,14 +2885,14 @@ check_goto (tree decl)
|
|||
}
|
||||
|
||||
if (ent->in_try_scope || ent->in_catch_scope
|
||||
|| ent->in_omp_scope || !VEC_empty (tree, ent->bad_decls))
|
||||
|| ent->in_omp_scope || !vec_safe_is_empty (ent->bad_decls))
|
||||
{
|
||||
permerror (input_location, "jump to label %q+D", decl);
|
||||
permerror (input_location, " from here");
|
||||
identified = true;
|
||||
}
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, ent->bad_decls, ix, bad)
|
||||
FOR_EACH_VEC_SAFE_ELT (ent->bad_decls, ix, bad)
|
||||
{
|
||||
int u = decl_jump_unsafe (bad);
|
||||
|
||||
|
@ -4824,10 +4819,10 @@ maybe_deduce_size_from_array_init (tree decl, tree init)
|
|||
initializer. */
|
||||
if (initializer && TREE_CODE (initializer) == CONSTRUCTOR)
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (initializer);
|
||||
vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (initializer);
|
||||
constructor_elt *ce;
|
||||
HOST_WIDE_INT i;
|
||||
FOR_EACH_VEC_ELT (constructor_elt, v, i, ce)
|
||||
FOR_EACH_VEC_SAFE_ELT (v, i, ce)
|
||||
if (!check_array_designated_initializer (ce, i))
|
||||
failure = 1;
|
||||
}
|
||||
|
@ -5308,7 +5303,7 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p,
|
|||
}
|
||||
else if (first_initializer_p && d->cur != d->end)
|
||||
{
|
||||
VEC(constructor_elt, gc) *v = 0;
|
||||
vec<constructor_elt, va_gc> *v = 0;
|
||||
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init);
|
||||
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, d->cur->value);
|
||||
if (has_designator_problem (d, complain))
|
||||
|
@ -5382,10 +5377,9 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p,
|
|||
element (as allowed by [dcl.init.string]). */
|
||||
if (!first_initializer_p
|
||||
&& TREE_CODE (str_init) == CONSTRUCTOR
|
||||
&& VEC_length (constructor_elt, CONSTRUCTOR_ELTS (str_init)) == 1)
|
||||
&& vec_safe_length (CONSTRUCTOR_ELTS (str_init)) == 1)
|
||||
{
|
||||
str_init = VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (str_init), 0).value;
|
||||
str_init = (*CONSTRUCTOR_ELTS (str_init))[0].value;
|
||||
}
|
||||
|
||||
/* If it's a string literal, then it's the initializer for the array
|
||||
|
@ -5453,15 +5447,15 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p,
|
|||
struct S { int a; int b; };
|
||||
struct S a[] = { 1, 2, 3, 4 };
|
||||
|
||||
Here INIT will hold a VEC of four elements, rather than a
|
||||
VEC of two elements, each itself a VEC of two elements. This
|
||||
Here INIT will hold a vector of four elements, rather than a
|
||||
vector of two elements, each itself a vector of two elements. This
|
||||
routine transforms INIT from the former form into the latter. The
|
||||
revised CONSTRUCTOR node is returned. */
|
||||
|
||||
tree
|
||||
reshape_init (tree type, tree init, tsubst_flags_t complain)
|
||||
{
|
||||
VEC(constructor_elt, gc) *v;
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
reshape_iter d;
|
||||
tree new_init;
|
||||
|
||||
|
@ -5471,12 +5465,12 @@ reshape_init (tree type, tree init, tsubst_flags_t complain)
|
|||
|
||||
/* An empty constructor does not need reshaping, and it is always a valid
|
||||
initializer. */
|
||||
if (VEC_empty (constructor_elt, v))
|
||||
if (vec_safe_is_empty (v))
|
||||
return init;
|
||||
|
||||
/* Recurse on this CONSTRUCTOR. */
|
||||
d.cur = &VEC_index (constructor_elt, v, 0);
|
||||
d.end = d.cur + VEC_length (constructor_elt, v);
|
||||
d.cur = &(*v)[0];
|
||||
d.end = d.cur + v->length ();
|
||||
|
||||
new_init = reshape_init_r (type, &d, true, complain);
|
||||
if (new_init == error_mark_node)
|
||||
|
@ -5546,7 +5540,7 @@ build_aggr_init_full_exprs (tree decl, tree init, int flags)
|
|||
evaluated dynamically to initialize DECL. */
|
||||
|
||||
static tree
|
||||
check_initializer (tree decl, tree init, int flags, VEC(tree,gc) **cleanups)
|
||||
check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups)
|
||||
{
|
||||
tree type = TREE_TYPE (decl);
|
||||
tree init_code = NULL;
|
||||
|
@ -5586,7 +5580,7 @@ check_initializer (tree decl, tree init, int flags, VEC(tree,gc) **cleanups)
|
|||
|
||||
if (init && BRACE_ENCLOSED_INITIALIZER_P (init))
|
||||
{
|
||||
int init_len = VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init));
|
||||
int init_len = vec_safe_length (CONSTRUCTOR_ELTS (init));
|
||||
if (SCALAR_TYPE_P (type))
|
||||
{
|
||||
if (init_len == 0)
|
||||
|
@ -5991,7 +5985,7 @@ initialize_local_var (tree decl, tree init)
|
|||
back end. */
|
||||
|
||||
void
|
||||
initialize_artificial_var (tree decl, VEC(constructor_elt,gc) *v)
|
||||
initialize_artificial_var (tree decl, vec<constructor_elt, va_gc> *v)
|
||||
{
|
||||
tree init;
|
||||
gcc_assert (DECL_ARTIFICIAL (decl));
|
||||
|
@ -6017,15 +6011,14 @@ type_dependent_init_p (tree init)
|
|||
else if (TREE_CODE (init) == CONSTRUCTOR)
|
||||
/* A brace-enclosed initializer, e.g.: int i = { 3 }; ? */
|
||||
{
|
||||
VEC(constructor_elt, gc) *elts;
|
||||
vec<constructor_elt, va_gc> *elts;
|
||||
size_t nelts;
|
||||
size_t i;
|
||||
|
||||
elts = CONSTRUCTOR_ELTS (init);
|
||||
nelts = VEC_length (constructor_elt, elts);
|
||||
nelts = vec_safe_length (elts);
|
||||
for (i = 0; i < nelts; ++i)
|
||||
if (type_dependent_init_p (VEC_index (constructor_elt,
|
||||
elts, i).value))
|
||||
if (type_dependent_init_p ((*elts)[i].value))
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -6047,15 +6040,14 @@ value_dependent_init_p (tree init)
|
|||
else if (TREE_CODE (init) == CONSTRUCTOR)
|
||||
/* A brace-enclosed initializer, e.g.: int i = { 3 }; ? */
|
||||
{
|
||||
VEC(constructor_elt, gc) *elts;
|
||||
vec<constructor_elt, va_gc> *elts;
|
||||
size_t nelts;
|
||||
size_t i;
|
||||
|
||||
elts = CONSTRUCTOR_ELTS (init);
|
||||
nelts = VEC_length (constructor_elt, elts);
|
||||
nelts = vec_safe_length (elts);
|
||||
for (i = 0; i < nelts; ++i)
|
||||
if (value_dependent_init_p (VEC_index (constructor_elt,
|
||||
elts, i).value))
|
||||
if (value_dependent_init_p ((*elts)[i].value))
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -6081,7 +6073,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
|
|||
tree asmspec_tree, int flags)
|
||||
{
|
||||
tree type;
|
||||
VEC(tree,gc) *cleanups = NULL;
|
||||
vec<tree, va_gc> *cleanups = NULL;
|
||||
const char *asmspec = NULL;
|
||||
int was_readonly = 0;
|
||||
bool var_definition_p = false;
|
||||
|
@ -6489,7 +6481,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
|
|||
if (cleanups)
|
||||
{
|
||||
unsigned i; tree t;
|
||||
FOR_EACH_VEC_ELT (tree, cleanups, i, t)
|
||||
FOR_EACH_VEC_ELT (*cleanups, i, t)
|
||||
push_cleanup (decl, t, false);
|
||||
release_tree_vector (cleanups);
|
||||
}
|
||||
|
@ -6769,7 +6761,7 @@ register_dtor_fn (tree decl)
|
|||
/* Find the destructor. */
|
||||
idx = lookup_fnfields_1 (type, complete_dtor_identifier);
|
||||
gcc_assert (idx >= 0);
|
||||
cleanup = VEC_index (tree, CLASSTYPE_METHOD_VEC (type), idx);
|
||||
cleanup = (*CLASSTYPE_METHOD_VEC (type))[idx];
|
||||
/* Make sure it is accessible. */
|
||||
perform_or_defer_access_check (TYPE_BINFO (type), cleanup, cleanup,
|
||||
tf_warning_or_error);
|
||||
|
@ -7053,13 +7045,13 @@ cp_complete_array_type (tree *ptype, tree initial_value, bool do_default)
|
|||
we should just call reshape_init here? */
|
||||
if (char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (*ptype)))
|
||||
&& TREE_CODE (initial_value) == CONSTRUCTOR
|
||||
&& !VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (initial_value)))
|
||||
&& !vec_safe_is_empty (CONSTRUCTOR_ELTS (initial_value)))
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (initial_value);
|
||||
tree value = VEC_index (constructor_elt, v, 0).value;
|
||||
vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (initial_value);
|
||||
tree value = (*v)[0].value;
|
||||
|
||||
if (TREE_CODE (value) == STRING_CST
|
||||
&& VEC_length (constructor_elt, v) == 1)
|
||||
&& v->length () == 1)
|
||||
initial_value = value;
|
||||
}
|
||||
|
||||
|
@ -12108,7 +12100,7 @@ xref_basetypes (tree ref, tree base_list)
|
|||
if (TREE_TYPE (*basep))
|
||||
max_vbases++;
|
||||
if (CLASS_TYPE_P (basetype))
|
||||
max_vbases += VEC_length (tree, CLASSTYPE_VBASECLASSES (basetype));
|
||||
max_vbases += vec_safe_length (CLASSTYPE_VBASECLASSES (basetype));
|
||||
basep = &TREE_CHAIN (*basep);
|
||||
}
|
||||
}
|
||||
|
@ -12136,7 +12128,7 @@ xref_basetypes (tree ref, tree base_list)
|
|||
|
||||
if (max_bases)
|
||||
{
|
||||
BINFO_BASE_ACCESSES (binfo) = VEC_alloc (tree, gc, max_bases);
|
||||
vec_alloc (BINFO_BASE_ACCESSES (binfo), max_bases);
|
||||
/* An aggregate cannot have baseclasses. */
|
||||
CLASSTYPE_NON_AGGREGATE (ref) = 1;
|
||||
|
||||
|
@ -12158,7 +12150,7 @@ xref_basetypes (tree ref, tree base_list)
|
|||
|
||||
if (max_vbases)
|
||||
{
|
||||
CLASSTYPE_VBASECLASSES (ref) = VEC_alloc (tree, gc, max_vbases);
|
||||
vec_alloc (CLASSTYPE_VBASECLASSES (ref), max_vbases);
|
||||
|
||||
if (TYPE_FOR_JAVA (ref))
|
||||
{
|
||||
|
@ -12236,7 +12228,7 @@ xref_basetypes (tree ref, tree base_list)
|
|||
BINFO_BASE_ACCESS_APPEND (binfo, access);
|
||||
}
|
||||
|
||||
if (VEC_length (tree, CLASSTYPE_VBASECLASSES (ref)) < max_vbases)
|
||||
if (vec_safe_length (CLASSTYPE_VBASECLASSES (ref)) < max_vbases)
|
||||
/* If we didn't get max_vbases vbases, we must have shared at
|
||||
least one of them, and are therefore diamond shaped. */
|
||||
CLASSTYPE_DIAMOND_SHAPED_P (ref) = 1;
|
||||
|
@ -13919,9 +13911,9 @@ finish_function (int flags)
|
|||
unsigned int i;
|
||||
tree decl;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, deferred_mark_used_calls, i, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT (deferred_mark_used_calls, i, decl)
|
||||
mark_used (decl);
|
||||
VEC_free (tree, gc, deferred_mark_used_calls);
|
||||
vec_free (deferred_mark_used_calls);
|
||||
}
|
||||
|
||||
return fndecl;
|
||||
|
@ -14032,7 +14024,7 @@ maybe_register_incomplete_var (tree var)
|
|||
&& TYPE_BEING_DEFINED (inner_type)))
|
||||
{
|
||||
incomplete_var iv = {var, inner_type};
|
||||
VEC_safe_push (incomplete_var, gc, incomplete_vars, iv);
|
||||
vec_safe_push (incomplete_vars, iv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14047,7 +14039,7 @@ complete_vars (tree type)
|
|||
unsigned ix;
|
||||
incomplete_var *iv;
|
||||
|
||||
for (ix = 0; VEC_iterate (incomplete_var, incomplete_vars, ix, iv); )
|
||||
for (ix = 0; vec_safe_iterate (incomplete_vars, ix, &iv); )
|
||||
{
|
||||
if (same_type_p (type, iv->incomplete_type))
|
||||
{
|
||||
|
@ -14058,7 +14050,7 @@ complete_vars (tree type)
|
|||
complete_type (type);
|
||||
cp_apply_type_quals_to_decl (cp_type_quals (type), var);
|
||||
/* Remove this entry from the list. */
|
||||
VEC_unordered_remove (incomplete_var, incomplete_vars, ix);
|
||||
incomplete_vars->unordered_remove (ix);
|
||||
}
|
||||
else
|
||||
ix++;
|
||||
|
|
|
@ -90,15 +90,15 @@ static bool decl_defined_p (tree);
|
|||
/* A list of static class variables. This is needed, because a
|
||||
static class variable can be declared inside the class without
|
||||
an initializer, and then initialized, statically, outside the class. */
|
||||
static GTY(()) VEC(tree,gc) *pending_statics;
|
||||
static GTY(()) vec<tree, va_gc> *pending_statics;
|
||||
|
||||
/* A list of functions which were declared inline, but which we
|
||||
may need to emit outline anyway. */
|
||||
static GTY(()) VEC(tree,gc) *deferred_fns;
|
||||
static GTY(()) vec<tree, va_gc> *deferred_fns;
|
||||
|
||||
/* A list of decls that use types with no linkage, which we need to make
|
||||
sure are defined. */
|
||||
static GTY(()) VEC(tree,gc) *no_linkage_decls;
|
||||
static GTY(()) vec<tree, va_gc> *no_linkage_decls;
|
||||
|
||||
/* Nonzero if we're done parsing and into end-of-file activities. */
|
||||
|
||||
|
@ -644,12 +644,12 @@ check_classfn (tree ctype, tree function, tree template_parms)
|
|||
ix = class_method_index_for_fn (complete_type (ctype), function);
|
||||
if (ix >= 0)
|
||||
{
|
||||
VEC(tree,gc) *methods = CLASSTYPE_METHOD_VEC (ctype);
|
||||
vec<tree, va_gc> *methods = CLASSTYPE_METHOD_VEC (ctype);
|
||||
tree fndecls, fndecl = 0;
|
||||
bool is_conv_op;
|
||||
const char *format = NULL;
|
||||
|
||||
for (fndecls = VEC_index (tree, methods, ix);
|
||||
for (fndecls = (*methods)[ix];
|
||||
fndecls; fndecls = OVL_NEXT (fndecls))
|
||||
{
|
||||
tree p1, p2;
|
||||
|
@ -705,7 +705,7 @@ check_classfn (tree ctype, tree function, tree template_parms)
|
|||
|
||||
if (is_conv_op)
|
||||
ix = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
fndecls = VEC_index (tree, methods, ix);
|
||||
fndecls = (*methods)[ix];
|
||||
while (fndecls)
|
||||
{
|
||||
fndecl = OVL_CURRENT (fndecls);
|
||||
|
@ -713,9 +713,9 @@ check_classfn (tree ctype, tree function, tree template_parms)
|
|||
|
||||
if (!fndecls && is_conv_op)
|
||||
{
|
||||
if (VEC_length (tree, methods) > (size_t) ++ix)
|
||||
if (methods->length () > (size_t) ++ix)
|
||||
{
|
||||
fndecls = VEC_index (tree, methods, ix);
|
||||
fndecls = (*methods)[ix];
|
||||
if (!DECL_CONV_FN_P (OVL_CURRENT (fndecls)))
|
||||
{
|
||||
fndecls = NULL_TREE;
|
||||
|
@ -753,7 +753,7 @@ void
|
|||
note_vague_linkage_fn (tree decl)
|
||||
{
|
||||
DECL_DEFER_OUTPUT (decl) = 1;
|
||||
VEC_safe_push (tree, gc, deferred_fns, decl);
|
||||
vec_safe_push (deferred_fns, decl);
|
||||
}
|
||||
|
||||
/* We have just processed the DECL, which is a static data member.
|
||||
|
@ -772,7 +772,7 @@ finish_static_data_member_decl (tree decl,
|
|||
the right thing, namely, to put this decl out straight away. */
|
||||
|
||||
if (! processing_template_decl)
|
||||
VEC_safe_push (tree, gc, pending_statics, decl);
|
||||
vec_safe_push (pending_statics, decl);
|
||||
|
||||
if (LOCAL_CLASS_P (current_class_type)
|
||||
/* We already complained about the template definition. */
|
||||
|
@ -1879,7 +1879,7 @@ maybe_emit_vtables (tree ctype)
|
|||
|
||||
if (TREE_TYPE (DECL_INITIAL (vtbl)) == 0)
|
||||
{
|
||||
VEC(tree,gc)* cleanups = NULL;
|
||||
vec<tree, va_gc> *cleanups = NULL;
|
||||
tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl), &cleanups,
|
||||
LOOKUP_NORMAL);
|
||||
|
||||
|
@ -3063,7 +3063,7 @@ static GTY(()) tree ssdf_decl;
|
|||
|
||||
/* All the static storage duration functions created in this
|
||||
translation unit. */
|
||||
static GTY(()) VEC(tree,gc) *ssdf_decls;
|
||||
static GTY(()) vec<tree, va_gc> *ssdf_decls;
|
||||
|
||||
/* A map from priority levels to information about that priority
|
||||
level. There may be many such levels, so efficient lookup is
|
||||
|
@ -3108,7 +3108,7 @@ start_static_storage_duration_function (unsigned count)
|
|||
static constructors and destructors. */
|
||||
if (!ssdf_decls)
|
||||
{
|
||||
ssdf_decls = VEC_alloc (tree, gc, 32);
|
||||
vec_alloc (ssdf_decls, 32);
|
||||
|
||||
/* Take this opportunity to initialize the map from priority
|
||||
numbers to information about that priority level. */
|
||||
|
@ -3124,7 +3124,7 @@ start_static_storage_duration_function (unsigned count)
|
|||
get_priority_info (DEFAULT_INIT_PRIORITY);
|
||||
}
|
||||
|
||||
VEC_safe_push (tree, gc, ssdf_decls, ssdf_decl);
|
||||
vec_safe_push (ssdf_decls, ssdf_decl);
|
||||
|
||||
/* Create the argument list. */
|
||||
initialize_p_decl = cp_build_parm_decl
|
||||
|
@ -3568,7 +3568,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority,
|
|||
|
||||
/* Call the static storage duration function with appropriate
|
||||
arguments. */
|
||||
FOR_EACH_VEC_ELT (tree, ssdf_decls, i, fndecl)
|
||||
FOR_EACH_VEC_SAFE_ELT (ssdf_decls, i, fndecl)
|
||||
{
|
||||
/* Calls to pure or const functions will expand to nothing. */
|
||||
if (! (flags_from_decl_or_type (fndecl) & (ECF_CONST | ECF_PURE)))
|
||||
|
@ -3941,7 +3941,7 @@ cp_write_global_declarations (void)
|
|||
|
||||
/* Bad parse errors. Just forget about it. */
|
||||
if (! global_bindings_p () || current_class_type
|
||||
|| !VEC_empty (tree,decl_namespace_list))
|
||||
|| !vec_safe_is_empty (decl_namespace_list))
|
||||
return;
|
||||
|
||||
if (pch_file)
|
||||
|
@ -4031,12 +4031,12 @@ cp_write_global_declarations (void)
|
|||
cause other variables to be needed. New elements will be
|
||||
appended, and we remove from the vector those that actually
|
||||
get emitted. */
|
||||
for (i = VEC_length (tree, unemitted_tinfo_decls);
|
||||
VEC_iterate (tree, unemitted_tinfo_decls, --i, t);)
|
||||
for (i = unemitted_tinfo_decls->length ();
|
||||
unemitted_tinfo_decls->iterate (--i, &t);)
|
||||
if (emit_tinfo_decl (t))
|
||||
{
|
||||
reconsider = true;
|
||||
VEC_unordered_remove (tree, unemitted_tinfo_decls, i);
|
||||
unemitted_tinfo_decls->unordered_remove (i);
|
||||
}
|
||||
|
||||
/* The list of objects with static storage duration is built up
|
||||
|
@ -4102,7 +4102,7 @@ cp_write_global_declarations (void)
|
|||
/* Go through the set of inline functions whose bodies have not
|
||||
been emitted yet. If out-of-line copies of these functions
|
||||
are required, emit them. */
|
||||
FOR_EACH_VEC_ELT (tree, deferred_fns, i, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT (deferred_fns, i, decl)
|
||||
{
|
||||
/* Does it need synthesizing? */
|
||||
if (DECL_DEFAULTED_FN (decl) && ! DECL_INITIAL (decl)
|
||||
|
@ -4196,7 +4196,7 @@ cp_write_global_declarations (void)
|
|||
reconsider = true;
|
||||
|
||||
/* Static data members are just like namespace-scope globals. */
|
||||
FOR_EACH_VEC_ELT (tree, pending_statics, i, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT (pending_statics, i, decl)
|
||||
{
|
||||
if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl)
|
||||
/* Don't write it out if we haven't seen a definition. */
|
||||
|
@ -4208,9 +4208,9 @@ cp_write_global_declarations (void)
|
|||
if (DECL_NOT_REALLY_EXTERN (decl) && decl_needed_p (decl))
|
||||
DECL_EXTERNAL (decl) = 0;
|
||||
}
|
||||
if (VEC_length (tree, pending_statics) != 0
|
||||
&& wrapup_global_declarations (VEC_address (tree, pending_statics),
|
||||
VEC_length (tree, pending_statics)))
|
||||
if (vec_safe_length (pending_statics) != 0
|
||||
&& wrapup_global_declarations (pending_statics->address (),
|
||||
pending_statics->length ()))
|
||||
reconsider = true;
|
||||
|
||||
retries++;
|
||||
|
@ -4218,7 +4218,7 @@ cp_write_global_declarations (void)
|
|||
while (reconsider);
|
||||
|
||||
/* All used inline functions must have a definition at this point. */
|
||||
FOR_EACH_VEC_ELT (tree, deferred_fns, i, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT (deferred_fns, i, decl)
|
||||
{
|
||||
if (/* Check online inline functions that were actually used. */
|
||||
DECL_ODR_USED (decl) && DECL_DECLARED_INLINE_P (decl)
|
||||
|
@ -4240,7 +4240,7 @@ cp_write_global_declarations (void)
|
|||
}
|
||||
|
||||
/* So must decls that use a type with no linkage. */
|
||||
FOR_EACH_VEC_ELT (tree, no_linkage_decls, i, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT (no_linkage_decls, i, decl)
|
||||
if (!decl_defined_p (decl))
|
||||
no_linkage_error (decl);
|
||||
|
||||
|
@ -4292,12 +4292,12 @@ cp_write_global_declarations (void)
|
|||
/* Now, issue warnings about static, but not defined, functions,
|
||||
etc., and emit debugging information. */
|
||||
walk_namespaces (wrapup_globals_for_namespace, /*data=*/&reconsider);
|
||||
if (VEC_length (tree, pending_statics) != 0)
|
||||
if (vec_safe_length (pending_statics) != 0)
|
||||
{
|
||||
check_global_declarations (VEC_address (tree, pending_statics),
|
||||
VEC_length (tree, pending_statics));
|
||||
emit_debug_global_declarations (VEC_address (tree, pending_statics),
|
||||
VEC_length (tree, pending_statics));
|
||||
check_global_declarations (pending_statics->address (),
|
||||
pending_statics->length ());
|
||||
emit_debug_global_declarations (pending_statics->address (),
|
||||
pending_statics->length ());
|
||||
}
|
||||
|
||||
perform_deferred_noexcept_checks ();
|
||||
|
@ -4345,11 +4345,11 @@ cp_write_global_declarations (void)
|
|||
ARGS. */
|
||||
|
||||
tree
|
||||
build_offset_ref_call_from_tree (tree fn, VEC(tree,gc) **args,
|
||||
build_offset_ref_call_from_tree (tree fn, vec<tree, va_gc> **args,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
tree orig_fn;
|
||||
VEC(tree,gc) *orig_args = NULL;
|
||||
vec<tree, va_gc> *orig_args = NULL;
|
||||
tree expr;
|
||||
tree object;
|
||||
|
||||
|
@ -4375,7 +4375,7 @@ build_offset_ref_call_from_tree (tree fn, VEC(tree,gc) **args,
|
|||
{
|
||||
if (TREE_CODE (fn) == DOTSTAR_EXPR)
|
||||
object = cp_build_addr_expr (object, complain);
|
||||
VEC_safe_insert (tree, gc, *args, 0, object);
|
||||
vec_safe_insert (*args, 0, object);
|
||||
}
|
||||
/* Now that the arguments are done, transform FN. */
|
||||
fn = build_non_dependent_expr (fn);
|
||||
|
@ -4393,7 +4393,7 @@ build_offset_ref_call_from_tree (tree fn, VEC(tree,gc) **args,
|
|||
fn = TREE_OPERAND (fn, 1);
|
||||
fn = get_member_function_from_ptrfunc (&object_addr, fn,
|
||||
complain);
|
||||
VEC_safe_insert (tree, gc, *args, 0, object_addr);
|
||||
vec_safe_insert (*args, 0, object_addr);
|
||||
}
|
||||
|
||||
if (CLASS_TYPE_P (TREE_TYPE (fn)))
|
||||
|
@ -4519,7 +4519,7 @@ mark_used (tree decl)
|
|||
finishes, otherwise it might recurse. */
|
||||
if (defer_mark_used_calls)
|
||||
{
|
||||
VEC_safe_push (tree, gc, deferred_mark_used_calls, decl);
|
||||
vec_safe_push (deferred_mark_used_calls, decl);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -4589,7 +4589,7 @@ mark_used (tree decl)
|
|||
the vector interferes with GC, so give an error now. */
|
||||
no_linkage_error (decl);
|
||||
else
|
||||
VEC_safe_push (tree, gc, no_linkage_decls, decl);
|
||||
vec_safe_push (no_linkage_decls, decl);
|
||||
}
|
||||
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl)
|
||||
|
|
|
@ -84,7 +84,7 @@ static void dump_exception_spec (tree, int);
|
|||
static void dump_template_argument (tree, int);
|
||||
static void dump_template_argument_list (tree, int);
|
||||
static void dump_template_parameter (tree, int);
|
||||
static void dump_template_bindings (tree, tree, VEC(tree,gc) *);
|
||||
static void dump_template_bindings (tree, tree, vec<tree, va_gc> *);
|
||||
static void dump_scope (tree, int);
|
||||
static void dump_template_parms (tree, int, int);
|
||||
static int get_non_default_template_args_count (tree, int);
|
||||
|
@ -259,7 +259,7 @@ dump_template_parameter (tree parm, int flags)
|
|||
TREE_VEC. */
|
||||
|
||||
static void
|
||||
dump_template_bindings (tree parms, tree args, VEC(tree,gc)* typenames)
|
||||
dump_template_bindings (tree parms, tree args, vec<tree, va_gc> *typenames)
|
||||
{
|
||||
bool need_semicolon = false;
|
||||
int i;
|
||||
|
@ -310,10 +310,10 @@ dump_template_bindings (tree parms, tree args, VEC(tree,gc)* typenames)
|
|||
}
|
||||
|
||||
/* Don't bother with typenames for a partial instantiation. */
|
||||
if (VEC_empty (tree, typenames) || uses_template_parms (args))
|
||||
if (vec_safe_is_empty (typenames) || uses_template_parms (args))
|
||||
return;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, typenames, i, t)
|
||||
FOR_EACH_VEC_SAFE_ELT (typenames, i, t)
|
||||
{
|
||||
if (need_semicolon)
|
||||
pp_separate_with_semicolon (cxx_pp);
|
||||
|
@ -1275,13 +1275,13 @@ dump_template_decl (tree t, int flags)
|
|||
}
|
||||
|
||||
/* find_typenames looks through the type of the function template T
|
||||
and returns a VEC containing any typedefs, decltypes or TYPENAME_TYPEs
|
||||
and returns a vec containing any typedefs, decltypes or TYPENAME_TYPEs
|
||||
it finds. */
|
||||
|
||||
struct find_typenames_t
|
||||
{
|
||||
struct pointer_set_t *p_set;
|
||||
VEC (tree,gc) *typenames;
|
||||
vec<tree, va_gc> *typenames;
|
||||
};
|
||||
|
||||
static tree
|
||||
|
@ -1299,7 +1299,7 @@ find_typenames_r (tree *tp, int * /*walk_subtrees*/, void *data)
|
|||
mv = TYPE_MAIN_VARIANT (*tp);
|
||||
|
||||
if (mv && (mv == *tp || !pointer_set_insert (d->p_set, mv)))
|
||||
VEC_safe_push (tree, gc, d->typenames, mv);
|
||||
vec_safe_push (d->typenames, mv);
|
||||
|
||||
/* Search into class template arguments, which cp_walk_subtrees
|
||||
doesn't do. */
|
||||
|
@ -1310,7 +1310,7 @@ find_typenames_r (tree *tp, int * /*walk_subtrees*/, void *data)
|
|||
return NULL_TREE;
|
||||
}
|
||||
|
||||
static VEC(tree,gc) *
|
||||
static vec<tree, va_gc> *
|
||||
find_typenames (tree t)
|
||||
{
|
||||
struct find_typenames_t ft;
|
||||
|
@ -1338,7 +1338,7 @@ dump_function_decl (tree t, int flags)
|
|||
int show_return = flags & TFF_RETURN_TYPE || flags & TFF_DECL_SPECIFIERS;
|
||||
int do_outer_scope = ! (flags & TFF_UNQUALIFIED_NAME);
|
||||
tree exceptions;
|
||||
VEC(tree,gc) *typenames = NULL;
|
||||
vec<tree, va_gc> *typenames = NULL;
|
||||
|
||||
if (DECL_NAME (t) && LAMBDA_FUNCTION_P (t))
|
||||
{
|
||||
|
@ -1737,7 +1737,7 @@ dump_expr_list (tree l, int flags)
|
|||
/* Print out a vector of initializers (subr of dump_expr). */
|
||||
|
||||
static void
|
||||
dump_expr_init_vec (VEC(constructor_elt,gc) *v, int flags)
|
||||
dump_expr_init_vec (vec<constructor_elt, va_gc> *v, int flags)
|
||||
{
|
||||
unsigned HOST_WIDE_INT idx;
|
||||
tree value;
|
||||
|
@ -1745,7 +1745,7 @@ dump_expr_init_vec (VEC(constructor_elt,gc) *v, int flags)
|
|||
FOR_EACH_CONSTRUCTOR_VALUE (v, idx, value)
|
||||
{
|
||||
dump_expr (value, flags | TFF_EXPR_IN_PARENS);
|
||||
if (idx != VEC_length (constructor_elt, v) - 1)
|
||||
if (idx != v->length () - 1)
|
||||
pp_separate_with_comma (cxx_pp);
|
||||
}
|
||||
}
|
||||
|
@ -3208,11 +3208,11 @@ print_instantiation_context (void)
|
|||
void
|
||||
maybe_print_constexpr_context (diagnostic_context *context)
|
||||
{
|
||||
VEC(tree,heap) *call_stack = cx_error_context ();
|
||||
vec<tree> call_stack = cx_error_context ();
|
||||
unsigned ix;
|
||||
tree t;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, call_stack, ix, t)
|
||||
FOR_EACH_VEC_ELT (call_stack, ix, t)
|
||||
{
|
||||
expanded_location xloc = expand_location (EXPR_LOCATION (t));
|
||||
const char *s = expr_as_string (t, 0);
|
||||
|
|
|
@ -824,7 +824,7 @@ build_throw (tree exp)
|
|||
if (CLASS_TYPE_P (temp_type))
|
||||
{
|
||||
int flags = LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING;
|
||||
VEC(tree,gc) *exp_vec;
|
||||
vec<tree, va_gc> *exp_vec;
|
||||
|
||||
/* Under C++0x [12.8/16 class.copy], a thrown lvalue is sometimes
|
||||
treated as an rvalue for the purposes of overload resolution
|
||||
|
@ -1176,9 +1176,7 @@ typedef struct GTY(()) pending_noexcept {
|
|||
tree fn;
|
||||
location_t loc;
|
||||
} pending_noexcept;
|
||||
DEF_VEC_O(pending_noexcept);
|
||||
DEF_VEC_ALLOC_O(pending_noexcept,gc);
|
||||
static GTY(()) VEC(pending_noexcept,gc) *pending_noexcept_checks;
|
||||
static GTY(()) vec<pending_noexcept, va_gc> *pending_noexcept_checks;
|
||||
|
||||
/* FN is a FUNCTION_DECL that caused a noexcept-expr to be false. Warn if
|
||||
it can't throw. */
|
||||
|
@ -1204,7 +1202,7 @@ perform_deferred_noexcept_checks (void)
|
|||
int i;
|
||||
pending_noexcept *p;
|
||||
location_t saved_loc = input_location;
|
||||
FOR_EACH_VEC_ELT (pending_noexcept, pending_noexcept_checks, i, p)
|
||||
FOR_EACH_VEC_SAFE_ELT (pending_noexcept_checks, i, p)
|
||||
{
|
||||
input_location = p->loc;
|
||||
maybe_noexcept_warning (p->fn);
|
||||
|
@ -1248,7 +1246,7 @@ expr_noexcept_p (tree expr, tsubst_flags_t complain)
|
|||
{
|
||||
/* Not defined yet; check again at EOF. */
|
||||
pending_noexcept p = {fn, input_location};
|
||||
VEC_safe_push (pending_noexcept, gc, pending_noexcept_checks, p);
|
||||
vec_safe_push (pending_noexcept_checks, p);
|
||||
}
|
||||
else
|
||||
maybe_noexcept_warning (fn);
|
||||
|
|
|
@ -184,7 +184,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
|
|||
else if (CLASS_TYPE_P (type))
|
||||
{
|
||||
tree field;
|
||||
VEC(constructor_elt,gc) *v = NULL;
|
||||
vec<constructor_elt, va_gc> *v = NULL;
|
||||
|
||||
/* Iterate over the fields, building initializations. */
|
||||
for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
|
||||
|
@ -233,7 +233,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
|
|||
else if (TREE_CODE (type) == ARRAY_TYPE)
|
||||
{
|
||||
tree max_index;
|
||||
VEC(constructor_elt,gc) *v = NULL;
|
||||
vec<constructor_elt, va_gc> *v = NULL;
|
||||
|
||||
/* Iterate over the array elements, building initializations. */
|
||||
if (nelts)
|
||||
|
@ -255,7 +255,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
|
|||
{
|
||||
constructor_elt ce;
|
||||
|
||||
v = VEC_alloc (constructor_elt, gc, 1);
|
||||
vec_alloc (v, 1);
|
||||
|
||||
/* If this is a one element array, we just use a regular init. */
|
||||
if (tree_int_cst_equal (size_zero_node, max_index))
|
||||
|
@ -267,7 +267,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
|
|||
ce.value = build_zero_init_1 (TREE_TYPE (type),
|
||||
/*nelts=*/NULL_TREE,
|
||||
static_storage_p, NULL_TREE);
|
||||
VEC_quick_push (constructor_elt, v, ce);
|
||||
v->quick_push (ce);
|
||||
}
|
||||
|
||||
/* Build a constructor to contain the initializations. */
|
||||
|
@ -391,7 +391,7 @@ build_value_init_noctor (tree type, tsubst_flags_t complain)
|
|||
if (TREE_CODE (type) != UNION_TYPE)
|
||||
{
|
||||
tree field;
|
||||
VEC(constructor_elt,gc) *v = NULL;
|
||||
vec<constructor_elt, va_gc> *v = NULL;
|
||||
|
||||
/* Iterate over the fields, building initializations. */
|
||||
for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
|
||||
|
@ -428,7 +428,7 @@ build_value_init_noctor (tree type, tsubst_flags_t complain)
|
|||
}
|
||||
else if (TREE_CODE (type) == ARRAY_TYPE)
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = NULL;
|
||||
vec<constructor_elt, va_gc> *v = NULL;
|
||||
|
||||
/* Iterate over the array elements, building initializations. */
|
||||
tree max_index = array_type_nelts (type);
|
||||
|
@ -450,7 +450,7 @@ build_value_init_noctor (tree type, tsubst_flags_t complain)
|
|||
{
|
||||
constructor_elt ce;
|
||||
|
||||
v = VEC_alloc (constructor_elt, gc, 1);
|
||||
vec_alloc (v, 1);
|
||||
|
||||
/* If this is a one element array, we just use a regular init. */
|
||||
if (tree_int_cst_equal (size_zero_node, max_index))
|
||||
|
@ -459,7 +459,7 @@ build_value_init_noctor (tree type, tsubst_flags_t complain)
|
|||
ce.index = build2 (RANGE_EXPR, sizetype, size_zero_node, max_index);
|
||||
|
||||
ce.value = build_value_init (TREE_TYPE (type), complain);
|
||||
VEC_quick_push (constructor_elt, v, ce);
|
||||
v->quick_push (ce);
|
||||
|
||||
if (ce.value == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
@ -628,7 +628,7 @@ perform_member_init (tree member, tree init)
|
|||
reference member in a constructor’s ctor-initializer (12.6.2)
|
||||
persists until the constructor exits." */
|
||||
unsigned i; tree t;
|
||||
VEC(tree,gc) *cleanups = make_tree_vector ();
|
||||
vec<tree, va_gc> *cleanups = make_tree_vector ();
|
||||
if (TREE_CODE (init) == TREE_LIST)
|
||||
init = build_x_compound_expr_from_list (init, ELK_MEM_INIT,
|
||||
tf_warning_or_error);
|
||||
|
@ -645,7 +645,7 @@ perform_member_init (tree member, tree init)
|
|||
init = build_vec_init_expr (type, init, tf_warning_or_error);
|
||||
init = build2 (INIT_EXPR, type, decl, init);
|
||||
finish_expr_stmt (init);
|
||||
FOR_EACH_VEC_ELT (tree, cleanups, i, t)
|
||||
FOR_EACH_VEC_ELT (*cleanups, i, t)
|
||||
push_cleanup (decl, t, false);
|
||||
release_tree_vector (cleanups);
|
||||
}
|
||||
|
@ -802,7 +802,7 @@ sort_mem_initializers (tree t, tree mem_inits)
|
|||
tree base, binfo, base_binfo;
|
||||
tree sorted_inits;
|
||||
tree next_subobject;
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
int i;
|
||||
int uses_unions_p = 0;
|
||||
|
||||
|
@ -814,7 +814,7 @@ sort_mem_initializers (tree t, tree mem_inits)
|
|||
|
||||
/* Process the virtual bases. */
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (t), i = 0;
|
||||
VEC_iterate (tree, vbases, i, base); i++)
|
||||
vec_safe_iterate (vbases, i, &base); i++)
|
||||
sorted_inits = tree_cons (base, NULL_TREE, sorted_inits);
|
||||
|
||||
/* Process the direct bases. */
|
||||
|
@ -1545,7 +1545,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags,
|
|||
followed by initialization by X. If neither of these work
|
||||
out, then look hard. */
|
||||
tree rval;
|
||||
VEC(tree,gc) *parms;
|
||||
vec<tree, va_gc> *parms;
|
||||
|
||||
/* If we have direct-initialization from an initializer list, pull
|
||||
it out of the TREE_LIST so the code below can see it. */
|
||||
|
@ -1627,7 +1627,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags,
|
|||
{
|
||||
parms = make_tree_vector ();
|
||||
for (; init != NULL_TREE; init = TREE_CHAIN (init))
|
||||
VEC_safe_push (tree, gc, parms, TREE_VALUE (init));
|
||||
vec_safe_push (parms, TREE_VALUE (init));
|
||||
}
|
||||
else
|
||||
parms = make_tree_vector_single (init);
|
||||
|
@ -1641,11 +1641,11 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags,
|
|||
tree elt; unsigned i;
|
||||
|
||||
/* Unshare the arguments for the second call. */
|
||||
VEC(tree,gc) *parms2 = make_tree_vector ();
|
||||
FOR_EACH_VEC_ELT (tree, parms, i, elt)
|
||||
vec<tree, va_gc> *parms2 = make_tree_vector ();
|
||||
FOR_EACH_VEC_SAFE_ELT (parms, i, elt)
|
||||
{
|
||||
elt = break_out_target_exprs (elt);
|
||||
VEC_safe_push (tree, gc, parms2, elt);
|
||||
vec_safe_push (parms2, elt);
|
||||
}
|
||||
complete = build_special_member_call (exp, complete_ctor_identifier,
|
||||
&parms2, binfo, flags,
|
||||
|
@ -1730,7 +1730,7 @@ expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags,
|
|||
if (init && TREE_CODE (exp) == VAR_DECL
|
||||
&& COMPOUND_LITERAL_P (init))
|
||||
{
|
||||
VEC(tree,gc)* cleanups = NULL;
|
||||
vec<tree, va_gc> *cleanups = NULL;
|
||||
/* If store_init_value returns NULL_TREE, the INIT has been
|
||||
recorded as the DECL_INITIAL for EXP. That means there's
|
||||
nothing more we have to do. */
|
||||
|
@ -2062,8 +2062,8 @@ build_builtin_delete_call (tree addr)
|
|||
creates and returns a NEW_EXPR. */
|
||||
|
||||
static tree
|
||||
build_raw_new_expr (VEC(tree,gc) *placement, tree type, tree nelts,
|
||||
VEC(tree,gc) *init, int use_global_new)
|
||||
build_raw_new_expr (vec<tree, va_gc> *placement, tree type, tree nelts,
|
||||
vec<tree, va_gc> *init, int use_global_new)
|
||||
{
|
||||
tree init_list;
|
||||
tree new_expr;
|
||||
|
@ -2074,7 +2074,7 @@ build_raw_new_expr (VEC(tree,gc) *placement, tree type, tree nelts,
|
|||
int" from an empty initializer "new int()". */
|
||||
if (init == NULL)
|
||||
init_list = NULL_TREE;
|
||||
else if (VEC_empty (tree, init))
|
||||
else if (init->is_empty ())
|
||||
init_list = void_zero_node;
|
||||
else
|
||||
init_list = build_tree_list_vec (init);
|
||||
|
@ -2165,8 +2165,8 @@ diagnose_uninitialized_cst_or_ref_member (tree type, bool using_new, bool compla
|
|||
build_raw_new_expr. This may change PLACEMENT and INIT. */
|
||||
|
||||
static tree
|
||||
build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
|
||||
VEC(tree,gc) **init, bool globally_qualified_p,
|
||||
build_new_1 (vec<tree, va_gc> **placement, tree type, tree nelts,
|
||||
vec<tree, va_gc> **init, bool globally_qualified_p,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
tree size, rval;
|
||||
|
@ -2397,13 +2397,12 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
|
|||
reference, prepare to capture it in a temporary variable. Do
|
||||
this now, since PLACEMENT will change in the calls below. */
|
||||
placement_first = NULL_TREE;
|
||||
if (VEC_length (tree, *placement) == 1
|
||||
&& (TREE_CODE (TREE_TYPE (VEC_index (tree, *placement, 0)))
|
||||
== POINTER_TYPE))
|
||||
placement_first = VEC_index (tree, *placement, 0);
|
||||
if (vec_safe_length (*placement) == 1
|
||||
&& (TREE_CODE (TREE_TYPE ((**placement)[0])) == POINTER_TYPE))
|
||||
placement_first = (**placement)[0];
|
||||
|
||||
/* Allocate the object. */
|
||||
if (VEC_empty (tree, *placement) && TYPE_FOR_JAVA (elt_type))
|
||||
if (vec_safe_is_empty (*placement) && TYPE_FOR_JAVA (elt_type))
|
||||
{
|
||||
tree class_addr;
|
||||
tree class_decl = build_java_class_ref (elt_type);
|
||||
|
@ -2466,7 +2465,7 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
|
|||
size = fold_build3 (COND_EXPR, sizetype, outer_nelts_check,
|
||||
size, TYPE_MAX_VALUE (sizetype));
|
||||
/* Create the argument list. */
|
||||
VEC_safe_insert (tree, gc, *placement, 0, size);
|
||||
vec_safe_insert (*placement, 0, size);
|
||||
/* Do name-lookup to find the appropriate operator. */
|
||||
fns = lookup_fnfields (elt_type, fnname, /*protect=*/2);
|
||||
if (fns == NULL_TREE)
|
||||
|
@ -2651,7 +2650,7 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
|
|||
bool stable;
|
||||
bool explicit_value_init_p = false;
|
||||
|
||||
if (*init != NULL && VEC_empty (tree, *init))
|
||||
if (*init != NULL && (*init)->is_empty ())
|
||||
{
|
||||
*init = NULL;
|
||||
explicit_value_init_p = true;
|
||||
|
@ -2675,11 +2674,11 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
|
|||
else if (array_p)
|
||||
{
|
||||
tree vecinit = NULL_TREE;
|
||||
if (*init && VEC_length (tree, *init) == 1
|
||||
&& BRACE_ENCLOSED_INITIALIZER_P (VEC_index (tree, *init, 0))
|
||||
&& CONSTRUCTOR_IS_DIRECT_INIT (VEC_index (tree, *init, 0)))
|
||||
if (vec_safe_length (*init) == 1
|
||||
&& BRACE_ENCLOSED_INITIALIZER_P ((**init)[0])
|
||||
&& CONSTRUCTOR_IS_DIRECT_INIT ((**init)[0]))
|
||||
{
|
||||
vecinit = VEC_index (tree, *init, 0);
|
||||
vecinit = (**init)[0];
|
||||
if (CONSTRUCTOR_NELTS (vecinit) == 0)
|
||||
/* List-value-initialization, leave it alone. */;
|
||||
else
|
||||
|
@ -2891,25 +2890,25 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
|
|||
rather than just "new". This may change PLACEMENT and INIT. */
|
||||
|
||||
tree
|
||||
build_new (VEC(tree,gc) **placement, tree type, tree nelts,
|
||||
VEC(tree,gc) **init, int use_global_new, tsubst_flags_t complain)
|
||||
build_new (vec<tree, va_gc> **placement, tree type, tree nelts,
|
||||
vec<tree, va_gc> **init, int use_global_new, tsubst_flags_t complain)
|
||||
{
|
||||
tree rval;
|
||||
VEC(tree,gc) *orig_placement = NULL;
|
||||
vec<tree, va_gc> *orig_placement = NULL;
|
||||
tree orig_nelts = NULL_TREE;
|
||||
VEC(tree,gc) *orig_init = NULL;
|
||||
vec<tree, va_gc> *orig_init = NULL;
|
||||
|
||||
if (type == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
if (nelts == NULL_TREE && VEC_length (tree, *init) == 1
|
||||
if (nelts == NULL_TREE && vec_safe_length (*init) == 1
|
||||
/* Don't do auto deduction where it might affect mangling. */
|
||||
&& (!processing_template_decl || at_function_scope_p ()))
|
||||
{
|
||||
tree auto_node = type_uses_auto (type);
|
||||
if (auto_node)
|
||||
{
|
||||
tree d_init = VEC_index (tree, *init, 0);
|
||||
tree d_init = (**init)[0];
|
||||
d_init = resolve_nondeduced_context (d_init);
|
||||
type = do_auto_deduction (type, d_init, auto_node);
|
||||
}
|
||||
|
@ -3308,7 +3307,7 @@ build_vec_init (tree base, tree maxindex, tree init,
|
|||
&& ((TREE_CODE (init) == CONSTRUCTOR
|
||||
/* Don't do this if the CONSTRUCTOR might contain something
|
||||
that might throw and require us to clean up. */
|
||||
&& (VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (init))
|
||||
&& (vec_safe_is_empty (CONSTRUCTOR_ELTS (init))
|
||||
|| ! TYPE_HAS_NONTRIVIAL_DESTRUCTOR (inner_elt_type)))
|
||||
|| from_array))
|
||||
{
|
||||
|
@ -3428,11 +3427,11 @@ build_vec_init (tree base, tree maxindex, tree init,
|
|||
initialization of any elements with constant initializers even if
|
||||
some are non-constant. */
|
||||
bool do_static_init = (DECL_P (obase) && TREE_STATIC (obase));
|
||||
VEC(constructor_elt,gc) *new_vec;
|
||||
vec<constructor_elt, va_gc> *new_vec;
|
||||
from_array = 0;
|
||||
|
||||
if (try_const)
|
||||
new_vec = VEC_alloc (constructor_elt, gc, CONSTRUCTOR_NELTS (init));
|
||||
vec_alloc (new_vec, CONSTRUCTOR_NELTS (init));
|
||||
else
|
||||
new_vec = NULL;
|
||||
|
||||
|
@ -3506,7 +3505,7 @@ build_vec_init (tree base, tree maxindex, tree init,
|
|||
else if (do_static_init && saw_const)
|
||||
DECL_INITIAL (obase) = build_constructor (atype, new_vec);
|
||||
else
|
||||
VEC_free (constructor_elt, gc, new_vec);
|
||||
vec_free (new_vec);
|
||||
}
|
||||
|
||||
/* Clear out INIT so that we don't get confused below. */
|
||||
|
@ -3937,7 +3936,7 @@ push_base_cleanups (void)
|
|||
int i;
|
||||
tree member;
|
||||
tree expr;
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
|
||||
/* Run destructors for all virtual baseclasses. */
|
||||
if (CLASSTYPE_VBASECLASSES (current_class_type))
|
||||
|
@ -3950,7 +3949,7 @@ push_base_cleanups (void)
|
|||
/* The CLASSTYPE_VBASECLASSES vector is in initialization
|
||||
order, which is also the right order for pushing cleanups. */
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (current_class_type), i = 0;
|
||||
VEC_iterate (tree, vbases, i, base_binfo); i++)
|
||||
vec_safe_iterate (vbases, i, &base_binfo); i++)
|
||||
{
|
||||
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (BINFO_TYPE (base_binfo)))
|
||||
{
|
||||
|
|
|
@ -91,7 +91,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
typedef struct GTY(()) globals {
|
||||
/* An array of the current substitution candidates, in the order
|
||||
we've seen them. */
|
||||
VEC(tree,gc) *substitutions;
|
||||
vec<tree, va_gc> *substitutions;
|
||||
|
||||
/* The entity that is being mangled. */
|
||||
tree GTY ((skip)) entity;
|
||||
|
@ -311,7 +311,7 @@ dump_substitution_candidates (void)
|
|||
tree el;
|
||||
|
||||
fprintf (stderr, " ++ substitutions ");
|
||||
FOR_EACH_VEC_ELT (tree, G.substitutions, i, el)
|
||||
FOR_EACH_VEC_ELT (*G.substitutions, i, el)
|
||||
{
|
||||
const char *name = "???";
|
||||
|
||||
|
@ -391,7 +391,7 @@ add_substitution (tree node)
|
|||
int i;
|
||||
tree candidate;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, G.substitutions, i, candidate)
|
||||
FOR_EACH_VEC_SAFE_ELT (G.substitutions, i, candidate)
|
||||
{
|
||||
gcc_assert (!(DECL_P (node) && node == candidate));
|
||||
gcc_assert (!(TYPE_P (node) && TYPE_P (candidate)
|
||||
|
@ -401,7 +401,7 @@ add_substitution (tree node)
|
|||
#endif /* ENABLE_CHECKING */
|
||||
|
||||
/* Put the decl onto the varray of substitution candidates. */
|
||||
VEC_safe_push (tree, gc, G.substitutions, node);
|
||||
vec_safe_push (G.substitutions, node);
|
||||
|
||||
if (DEBUG_MANGLE)
|
||||
dump_substitution_candidates ();
|
||||
|
@ -504,7 +504,7 @@ static int
|
|||
find_substitution (tree node)
|
||||
{
|
||||
int i;
|
||||
const int size = VEC_length (tree, G.substitutions);
|
||||
const int size = vec_safe_length (G.substitutions);
|
||||
tree decl;
|
||||
tree type;
|
||||
|
||||
|
@ -612,7 +612,7 @@ find_substitution (tree node)
|
|||
operation. */
|
||||
for (i = 0; i < size; ++i)
|
||||
{
|
||||
tree candidate = VEC_index (tree, G.substitutions, i);
|
||||
tree candidate = (*G.substitutions)[i];
|
||||
/* NODE is a matched to a candidate if it's the same decl node or
|
||||
if it's the same type. */
|
||||
if (decl == candidate
|
||||
|
@ -1322,18 +1322,18 @@ write_abi_tags (tree tags)
|
|||
|
||||
tags = TREE_VALUE (tags);
|
||||
|
||||
VEC(tree,gc)* vec = make_tree_vector();
|
||||
vec<tree, va_gc> * vec = make_tree_vector();
|
||||
|
||||
for (tree t = tags; t; t = TREE_CHAIN (t))
|
||||
{
|
||||
tree str = TREE_VALUE (t);
|
||||
VEC_safe_push (tree, gc, vec, str);
|
||||
vec_safe_push (vec, str);
|
||||
}
|
||||
|
||||
VEC_qsort (tree, vec, tree_string_cmp);
|
||||
vec->qsort (tree_string_cmp);
|
||||
|
||||
unsigned i; tree str;
|
||||
FOR_EACH_VEC_ELT (tree, vec, i, str)
|
||||
FOR_EACH_VEC_ELT (*vec, i, str)
|
||||
{
|
||||
write_string ("B");
|
||||
write_unsigned_number (TREE_STRING_LENGTH (str) - 1);
|
||||
|
@ -1699,7 +1699,7 @@ local_class_index (tree entity)
|
|||
tree ctx = TYPE_CONTEXT (entity);
|
||||
for (ix = 0; ; ix++)
|
||||
{
|
||||
tree type = VEC_index (tree, local_classes, ix);
|
||||
tree type = (*local_classes)[ix];
|
||||
if (type == entity)
|
||||
return discriminator;
|
||||
if (TYPE_CONTEXT (type) == ctx
|
||||
|
@ -2801,7 +2801,7 @@ write_expression (tree expr)
|
|||
}
|
||||
else if (code == CONSTRUCTOR)
|
||||
{
|
||||
VEC(constructor_elt,gc)* elts = CONSTRUCTOR_ELTS (expr);
|
||||
vec<constructor_elt, va_gc> *elts = CONSTRUCTOR_ELTS (expr);
|
||||
unsigned i; tree val;
|
||||
|
||||
if (BRACE_ENCLOSED_INITIALIZER_P (expr))
|
||||
|
@ -3320,7 +3320,7 @@ finish_mangling_internal (const bool warn)
|
|||
G.entity);
|
||||
|
||||
/* Clear all the substitutions. */
|
||||
VEC_truncate (tree, G.substitutions, 0);
|
||||
vec_safe_truncate (G.substitutions, 0);
|
||||
|
||||
/* Null-terminate the string. */
|
||||
write_char ('\0');
|
||||
|
@ -3354,7 +3354,7 @@ init_mangle (void)
|
|||
{
|
||||
gcc_obstack_init (&name_obstack);
|
||||
name_base = obstack_alloc (&name_obstack, 0);
|
||||
G.substitutions = NULL;
|
||||
vec_alloc (G.substitutions, 0);
|
||||
|
||||
/* Cache these identifiers for quick comparison when checking for
|
||||
standard substitutions. */
|
||||
|
|
|
@ -550,7 +550,7 @@ do_build_copy_constructor (tree fndecl)
|
|||
int i;
|
||||
tree binfo, base_binfo;
|
||||
tree init;
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
|
||||
/* Initialize all the base-classes with the parameter converted
|
||||
to their type so that we get their copy constructor and not
|
||||
|
@ -558,7 +558,7 @@ do_build_copy_constructor (tree fndecl)
|
|||
deal with the binfo's directly as a direct base might be
|
||||
inaccessible due to ambiguity. */
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (current_class_type), i = 0;
|
||||
VEC_iterate (tree, vbases, i, binfo); i++)
|
||||
vec_safe_iterate (vbases, i, &binfo); i++)
|
||||
{
|
||||
member_init_list = add_one_base_init (binfo, parm, move_p, inh,
|
||||
member_init_list);
|
||||
|
@ -655,7 +655,7 @@ do_build_copy_assign (tree fndecl)
|
|||
BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
|
||||
{
|
||||
tree converted_parm;
|
||||
VEC(tree,gc) *parmvec;
|
||||
vec<tree, va_gc> *parmvec;
|
||||
|
||||
/* We must convert PARM directly to the base class
|
||||
explicitly since the base class may be ambiguous. */
|
||||
|
@ -852,7 +852,7 @@ locate_fn_flags (tree type, tree name, tree argtype, int flags,
|
|||
tsubst_flags_t complain)
|
||||
{
|
||||
tree ob, fn, fns, binfo, rval;
|
||||
VEC(tree,gc) *args;
|
||||
vec<tree, va_gc> *args;
|
||||
|
||||
if (TYPE_P (type))
|
||||
binfo = TYPE_BINFO (type);
|
||||
|
@ -875,13 +875,13 @@ locate_fn_flags (tree type, tree name, tree argtype, int flags,
|
|||
if (TREE_CODE (type) != REFERENCE_TYPE)
|
||||
type = cp_build_reference_type (type, /*rval*/true);
|
||||
tree arg = build_stub_object (type);
|
||||
VEC_safe_push (tree, gc, args, arg);
|
||||
vec_safe_push (args, arg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tree arg = build_stub_object (argtype);
|
||||
VEC_quick_push (tree, args, arg);
|
||||
args->quick_push (arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1157,7 +1157,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
|
|||
{
|
||||
tree binfo, base_binfo, scope, fnname, rval, argtype;
|
||||
bool move_p, copy_arg_p, assign_p, expected_trivial, check_vdtor;
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
int i, quals, flags;
|
||||
tsubst_flags_t complain;
|
||||
bool ctor_p;
|
||||
|
@ -1351,7 +1351,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
|
|||
{
|
||||
if (constexpr_p)
|
||||
*constexpr_p = false;
|
||||
FOR_EACH_VEC_ELT (tree, vbases, i, base_binfo)
|
||||
FOR_EACH_VEC_ELT (*vbases, i, base_binfo)
|
||||
{
|
||||
tree basetype = BINFO_TYPE (base_binfo);
|
||||
if (copy_arg_p)
|
||||
|
|
|
@ -320,7 +320,7 @@ new_class_binding (tree name, tree value, tree type, cp_binding_level *scope)
|
|||
{
|
||||
cp_class_binding cb = {cxx_binding_make (value, type), name};
|
||||
cxx_binding *binding = cb.base;
|
||||
VEC_safe_push (cp_class_binding, gc, scope->class_shadowed, cb);
|
||||
vec_safe_push (scope->class_shadowed, cb);
|
||||
binding->scope = scope;
|
||||
return binding;
|
||||
}
|
||||
|
@ -597,7 +597,7 @@ add_decl_to_level (tree decl, cp_binding_level *b)
|
|||
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
|
||||
|| (TREE_CODE (decl) == FUNCTION_DECL
|
||||
&& (!TREE_PUBLIC (decl) || DECL_DECLARED_INLINE_P (decl))))
|
||||
VEC_safe_push (tree, gc, b->static_decls, decl);
|
||||
vec_safe_push (b->static_decls, decl);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1506,11 +1506,9 @@ begin_scope (scope_kind kind, tree entity)
|
|||
|
||||
case sk_namespace:
|
||||
NAMESPACE_LEVEL (entity) = scope;
|
||||
scope->static_decls =
|
||||
VEC_alloc (tree, gc,
|
||||
DECL_NAME (entity) == std_identifier
|
||||
|| DECL_NAME (entity) == global_scope_name
|
||||
? 200 : 10);
|
||||
vec_alloc (scope->static_decls,
|
||||
(DECL_NAME (entity) == std_identifier
|
||||
|| DECL_NAME (entity) == global_scope_name) ? 200 : 10);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1781,12 +1779,12 @@ print_binding_level (cp_binding_level* lvl)
|
|||
if (i)
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
if (VEC_length (cp_class_binding, lvl->class_shadowed))
|
||||
if (vec_safe_length (lvl->class_shadowed))
|
||||
{
|
||||
size_t i;
|
||||
cp_class_binding *b;
|
||||
fprintf (stderr, " class-shadowed:");
|
||||
FOR_EACH_VEC_ELT (cp_class_binding, lvl->class_shadowed, i, b)
|
||||
FOR_EACH_VEC_ELT (*lvl->class_shadowed, i, b)
|
||||
fprintf (stderr, " %s ", IDENTIFIER_POINTER (b->identifier));
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
@ -2836,7 +2834,7 @@ poplevel_class (void)
|
|||
/* Remove the bindings for all of the class-level declarations. */
|
||||
if (level->class_shadowed)
|
||||
{
|
||||
FOR_EACH_VEC_ELT (cp_class_binding, level->class_shadowed, i, cb)
|
||||
FOR_EACH_VEC_ELT (*level->class_shadowed, i, cb)
|
||||
{
|
||||
IDENTIFIER_BINDING (cb->identifier) = cb->base->previous;
|
||||
cxx_binding_free (cb->base);
|
||||
|
@ -3468,8 +3466,8 @@ current_decl_namespace (void)
|
|||
{
|
||||
tree result;
|
||||
/* If we have been pushed into a different namespace, use it. */
|
||||
if (!VEC_empty (tree, decl_namespace_list))
|
||||
return VEC_last (tree, decl_namespace_list);
|
||||
if (!vec_safe_is_empty (decl_namespace_list))
|
||||
return decl_namespace_list->last ();
|
||||
|
||||
if (current_class_type)
|
||||
result = decl_namespace_context (current_class_type);
|
||||
|
@ -3674,7 +3672,7 @@ push_decl_namespace (tree decl)
|
|||
{
|
||||
if (TREE_CODE (decl) != NAMESPACE_DECL)
|
||||
decl = decl_namespace_context (decl);
|
||||
VEC_safe_push (tree, gc, decl_namespace_list, ORIGINAL_NAMESPACE (decl));
|
||||
vec_safe_push (decl_namespace_list, ORIGINAL_NAMESPACE (decl));
|
||||
}
|
||||
|
||||
/* [namespace.memdef]/2 */
|
||||
|
@ -3682,7 +3680,7 @@ push_decl_namespace (tree decl)
|
|||
void
|
||||
pop_decl_namespace (void)
|
||||
{
|
||||
VEC_pop (tree, decl_namespace_list);
|
||||
decl_namespace_list->pop ();
|
||||
}
|
||||
|
||||
/* Return the namespace that is the common ancestor
|
||||
|
@ -4224,19 +4222,19 @@ remove_hidden_names (tree fns)
|
|||
void
|
||||
suggest_alternatives_for (location_t location, tree name)
|
||||
{
|
||||
VEC(tree,heap) *candidates = NULL;
|
||||
VEC(tree,heap) *namespaces_to_search = NULL;
|
||||
vec<tree> candidates = vec<tree>();
|
||||
vec<tree> namespaces_to_search = vec<tree>();
|
||||
int max_to_search = PARAM_VALUE (CXX_MAX_NAMESPACES_FOR_DIAGNOSTIC_HELP);
|
||||
int n_searched = 0;
|
||||
tree t;
|
||||
unsigned ix;
|
||||
|
||||
VEC_safe_push (tree, heap, namespaces_to_search, global_namespace);
|
||||
namespaces_to_search.safe_push (global_namespace);
|
||||
|
||||
while (!VEC_empty (tree, namespaces_to_search)
|
||||
while (!namespaces_to_search.is_empty ()
|
||||
&& n_searched < max_to_search)
|
||||
{
|
||||
tree scope = VEC_pop (tree, namespaces_to_search);
|
||||
tree scope = namespaces_to_search.pop ();
|
||||
struct scope_binding binding = EMPTY_SCOPE_BINDING;
|
||||
cp_binding_level *level = NAMESPACE_LEVEL (scope);
|
||||
|
||||
|
@ -4246,11 +4244,11 @@ suggest_alternatives_for (location_t location, tree name)
|
|||
n_searched++;
|
||||
|
||||
if (binding.value)
|
||||
VEC_safe_push (tree, heap, candidates, binding.value);
|
||||
candidates.safe_push (binding.value);
|
||||
|
||||
/* Add child namespaces. */
|
||||
for (t = level->namespaces; t; t = DECL_CHAIN (t))
|
||||
VEC_safe_push (tree, heap, namespaces_to_search, t);
|
||||
namespaces_to_search.safe_push (t);
|
||||
}
|
||||
|
||||
/* If we stopped before we could examine all namespaces, inform the
|
||||
|
@ -4258,25 +4256,25 @@ suggest_alternatives_for (location_t location, tree name)
|
|||
might be more candidates further down that we weren't able to
|
||||
find. */
|
||||
if (n_searched >= max_to_search
|
||||
&& !VEC_empty (tree, namespaces_to_search))
|
||||
&& !namespaces_to_search.is_empty ())
|
||||
inform (location,
|
||||
"maximum limit of %d namespaces searched for %qE",
|
||||
max_to_search, name);
|
||||
|
||||
VEC_free (tree, heap, namespaces_to_search);
|
||||
namespaces_to_search.release ();
|
||||
|
||||
/* Nothing useful to report. */
|
||||
if (VEC_empty (tree, candidates))
|
||||
if (candidates.is_empty ())
|
||||
return;
|
||||
|
||||
inform_n (location, VEC_length (tree, candidates),
|
||||
inform_n (location, candidates.length (),
|
||||
"suggested alternative:",
|
||||
"suggested alternatives:");
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, candidates, ix, t)
|
||||
FOR_EACH_VEC_ELT (candidates, ix, t)
|
||||
inform (location_of (t), " %qE", t);
|
||||
|
||||
VEC_free (tree, heap, candidates);
|
||||
candidates.release ();
|
||||
}
|
||||
|
||||
/* Unscoped lookup of a global: iterate over current namespaces,
|
||||
|
@ -4408,11 +4406,11 @@ lookup_using_namespace (tree name, struct scope_binding *val,
|
|||
/* Returns true iff VEC contains TARGET. */
|
||||
|
||||
static bool
|
||||
tree_vec_contains (VEC(tree,gc)* vec, tree target)
|
||||
tree_vec_contains (vec<tree, va_gc> *vec, tree target)
|
||||
{
|
||||
unsigned int i;
|
||||
tree elt;
|
||||
FOR_EACH_VEC_ELT (tree,vec,i,elt)
|
||||
FOR_EACH_VEC_SAFE_ELT (vec,i,elt)
|
||||
if (elt == target)
|
||||
return true;
|
||||
return false;
|
||||
|
@ -4428,12 +4426,12 @@ qualified_lookup_using_namespace (tree name, tree scope,
|
|||
struct scope_binding *result, int flags)
|
||||
{
|
||||
/* Maintain a list of namespaces visited... */
|
||||
VEC(tree,gc) *seen = NULL;
|
||||
VEC(tree,gc) *seen_inline = NULL;
|
||||
vec<tree, va_gc> *seen = NULL;
|
||||
vec<tree, va_gc> *seen_inline = NULL;
|
||||
/* ... and a list of namespace yet to see. */
|
||||
VEC(tree,gc) *todo = NULL;
|
||||
VEC(tree,gc) *todo_maybe = NULL;
|
||||
VEC(tree,gc) *todo_inline = NULL;
|
||||
vec<tree, va_gc> *todo = NULL;
|
||||
vec<tree, va_gc> *todo_maybe = NULL;
|
||||
vec<tree, va_gc> *todo_inline = NULL;
|
||||
tree usings;
|
||||
timevar_start (TV_NAME_LOOKUP);
|
||||
/* Look through namespace aliases. */
|
||||
|
@ -4443,26 +4441,26 @@ qualified_lookup_using_namespace (tree name, tree scope,
|
|||
namespaces. For each used namespace, look through its inline
|
||||
namespace set for any bindings and usings. If no bindings are
|
||||
found, add any usings seen to the set of used namespaces. */
|
||||
VEC_safe_push (tree, gc, todo, scope);
|
||||
vec_safe_push (todo, scope);
|
||||
|
||||
while (VEC_length (tree, todo))
|
||||
while (todo->length ())
|
||||
{
|
||||
bool found_here;
|
||||
scope = VEC_pop (tree, todo);
|
||||
scope = todo->pop ();
|
||||
if (tree_vec_contains (seen, scope))
|
||||
continue;
|
||||
VEC_safe_push (tree, gc, seen, scope);
|
||||
VEC_safe_push (tree, gc, todo_inline, scope);
|
||||
vec_safe_push (seen, scope);
|
||||
vec_safe_push (todo_inline, scope);
|
||||
|
||||
found_here = false;
|
||||
while (VEC_length (tree, todo_inline))
|
||||
while (todo_inline->length ())
|
||||
{
|
||||
cxx_binding *binding;
|
||||
|
||||
scope = VEC_pop (tree, todo_inline);
|
||||
scope = todo_inline->pop ();
|
||||
if (tree_vec_contains (seen_inline, scope))
|
||||
continue;
|
||||
VEC_safe_push (tree, gc, seen_inline, scope);
|
||||
vec_safe_push (seen_inline, scope);
|
||||
|
||||
binding =
|
||||
cp_binding_level_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
|
||||
|
@ -4477,23 +4475,23 @@ qualified_lookup_using_namespace (tree name, tree scope,
|
|||
if (!TREE_INDIRECT_USING (usings))
|
||||
{
|
||||
if (is_associated_namespace (scope, TREE_PURPOSE (usings)))
|
||||
VEC_safe_push (tree, gc, todo_inline, TREE_PURPOSE (usings));
|
||||
vec_safe_push (todo_inline, TREE_PURPOSE (usings));
|
||||
else
|
||||
VEC_safe_push (tree, gc, todo_maybe, TREE_PURPOSE (usings));
|
||||
vec_safe_push (todo_maybe, TREE_PURPOSE (usings));
|
||||
}
|
||||
}
|
||||
|
||||
if (found_here)
|
||||
VEC_truncate (tree, todo_maybe, 0);
|
||||
vec_safe_truncate (todo_maybe, 0);
|
||||
else
|
||||
while (VEC_length (tree, todo_maybe))
|
||||
VEC_safe_push (tree, gc, todo, VEC_pop (tree, todo_maybe));
|
||||
while (vec_safe_length (todo_maybe))
|
||||
vec_safe_push (todo, todo_maybe->pop ());
|
||||
}
|
||||
VEC_free (tree,gc,todo);
|
||||
VEC_free (tree,gc,todo_maybe);
|
||||
VEC_free (tree,gc,todo_inline);
|
||||
VEC_free (tree,gc,seen);
|
||||
VEC_free (tree,gc,seen_inline);
|
||||
vec_free (todo);
|
||||
vec_free (todo_maybe);
|
||||
vec_free (todo_inline);
|
||||
vec_free (seen);
|
||||
vec_free (seen_inline);
|
||||
timevar_stop (TV_NAME_LOOKUP);
|
||||
return result->value != error_mark_node;
|
||||
}
|
||||
|
@ -4791,7 +4789,7 @@ lookup_name_nonclass (tree name)
|
|||
}
|
||||
|
||||
tree
|
||||
lookup_function_nonclass (tree name, VEC(tree,gc) *args, bool block_p)
|
||||
lookup_function_nonclass (tree name, vec<tree, va_gc> *args, bool block_p)
|
||||
{
|
||||
return
|
||||
lookup_arg_dependent (name,
|
||||
|
@ -5035,16 +5033,16 @@ lookup_type_current_level (tree name)
|
|||
struct arg_lookup
|
||||
{
|
||||
tree name;
|
||||
VEC(tree,gc) *args;
|
||||
VEC(tree,gc) *namespaces;
|
||||
VEC(tree,gc) *classes;
|
||||
vec<tree, va_gc> *args;
|
||||
vec<tree, va_gc> *namespaces;
|
||||
vec<tree, va_gc> *classes;
|
||||
tree functions;
|
||||
struct pointer_set_t *fn_set;
|
||||
};
|
||||
|
||||
static bool arg_assoc (struct arg_lookup*, tree);
|
||||
static bool arg_assoc_args (struct arg_lookup*, tree);
|
||||
static bool arg_assoc_args_vec (struct arg_lookup*, VEC(tree,gc) *);
|
||||
static bool arg_assoc_args_vec (struct arg_lookup*, vec<tree, va_gc> *);
|
||||
static bool arg_assoc_type (struct arg_lookup*, tree);
|
||||
static bool add_function (struct arg_lookup *, tree);
|
||||
static bool arg_assoc_namespace (struct arg_lookup *, tree);
|
||||
|
@ -5085,8 +5083,8 @@ add_function (struct arg_lookup *k, tree fn)
|
|||
bool
|
||||
is_associated_namespace (tree current, tree scope)
|
||||
{
|
||||
VEC(tree,gc) *seen = make_tree_vector ();
|
||||
VEC(tree,gc) *todo = make_tree_vector ();
|
||||
vec<tree, va_gc> *seen = make_tree_vector ();
|
||||
vec<tree, va_gc> *todo = make_tree_vector ();
|
||||
tree t;
|
||||
bool ret;
|
||||
|
||||
|
@ -5097,14 +5095,14 @@ is_associated_namespace (tree current, tree scope)
|
|||
ret = true;
|
||||
break;
|
||||
}
|
||||
VEC_safe_push (tree, gc, seen, scope);
|
||||
vec_safe_push (seen, scope);
|
||||
for (t = DECL_NAMESPACE_ASSOCIATIONS (scope); t; t = TREE_CHAIN (t))
|
||||
if (!vec_member (TREE_PURPOSE (t), seen))
|
||||
VEC_safe_push (tree, gc, todo, TREE_PURPOSE (t));
|
||||
if (!VEC_empty (tree, todo))
|
||||
vec_safe_push (todo, TREE_PURPOSE (t));
|
||||
if (!todo->is_empty ())
|
||||
{
|
||||
scope = VEC_last (tree, todo);
|
||||
VEC_pop (tree, todo);
|
||||
scope = todo->last ();
|
||||
todo->pop ();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5129,7 +5127,7 @@ arg_assoc_namespace (struct arg_lookup *k, tree scope)
|
|||
|
||||
if (vec_member (scope, k->namespaces))
|
||||
return false;
|
||||
VEC_safe_push (tree, gc, k->namespaces, scope);
|
||||
vec_safe_push (k->namespaces, scope);
|
||||
|
||||
/* Check out our super-users. */
|
||||
for (value = DECL_NAMESPACE_ASSOCIATIONS (scope); value;
|
||||
|
@ -5312,7 +5310,7 @@ arg_assoc_class (struct arg_lookup *k, tree type)
|
|||
|
||||
if (vec_member (type, k->classes))
|
||||
return false;
|
||||
VEC_safe_push (tree, gc, k->classes, type);
|
||||
vec_safe_push (k->classes, type);
|
||||
|
||||
if (TYPE_CLASS_SCOPE_P (type)
|
||||
&& arg_assoc_class_only (k, TYPE_CONTEXT (type)))
|
||||
|
@ -5422,12 +5420,12 @@ arg_assoc_args (struct arg_lookup *k, tree args)
|
|||
on error. */
|
||||
|
||||
static bool
|
||||
arg_assoc_args_vec (struct arg_lookup *k, VEC(tree,gc) *args)
|
||||
arg_assoc_args_vec (struct arg_lookup *k, vec<tree, va_gc> *args)
|
||||
{
|
||||
unsigned int ix;
|
||||
tree arg;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, args, ix, arg)
|
||||
FOR_EACH_VEC_SAFE_ELT (args, ix, arg)
|
||||
if (arg_assoc (k, arg))
|
||||
return true;
|
||||
return false;
|
||||
|
@ -5495,7 +5493,7 @@ arg_assoc (struct arg_lookup *k, tree n)
|
|||
are the functions found in normal lookup. */
|
||||
|
||||
static tree
|
||||
lookup_arg_dependent_1 (tree name, tree fns, VEC(tree,gc) *args,
|
||||
lookup_arg_dependent_1 (tree name, tree fns, vec<tree, va_gc> *args,
|
||||
bool include_std)
|
||||
{
|
||||
struct arg_lookup k;
|
||||
|
@ -5560,7 +5558,7 @@ lookup_arg_dependent_1 (tree name, tree fns, VEC(tree,gc) *args,
|
|||
/* Wrapper for lookup_arg_dependent_1. */
|
||||
|
||||
tree
|
||||
lookup_arg_dependent (tree name, tree fns, VEC(tree,gc) *args,
|
||||
lookup_arg_dependent (tree name, tree fns, vec<tree, va_gc> *args,
|
||||
bool include_std)
|
||||
{
|
||||
tree ret;
|
||||
|
@ -5820,7 +5818,7 @@ pushtag_1 (tree name, tree type, tag_scope scope)
|
|||
add_decl_expr (decl);
|
||||
}
|
||||
else
|
||||
VEC_safe_push (tree, gc, local_classes, type);
|
||||
vec_safe_push (local_classes, type);
|
||||
}
|
||||
}
|
||||
if (b->kind == sk_class
|
||||
|
@ -5884,7 +5882,7 @@ store_binding_p (tree id)
|
|||
have enough space reserved. */
|
||||
|
||||
static void
|
||||
store_binding (tree id, VEC(cxx_saved_binding,gc) **old_bindings)
|
||||
store_binding (tree id, vec<cxx_saved_binding, va_gc> **old_bindings)
|
||||
{
|
||||
cxx_saved_binding saved;
|
||||
|
||||
|
@ -5895,14 +5893,14 @@ store_binding (tree id, VEC(cxx_saved_binding,gc) **old_bindings)
|
|||
saved.identifier = id;
|
||||
saved.binding = IDENTIFIER_BINDING (id);
|
||||
saved.real_type_value = REAL_IDENTIFIER_TYPE_VALUE (id);
|
||||
VEC_quick_push (cxx_saved_binding, *old_bindings, saved);
|
||||
(*old_bindings)->quick_push (saved);
|
||||
IDENTIFIER_BINDING (id) = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
store_bindings (tree names, VEC(cxx_saved_binding,gc) **old_bindings)
|
||||
store_bindings (tree names, vec<cxx_saved_binding, va_gc> **old_bindings)
|
||||
{
|
||||
static VEC(tree,heap) *bindings_need_stored = NULL;
|
||||
static vec<tree> bindings_need_stored = vec<tree>();
|
||||
tree t, id;
|
||||
size_t i;
|
||||
|
||||
|
@ -5915,19 +5913,18 @@ store_bindings (tree names, VEC(cxx_saved_binding,gc) **old_bindings)
|
|||
id = DECL_NAME (t);
|
||||
|
||||
if (store_binding_p (id))
|
||||
VEC_safe_push(tree, heap, bindings_need_stored, id);
|
||||
bindings_need_stored.safe_push (id);
|
||||
}
|
||||
if (!VEC_empty (tree, bindings_need_stored))
|
||||
if (!bindings_need_stored.is_empty ())
|
||||
{
|
||||
VEC_reserve_exact (cxx_saved_binding, gc, *old_bindings,
|
||||
VEC_length (tree, bindings_need_stored));
|
||||
for (i = 0; VEC_iterate(tree, bindings_need_stored, i, id); ++i)
|
||||
vec_safe_reserve_exact (*old_bindings, bindings_need_stored.length ());
|
||||
for (i = 0; bindings_need_stored.iterate (i, &id); ++i)
|
||||
{
|
||||
/* We can appearantly have duplicates in NAMES. */
|
||||
if (store_binding_p (id))
|
||||
store_binding (id, old_bindings);
|
||||
}
|
||||
VEC_truncate (tree, bindings_need_stored, 0);
|
||||
bindings_need_stored.truncate (0);
|
||||
}
|
||||
timevar_cond_stop (TV_NAME_LOOKUP, subtime);
|
||||
}
|
||||
|
@ -5936,25 +5933,24 @@ store_bindings (tree names, VEC(cxx_saved_binding,gc) **old_bindings)
|
|||
objects, rather than a TREE_LIST. */
|
||||
|
||||
static void
|
||||
store_class_bindings (VEC(cp_class_binding,gc) *names,
|
||||
VEC(cxx_saved_binding,gc) **old_bindings)
|
||||
store_class_bindings (vec<cp_class_binding, va_gc> *names,
|
||||
vec<cxx_saved_binding, va_gc> **old_bindings)
|
||||
{
|
||||
static VEC(tree,heap) *bindings_need_stored = NULL;
|
||||
static vec<tree> bindings_need_stored = vec<tree>();
|
||||
size_t i;
|
||||
cp_class_binding *cb;
|
||||
|
||||
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
|
||||
for (i = 0; VEC_iterate(cp_class_binding, names, i, cb); ++i)
|
||||
for (i = 0; vec_safe_iterate (names, i, &cb); ++i)
|
||||
if (store_binding_p (cb->identifier))
|
||||
VEC_safe_push (tree, heap, bindings_need_stored, cb->identifier);
|
||||
if (!VEC_empty (tree, bindings_need_stored))
|
||||
bindings_need_stored.safe_push (cb->identifier);
|
||||
if (!bindings_need_stored.is_empty ())
|
||||
{
|
||||
tree id;
|
||||
VEC_reserve_exact (cxx_saved_binding, gc, *old_bindings,
|
||||
VEC_length (tree, bindings_need_stored));
|
||||
for (i = 0; VEC_iterate(tree, bindings_need_stored, i, id); ++i)
|
||||
vec_safe_reserve_exact (*old_bindings, bindings_need_stored.length ());
|
||||
for (i = 0; bindings_need_stored.iterate (i, &id); ++i)
|
||||
store_binding (id, old_bindings);
|
||||
VEC_truncate (tree, bindings_need_stored, 0);
|
||||
bindings_need_stored.truncate (0);
|
||||
}
|
||||
timevar_cond_stop (TV_NAME_LOOKUP, subtime);
|
||||
}
|
||||
|
@ -6010,7 +6006,7 @@ push_to_top_level (void)
|
|||
SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (t), TREE_VALUE (t));
|
||||
}
|
||||
|
||||
FOR_EACH_VEC_ELT (cxx_saved_binding, s->old_bindings, i, sb)
|
||||
FOR_EACH_VEC_SAFE_ELT (s->old_bindings, i, sb)
|
||||
IDENTIFIER_MARKED (sb->identifier) = 0;
|
||||
|
||||
s->prev = scope_chain;
|
||||
|
@ -6023,7 +6019,7 @@ push_to_top_level (void)
|
|||
|
||||
scope_chain = s;
|
||||
current_function_decl = NULL_TREE;
|
||||
current_lang_base = VEC_alloc (tree, gc, 10);
|
||||
vec_alloc (current_lang_base, 10);
|
||||
current_lang_name = lang_name_cplusplus;
|
||||
current_namespace = global_namespace;
|
||||
push_class_stack ();
|
||||
|
@ -6047,7 +6043,7 @@ pop_from_top_level_1 (void)
|
|||
current_lang_base = 0;
|
||||
|
||||
scope_chain = s->prev;
|
||||
FOR_EACH_VEC_ELT (cxx_saved_binding, s->old_bindings, i, saved)
|
||||
FOR_EACH_VEC_SAFE_ELT (s->old_bindings, i, saved)
|
||||
{
|
||||
tree id = saved->identifier;
|
||||
|
||||
|
|
|
@ -86,8 +86,6 @@ typedef struct GTY(()) cxx_saved_binding {
|
|||
tree real_type_value;
|
||||
} cxx_saved_binding;
|
||||
|
||||
DEF_VEC_O(cxx_saved_binding);
|
||||
DEF_VEC_ALLOC_O(cxx_saved_binding,gc);
|
||||
|
||||
extern tree identifier_type_value (tree);
|
||||
extern void set_identifier_type_value (tree, tree);
|
||||
|
@ -147,8 +145,6 @@ typedef struct GTY(()) cp_class_binding {
|
|||
tree identifier;
|
||||
} cp_class_binding;
|
||||
|
||||
DEF_VEC_O(cp_class_binding);
|
||||
DEF_VEC_ALLOC_O(cp_class_binding,gc);
|
||||
|
||||
typedef struct GTY(()) cp_label_binding {
|
||||
/* The bound LABEL_DECL. */
|
||||
|
@ -157,8 +153,6 @@ typedef struct GTY(()) cp_label_binding {
|
|||
tree prev_value;
|
||||
} cp_label_binding;
|
||||
|
||||
DEF_VEC_O(cp_label_binding);
|
||||
DEF_VEC_ALLOC_O(cp_label_binding,gc);
|
||||
|
||||
/* For each binding contour we allocate a binding_level structure
|
||||
which records the names defined in that contour.
|
||||
|
@ -195,7 +189,7 @@ struct GTY(()) cp_binding_level {
|
|||
tree namespaces;
|
||||
|
||||
/* An array of static functions and variables (for namespaces only) */
|
||||
VEC(tree,gc) *static_decls;
|
||||
vec<tree, va_gc> *static_decls;
|
||||
|
||||
/* A list of USING_DECL nodes. */
|
||||
tree usings;
|
||||
|
@ -206,7 +200,7 @@ struct GTY(()) cp_binding_level {
|
|||
|
||||
/* For the binding level corresponding to a class, the entities
|
||||
declared in the class or its base classes. */
|
||||
VEC(cp_class_binding,gc) *class_shadowed;
|
||||
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
|
||||
|
@ -217,7 +211,7 @@ struct GTY(()) cp_binding_level {
|
|||
|
||||
/* Similar to class_shadowed, but for IDENTIFIER_LABEL_VALUE, and
|
||||
used for all binding levels. */
|
||||
VEC(cp_label_binding,gc) *shadowed_labels;
|
||||
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
|
||||
|
@ -234,7 +228,7 @@ struct GTY(()) cp_binding_level {
|
|||
/* 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. */
|
||||
VEC(tree,gc) *dead_vars_from_for;
|
||||
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. */
|
||||
|
@ -327,7 +321,7 @@ extern tree lookup_qualified_name (tree, tree, bool, bool);
|
|||
extern tree lookup_name_nonclass (tree);
|
||||
extern tree lookup_name_innermost_nonclass_level (tree);
|
||||
extern bool is_local_extern (tree);
|
||||
extern tree lookup_function_nonclass (tree, VEC(tree,gc) *, bool);
|
||||
extern tree lookup_function_nonclass (tree, vec<tree, va_gc> *, bool);
|
||||
extern void push_local_binding (tree, tree, int);
|
||||
extern bool pushdecl_class_level (tree);
|
||||
extern tree pushdecl_namespace_level (tree, bool);
|
||||
|
@ -343,7 +337,7 @@ 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);
|
||||
extern tree lookup_arg_dependent (tree, tree, VEC(tree,gc) *, bool);
|
||||
extern tree lookup_arg_dependent (tree, tree, vec<tree, va_gc> *, bool);
|
||||
extern bool is_associated_namespace (tree, tree);
|
||||
extern void parse_using_directive (tree, tree);
|
||||
extern tree innermost_non_namespace_value (tree);
|
||||
|
|
246
gcc/cp/parser.c
246
gcc/cp/parser.c
|
@ -252,7 +252,7 @@ int cp_unevaluated_operand;
|
|||
highlighted by surrounding it in [[ ]]. */
|
||||
|
||||
static void
|
||||
cp_lexer_dump_tokens (FILE *file, VEC(cp_token,gc) *buffer,
|
||||
cp_lexer_dump_tokens (FILE *file, vec<cp_token, va_gc> *buffer,
|
||||
cp_token *start_token, unsigned num,
|
||||
cp_token *curr_token)
|
||||
{
|
||||
|
@ -260,26 +260,26 @@ cp_lexer_dump_tokens (FILE *file, VEC(cp_token,gc) *buffer,
|
|||
cp_token *token;
|
||||
bool do_print;
|
||||
|
||||
fprintf (file, "%u tokens\n", VEC_length (cp_token, buffer));
|
||||
fprintf (file, "%u tokens\n", vec_safe_length (buffer));
|
||||
|
||||
if (buffer == NULL)
|
||||
return;
|
||||
|
||||
if (num == 0)
|
||||
num = VEC_length (cp_token, buffer);
|
||||
num = buffer->length ();
|
||||
|
||||
if (start_token == NULL)
|
||||
start_token = VEC_address (cp_token, buffer);
|
||||
start_token = buffer->address ();
|
||||
|
||||
if (start_token > VEC_address (cp_token, buffer))
|
||||
if (start_token > buffer->address ())
|
||||
{
|
||||
cp_lexer_print_token (file, &VEC_index (cp_token, buffer, 0));
|
||||
cp_lexer_print_token (file, &(*buffer)[0]);
|
||||
fprintf (file, " ... ");
|
||||
}
|
||||
|
||||
do_print = false;
|
||||
nprinted = 0;
|
||||
for (i = 0; VEC_iterate (cp_token, buffer, i, token) && nprinted < num; i++)
|
||||
for (i = 0; buffer->iterate (i, &token) && nprinted < num; i++)
|
||||
{
|
||||
if (token == start_token)
|
||||
do_print = true;
|
||||
|
@ -310,10 +310,10 @@ cp_lexer_dump_tokens (FILE *file, VEC(cp_token,gc) *buffer,
|
|||
}
|
||||
}
|
||||
|
||||
if (i == num && i < VEC_length (cp_token, buffer))
|
||||
if (i == num && i < buffer->length ())
|
||||
{
|
||||
fprintf (file, " ... ");
|
||||
cp_lexer_print_token (file, &VEC_last (cp_token, buffer));
|
||||
cp_lexer_print_token (file, &buffer->last ());
|
||||
}
|
||||
|
||||
fprintf (file, "\n");
|
||||
|
@ -323,7 +323,7 @@ cp_lexer_dump_tokens (FILE *file, VEC(cp_token,gc) *buffer,
|
|||
/* Dump all tokens in BUFFER to stderr. */
|
||||
|
||||
void
|
||||
cp_lexer_debug_tokens (VEC(cp_token,gc) *buffer)
|
||||
cp_lexer_debug_tokens (vec<cp_token, va_gc> *buffer)
|
||||
{
|
||||
cp_lexer_dump_tokens (stderr, buffer, NULL, 0, NULL);
|
||||
}
|
||||
|
@ -393,8 +393,7 @@ cp_debug_print_unparsed_function (FILE *file, cp_unparsed_functions_entry *uf)
|
|||
|
||||
fprintf (file, "\tFunctions with default args:\n");
|
||||
for (i = 0;
|
||||
VEC_iterate (cp_default_arg_entry, uf->funs_with_default_args, i,
|
||||
default_arg_fn);
|
||||
vec_safe_iterate (uf->funs_with_default_args, i, &default_arg_fn);
|
||||
i++)
|
||||
{
|
||||
fprintf (file, "\t\tClass type: ");
|
||||
|
@ -406,7 +405,7 @@ cp_debug_print_unparsed_function (FILE *file, cp_unparsed_functions_entry *uf)
|
|||
|
||||
fprintf (file, "\n\tFunctions with definitions that require "
|
||||
"post-processing\n\t\t");
|
||||
for (i = 0; VEC_iterate (tree, uf->funs_with_definitions, i, fn); i++)
|
||||
for (i = 0; vec_safe_iterate (uf->funs_with_definitions, i, &fn); i++)
|
||||
{
|
||||
print_node_brief (file, "", fn, 0);
|
||||
fprintf (file, " ");
|
||||
|
@ -415,7 +414,7 @@ cp_debug_print_unparsed_function (FILE *file, cp_unparsed_functions_entry *uf)
|
|||
|
||||
fprintf (file, "\n\tNon-static data members with initializers that require "
|
||||
"post-processing\n\t\t");
|
||||
for (i = 0; VEC_iterate (tree, uf->nsdmis, i, fn); i++)
|
||||
for (i = 0; vec_safe_iterate (uf->nsdmis, i, &fn); i++)
|
||||
{
|
||||
print_node_brief (file, "", fn, 0);
|
||||
fprintf (file, " ");
|
||||
|
@ -428,13 +427,13 @@ cp_debug_print_unparsed_function (FILE *file, cp_unparsed_functions_entry *uf)
|
|||
|
||||
static void
|
||||
cp_debug_print_unparsed_queues (FILE *file,
|
||||
VEC(cp_unparsed_functions_entry, gc) *s)
|
||||
vec<cp_unparsed_functions_entry, va_gc> *s)
|
||||
{
|
||||
unsigned i;
|
||||
cp_unparsed_functions_entry *uf;
|
||||
|
||||
fprintf (file, "Unparsed functions\n");
|
||||
for (i = 0; VEC_iterate (cp_unparsed_functions_entry, s, i, uf); i++)
|
||||
for (i = 0; vec_safe_iterate (s, i, &uf); i++)
|
||||
{
|
||||
fprintf (file, "#%u:\n", i);
|
||||
cp_debug_print_unparsed_function (file, uf);
|
||||
|
@ -454,7 +453,7 @@ cp_debug_parser_tokens (FILE *file, cp_parser *parser, int window_size)
|
|||
file = stderr;
|
||||
|
||||
next_token = parser->lexer->next_token;
|
||||
first_token = VEC_address (cp_token, parser->lexer->buffer);
|
||||
first_token = parser->lexer->buffer->address ();
|
||||
start_token = (next_token > first_token + window_size / 2)
|
||||
? next_token - window_size / 2
|
||||
: first_token;
|
||||
|
@ -478,7 +477,7 @@ cp_debug_parser (FILE *file, cp_parser *parser)
|
|||
|
||||
fprintf (file, "Parser state\n\n");
|
||||
fprintf (file, "Number of tokens: %u\n",
|
||||
VEC_length (cp_token, parser->lexer->buffer));
|
||||
vec_safe_length (parser->lexer->buffer));
|
||||
cp_debug_print_tree_if_set (file, "Lookup scope", parser->scope);
|
||||
cp_debug_print_tree_if_set (file, "Object scope",
|
||||
parser->object_scope);
|
||||
|
@ -563,11 +562,10 @@ cp_lexer_alloc (void)
|
|||
/* Initially we are not debugging. */
|
||||
lexer->debugging_p = false;
|
||||
|
||||
lexer->saved_tokens = VEC_alloc (cp_token_position, heap,
|
||||
CP_SAVED_TOKEN_STACK);
|
||||
lexer->saved_tokens.create (CP_SAVED_TOKEN_STACK);
|
||||
|
||||
/* Create the buffer. */
|
||||
lexer->buffer = VEC_alloc (cp_token, gc, CP_LEXER_BUFFER_SIZE);
|
||||
vec_alloc (lexer->buffer, CP_LEXER_BUFFER_SIZE);
|
||||
|
||||
return lexer;
|
||||
}
|
||||
|
@ -590,20 +588,20 @@ cp_lexer_new_main (void)
|
|||
lexer = cp_lexer_alloc ();
|
||||
|
||||
/* Put the first token in the buffer. */
|
||||
VEC_quick_push (cp_token, lexer->buffer, token);
|
||||
lexer->buffer->quick_push (token);
|
||||
|
||||
/* Get the remaining tokens from the preprocessor. */
|
||||
while (token.type != CPP_EOF)
|
||||
{
|
||||
cp_lexer_get_preprocessor_token (lexer, &token);
|
||||
VEC_safe_push (cp_token, gc, lexer->buffer, token);
|
||||
vec_safe_push (lexer->buffer, token);
|
||||
}
|
||||
|
||||
lexer->last_token = VEC_address (cp_token, lexer->buffer)
|
||||
+ VEC_length (cp_token, lexer->buffer)
|
||||
lexer->last_token = lexer->buffer->address ()
|
||||
+ lexer->buffer->length ()
|
||||
- 1;
|
||||
lexer->next_token = VEC_length (cp_token, lexer->buffer)
|
||||
? VEC_address (cp_token, lexer->buffer)
|
||||
lexer->next_token = lexer->buffer->length ()
|
||||
? lexer->buffer->address ()
|
||||
: &eof_token;
|
||||
|
||||
/* Subsequent preprocessor diagnostics should use compiler
|
||||
|
@ -629,8 +627,7 @@ cp_lexer_new_from_tokens (cp_token_cache *cache)
|
|||
lexer->next_token = first == last ? &eof_token : first;
|
||||
lexer->last_token = last;
|
||||
|
||||
lexer->saved_tokens = VEC_alloc (cp_token_position, heap,
|
||||
CP_SAVED_TOKEN_STACK);
|
||||
lexer->saved_tokens.create (CP_SAVED_TOKEN_STACK);
|
||||
|
||||
/* Initially we are not debugging. */
|
||||
lexer->debugging_p = false;
|
||||
|
@ -644,8 +641,8 @@ cp_lexer_new_from_tokens (cp_token_cache *cache)
|
|||
static void
|
||||
cp_lexer_destroy (cp_lexer *lexer)
|
||||
{
|
||||
VEC_free (cp_token, gc, lexer->buffer);
|
||||
VEC_free (cp_token_position, heap, lexer->saved_tokens);
|
||||
vec_free (lexer->buffer);
|
||||
lexer->saved_tokens.release ();
|
||||
ggc_free (lexer);
|
||||
}
|
||||
|
||||
|
@ -700,7 +697,7 @@ cp_lexer_previous_token (cp_lexer *lexer)
|
|||
static inline int
|
||||
cp_lexer_saving_tokens (const cp_lexer* lexer)
|
||||
{
|
||||
return VEC_length (cp_token_position, lexer->saved_tokens) != 0;
|
||||
return lexer->saved_tokens.length () != 0;
|
||||
}
|
||||
|
||||
/* Store the next token from the preprocessor in *TOKEN. Return true
|
||||
|
@ -1060,8 +1057,7 @@ cp_lexer_save_tokens (cp_lexer* lexer)
|
|||
if (cp_lexer_debugging_p (lexer))
|
||||
fprintf (cp_lexer_debug_stream, "cp_lexer: saving tokens\n");
|
||||
|
||||
VEC_safe_push (cp_token_position, heap,
|
||||
lexer->saved_tokens, lexer->next_token);
|
||||
lexer->saved_tokens.safe_push (lexer->next_token);
|
||||
}
|
||||
|
||||
/* Commit to the portion of the token stream most recently saved. */
|
||||
|
@ -1073,7 +1069,7 @@ cp_lexer_commit_tokens (cp_lexer* lexer)
|
|||
if (cp_lexer_debugging_p (lexer))
|
||||
fprintf (cp_lexer_debug_stream, "cp_lexer: committing tokens\n");
|
||||
|
||||
VEC_pop (cp_token_position, lexer->saved_tokens);
|
||||
lexer->saved_tokens.pop ();
|
||||
}
|
||||
|
||||
/* Return all tokens saved since the last call to cp_lexer_save_tokens
|
||||
|
@ -1086,7 +1082,7 @@ cp_lexer_rollback_tokens (cp_lexer* lexer)
|
|||
if (cp_lexer_debugging_p (lexer))
|
||||
fprintf (cp_lexer_debug_stream, "cp_lexer: restoring tokens\n");
|
||||
|
||||
lexer->next_token = VEC_pop (cp_token_position, lexer->saved_tokens);
|
||||
lexer->next_token = lexer->saved_tokens.pop ();
|
||||
}
|
||||
|
||||
/* Print a representation of the TOKEN on the STREAM. */
|
||||
|
@ -1735,24 +1731,24 @@ cp_parser_context_new (cp_parser_context* next)
|
|||
/* Managing the unparsed function queues. */
|
||||
|
||||
#define unparsed_funs_with_default_args \
|
||||
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues).funs_with_default_args
|
||||
parser->unparsed_queues->last ().funs_with_default_args
|
||||
#define unparsed_funs_with_definitions \
|
||||
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues).funs_with_definitions
|
||||
parser->unparsed_queues->last ().funs_with_definitions
|
||||
#define unparsed_nsdmis \
|
||||
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues).nsdmis
|
||||
parser->unparsed_queues->last ().nsdmis
|
||||
|
||||
static void
|
||||
push_unparsed_function_queues (cp_parser *parser)
|
||||
{
|
||||
cp_unparsed_functions_entry e = {NULL, make_tree_vector (), NULL};
|
||||
VEC_safe_push (cp_unparsed_functions_entry, gc, parser->unparsed_queues, e);
|
||||
vec_safe_push (parser->unparsed_queues, e);
|
||||
}
|
||||
|
||||
static void
|
||||
pop_unparsed_function_queues (cp_parser *parser)
|
||||
{
|
||||
release_tree_vector (unparsed_funs_with_definitions);
|
||||
VEC_pop (cp_unparsed_functions_entry, parser->unparsed_queues);
|
||||
parser->unparsed_queues->pop ();
|
||||
}
|
||||
|
||||
/* Prototypes. */
|
||||
|
@ -1812,7 +1808,7 @@ static tree cp_parser_postfix_open_square_expression
|
|||
(cp_parser *, tree, bool);
|
||||
static tree cp_parser_postfix_dot_deref_expression
|
||||
(cp_parser *, enum cpp_ttype, tree, bool, cp_id_kind *, location_t);
|
||||
static VEC(tree,gc) *cp_parser_parenthesized_expression_list
|
||||
static vec<tree, va_gc> *cp_parser_parenthesized_expression_list
|
||||
(cp_parser *, int, bool, bool, bool *);
|
||||
/* Values for the second parameter of cp_parser_parenthesized_expression_list. */
|
||||
enum { non_attr = 0, normal_attr = 1, id_attr = 2 };
|
||||
|
@ -1824,7 +1820,7 @@ static enum tree_code cp_parser_unary_operator
|
|||
(cp_token *);
|
||||
static tree cp_parser_new_expression
|
||||
(cp_parser *);
|
||||
static VEC(tree,gc) *cp_parser_new_placement
|
||||
static vec<tree, va_gc> *cp_parser_new_placement
|
||||
(cp_parser *);
|
||||
static tree cp_parser_new_type_id
|
||||
(cp_parser *, tree *);
|
||||
|
@ -1832,7 +1828,7 @@ static cp_declarator *cp_parser_new_declarator_opt
|
|||
(cp_parser *);
|
||||
static cp_declarator *cp_parser_direct_new_declarator
|
||||
(cp_parser *);
|
||||
static VEC(tree,gc) *cp_parser_new_initializer
|
||||
static vec<tree, va_gc> *cp_parser_new_initializer
|
||||
(cp_parser *);
|
||||
static tree cp_parser_delete_expression
|
||||
(cp_parser *);
|
||||
|
@ -1964,7 +1960,7 @@ static tree cp_parser_decltype
|
|||
/* Declarators [gram.dcl.decl] */
|
||||
|
||||
static tree cp_parser_init_declarator
|
||||
(cp_parser *, cp_decl_specifier_seq *, VEC (deferred_access_check,gc)*, bool, bool, int, bool *, tree *);
|
||||
(cp_parser *, cp_decl_specifier_seq *, vec<deferred_access_check, va_gc> *, bool, bool, int, bool *, tree *);
|
||||
static cp_declarator *cp_parser_declarator
|
||||
(cp_parser *, cp_parser_declarator_kind, int *, bool *, bool);
|
||||
static cp_declarator *cp_parser_direct_declarator
|
||||
|
@ -2004,7 +2000,7 @@ static tree cp_parser_initializer_clause
|
|||
(cp_parser *, bool *);
|
||||
static tree cp_parser_braced_list
|
||||
(cp_parser*, bool*);
|
||||
static VEC(constructor_elt,gc) *cp_parser_initializer_list
|
||||
static vec<constructor_elt, va_gc> *cp_parser_initializer_list
|
||||
(cp_parser *, bool *);
|
||||
|
||||
static bool cp_parser_ctor_initializer_opt_and_function_body
|
||||
|
@ -2220,9 +2216,9 @@ static tree cp_parser_function_definition_after_declarator
|
|||
static void cp_parser_template_declaration_after_export
|
||||
(cp_parser *, bool);
|
||||
static void cp_parser_perform_template_parameter_access_checks
|
||||
(VEC (deferred_access_check,gc)*);
|
||||
(vec<deferred_access_check, va_gc> *);
|
||||
static tree cp_parser_single_declaration
|
||||
(cp_parser *, VEC (deferred_access_check,gc)*, bool, bool, bool *);
|
||||
(cp_parser *, vec<deferred_access_check, va_gc> *, bool, bool, bool *);
|
||||
static tree cp_parser_functional_cast
|
||||
(cp_parser *, tree);
|
||||
static tree cp_parser_save_member_function_body
|
||||
|
@ -3551,7 +3547,7 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok)
|
|||
/* Look up a literal operator with the name and the exact arguments. */
|
||||
|
||||
static tree
|
||||
lookup_literal_operator (tree name, VEC(tree,gc) *args)
|
||||
lookup_literal_operator (tree name, vec<tree, va_gc> *args)
|
||||
{
|
||||
tree decl, fns;
|
||||
decl = lookup_name (name);
|
||||
|
@ -3567,11 +3563,11 @@ lookup_literal_operator (tree name, VEC(tree,gc) *args)
|
|||
argtypes = TYPE_ARG_TYPES (TREE_TYPE (fn));
|
||||
if (argtypes != NULL_TREE)
|
||||
{
|
||||
for (ix = 0; ix < VEC_length (tree, args) && argtypes != NULL_TREE;
|
||||
for (ix = 0; ix < vec_safe_length (args) && argtypes != NULL_TREE;
|
||||
++ix, argtypes = TREE_CHAIN (argtypes))
|
||||
{
|
||||
tree targ = TREE_VALUE (argtypes);
|
||||
tree tparm = TREE_TYPE (VEC_index (tree, args, ix));
|
||||
tree tparm = TREE_TYPE ((*args)[ix]);
|
||||
bool ptr = TREE_CODE (targ) == POINTER_TYPE;
|
||||
bool arr = TREE_CODE (tparm) == ARRAY_TYPE;
|
||||
if ((ptr || arr || !same_type_p (targ, tparm))
|
||||
|
@ -3581,7 +3577,7 @@ lookup_literal_operator (tree name, VEC(tree,gc) *args)
|
|||
found = false;
|
||||
}
|
||||
if (found
|
||||
&& ix == VEC_length (tree, args)
|
||||
&& ix == vec_safe_length (args)
|
||||
/* May be this should be sufficient_parms_p instead,
|
||||
depending on how exactly should user-defined literals
|
||||
work in presence of default arguments on the literal
|
||||
|
@ -3609,8 +3605,8 @@ cp_parser_userdef_char_literal (cp_parser *parser)
|
|||
|
||||
/* Build up a call to the user-defined operator */
|
||||
/* Lookup the name we got back from the id-expression. */
|
||||
VEC(tree,gc) *args = make_tree_vector ();
|
||||
VEC_safe_push (tree, gc, args, value);
|
||||
vec<tree, va_gc> *args = make_tree_vector ();
|
||||
vec_safe_push (args, value);
|
||||
decl = lookup_literal_operator (name, args);
|
||||
if (!decl || decl == error_mark_node)
|
||||
{
|
||||
|
@ -3668,12 +3664,12 @@ cp_parser_userdef_numeric_literal (cp_parser *parser)
|
|||
tree num_string = USERDEF_LITERAL_NUM_STRING (literal);
|
||||
tree name = cp_literal_operator_id (IDENTIFIER_POINTER (suffix_id));
|
||||
tree decl, result;
|
||||
VEC(tree,gc) *args;
|
||||
vec<tree, va_gc> *args;
|
||||
|
||||
/* Look for a literal operator taking the exact type of numeric argument
|
||||
as the literal value. */
|
||||
args = make_tree_vector ();
|
||||
VEC_safe_push (tree, gc, args, value);
|
||||
vec_safe_push (args, value);
|
||||
decl = lookup_literal_operator (name, args);
|
||||
if (decl && decl != error_mark_node)
|
||||
{
|
||||
|
@ -3690,7 +3686,7 @@ cp_parser_userdef_numeric_literal (cp_parser *parser)
|
|||
operator taking a const char* argument consisting of the number
|
||||
in string format. */
|
||||
args = make_tree_vector ();
|
||||
VEC_safe_push (tree, gc, args, num_string);
|
||||
vec_safe_push (args, num_string);
|
||||
decl = lookup_literal_operator (name, args);
|
||||
if (decl && decl != error_mark_node)
|
||||
{
|
||||
|
@ -3742,9 +3738,9 @@ cp_parser_userdef_string_literal (cp_token *token)
|
|||
|
||||
/* Build up a call to the user-defined operator */
|
||||
/* Lookup the name we got back from the id-expression. */
|
||||
VEC(tree,gc) *args = make_tree_vector ();
|
||||
VEC_safe_push (tree, gc, args, value);
|
||||
VEC_safe_push (tree, gc, args, build_int_cst (size_type_node, len));
|
||||
vec<tree, va_gc> *args = make_tree_vector ();
|
||||
vec_safe_push (args, value);
|
||||
vec_safe_push (args, build_int_cst (size_type_node, len));
|
||||
decl = lookup_name (name);
|
||||
if (!decl || decl == error_mark_node)
|
||||
{
|
||||
|
@ -5496,7 +5492,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
|
|||
|
||||
case RID_BUILTIN_SHUFFLE:
|
||||
{
|
||||
VEC(tree,gc)* vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
unsigned int i;
|
||||
tree p;
|
||||
location_t loc = token->location;
|
||||
|
@ -5508,21 +5504,13 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
|
|||
if (vec == NULL)
|
||||
return error_mark_node;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, vec, i, p)
|
||||
FOR_EACH_VEC_ELT (*vec, i, p)
|
||||
mark_exp_read (p);
|
||||
|
||||
if (VEC_length (tree, vec) == 2)
|
||||
return
|
||||
c_build_vec_perm_expr
|
||||
(loc, VEC_index (tree, vec, 0),
|
||||
NULL_TREE, VEC_index (tree, vec, 1));
|
||||
|
||||
else if (VEC_length (tree, vec) == 3)
|
||||
return
|
||||
c_build_vec_perm_expr
|
||||
(loc, VEC_index (tree, vec, 0),
|
||||
VEC_index (tree, vec, 1),
|
||||
VEC_index (tree, vec, 2));
|
||||
if (vec->length () == 2)
|
||||
return c_build_vec_perm_expr (loc, (*vec)[0], NULL_TREE, (*vec)[1]);
|
||||
else if (vec->length () == 3)
|
||||
return c_build_vec_perm_expr (loc, (*vec)[0], (*vec)[1], (*vec)[2]);
|
||||
else
|
||||
{
|
||||
error_at (loc, "wrong number of arguments to "
|
||||
|
@ -5558,7 +5546,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
|
|||
if (cp_parser_allow_gnu_extensions_p (parser)
|
||||
&& cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN))
|
||||
{
|
||||
VEC(constructor_elt,gc) *initializer_list = NULL;
|
||||
vec<constructor_elt, va_gc> *initializer_list = NULL;
|
||||
bool saved_in_type_id_in_expr_p;
|
||||
|
||||
cp_parser_parse_tentatively (parser);
|
||||
|
@ -5666,7 +5654,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
|
|||
bool is_builtin_constant_p;
|
||||
bool saved_integral_constant_expression_p = false;
|
||||
bool saved_non_integral_constant_expression_p = false;
|
||||
VEC(tree,gc) *args;
|
||||
vec<tree, va_gc> *args;
|
||||
|
||||
is_member_access = false;
|
||||
|
||||
|
@ -5717,7 +5705,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
|
|||
{
|
||||
if (TREE_CODE (postfix_expression) == IDENTIFIER_NODE)
|
||||
{
|
||||
if (!VEC_empty (tree, args))
|
||||
if (!args->is_empty ())
|
||||
{
|
||||
koenig_p = true;
|
||||
if (!any_type_dependent_arguments_p (args))
|
||||
|
@ -5733,7 +5721,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
|
|||
/* We do not perform argument-dependent lookup if
|
||||
normal lookup finds a non-function, in accordance
|
||||
with the expected resolution of DR 218. */
|
||||
else if (!VEC_empty (tree, args)
|
||||
else if (!args->is_empty ()
|
||||
&& is_overloaded_fn (postfix_expression))
|
||||
{
|
||||
tree fn = get_first_fn (postfix_expression);
|
||||
|
@ -6154,14 +6142,14 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser,
|
|||
NON_CONSTANT_P is non-NULL, *NON_CONSTANT_P indicates whether or
|
||||
not all of the expressions in the list were constant. */
|
||||
|
||||
static VEC(tree,gc) *
|
||||
static vec<tree, va_gc> *
|
||||
cp_parser_parenthesized_expression_list (cp_parser* parser,
|
||||
int is_attribute_list,
|
||||
bool cast_p,
|
||||
bool allow_expansion_p,
|
||||
bool *non_constant_p)
|
||||
{
|
||||
VEC(tree,gc) *expression_list;
|
||||
vec<tree, va_gc> *expression_list;
|
||||
bool fold_expr_p = is_attribute_list != non_attr;
|
||||
tree identifier = NULL_TREE;
|
||||
bool saved_greater_than_is_operator_p;
|
||||
|
@ -6242,7 +6230,7 @@ cp_parser_parenthesized_expression_list (cp_parser* parser,
|
|||
expressions to the list, so that we can still tell if
|
||||
the correct form for a parenthesized expression-list
|
||||
is found. That gives better errors. */
|
||||
VEC_safe_push (tree, gc, expression_list, expr);
|
||||
vec_safe_push (expression_list, expr);
|
||||
|
||||
if (expr == error_mark_node)
|
||||
goto skip_comma;
|
||||
|
@ -6286,7 +6274,7 @@ cp_parser_parenthesized_expression_list (cp_parser* parser,
|
|||
= saved_greater_than_is_operator_p;
|
||||
|
||||
if (identifier)
|
||||
VEC_safe_insert (tree, gc, expression_list, 0, identifier);
|
||||
vec_safe_insert (expression_list, 0, identifier);
|
||||
|
||||
return expression_list;
|
||||
}
|
||||
|
@ -6725,9 +6713,9 @@ static tree
|
|||
cp_parser_new_expression (cp_parser* parser)
|
||||
{
|
||||
bool global_scope_p;
|
||||
VEC(tree,gc) *placement;
|
||||
vec<tree, va_gc> *placement;
|
||||
tree type;
|
||||
VEC(tree,gc) *initializer;
|
||||
vec<tree, va_gc> *initializer;
|
||||
tree nelts = NULL_TREE;
|
||||
tree ret;
|
||||
|
||||
|
@ -6819,10 +6807,10 @@ cp_parser_new_expression (cp_parser* parser)
|
|||
|
||||
Returns the same representation as for an expression-list. */
|
||||
|
||||
static VEC(tree,gc) *
|
||||
static vec<tree, va_gc> *
|
||||
cp_parser_new_placement (cp_parser* parser)
|
||||
{
|
||||
VEC(tree,gc) *expression_list;
|
||||
vec<tree, va_gc> *expression_list;
|
||||
|
||||
/* Parse the expression-list. */
|
||||
expression_list = (cp_parser_parenthesized_expression_list
|
||||
|
@ -7014,10 +7002,10 @@ cp_parser_direct_new_declarator (cp_parser* parser)
|
|||
|
||||
Returns a representation of the expression-list. */
|
||||
|
||||
static VEC(tree,gc) *
|
||||
static vec<tree, va_gc> *
|
||||
cp_parser_new_initializer (cp_parser* parser)
|
||||
{
|
||||
VEC(tree,gc) *expression_list;
|
||||
vec<tree, va_gc> *expression_list;
|
||||
|
||||
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
|
||||
{
|
||||
|
@ -8084,9 +8072,7 @@ typedef struct GTY(()) tree_int
|
|||
tree t;
|
||||
int i;
|
||||
} tree_int;
|
||||
DEF_VEC_O(tree_int);
|
||||
DEF_VEC_ALLOC_O(tree_int,gc);
|
||||
static GTY(()) VEC(tree_int,gc) *lambda_scope_stack;
|
||||
static GTY(()) vec<tree_int, va_gc> *lambda_scope_stack;
|
||||
|
||||
static void
|
||||
start_lambda_scope (tree decl)
|
||||
|
@ -8099,7 +8085,7 @@ start_lambda_scope (tree decl)
|
|||
decl = current_function_decl;
|
||||
ti.t = lambda_scope;
|
||||
ti.i = lambda_count;
|
||||
VEC_safe_push (tree_int, gc, lambda_scope_stack, ti);
|
||||
vec_safe_push (lambda_scope_stack, ti);
|
||||
if (lambda_scope != decl)
|
||||
{
|
||||
/* Don't reset the count if we're still in the same function. */
|
||||
|
@ -8118,13 +8104,13 @@ record_lambda_scope (tree lambda)
|
|||
static void
|
||||
finish_lambda_scope (void)
|
||||
{
|
||||
tree_int *p = &VEC_last (tree_int, lambda_scope_stack);
|
||||
tree_int *p = &lambda_scope_stack->last ();
|
||||
if (lambda_scope != p->t)
|
||||
{
|
||||
lambda_scope = p->t;
|
||||
lambda_count = p->i;
|
||||
}
|
||||
VEC_pop (tree_int, lambda_scope_stack);
|
||||
lambda_scope_stack->pop ();
|
||||
}
|
||||
|
||||
/* Parse a lambda expression.
|
||||
|
@ -9716,10 +9702,10 @@ cp_parser_perform_range_for_lookup (tree range, tree *begin, tree *end)
|
|||
else
|
||||
{
|
||||
/* Use global functions with ADL. */
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
vec = make_tree_vector ();
|
||||
|
||||
VEC_safe_push (tree, gc, vec, range);
|
||||
vec_safe_push (vec, range);
|
||||
|
||||
member_begin = perform_koenig_lookup (id_begin, vec,
|
||||
/*include_std=*/true,
|
||||
|
@ -9763,7 +9749,7 @@ static tree
|
|||
cp_parser_range_for_member_function (tree range, tree identifier)
|
||||
{
|
||||
tree member, res;
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
|
||||
member = finish_class_member_access_expr (range, identifier,
|
||||
false, tf_warning_or_error);
|
||||
|
@ -11671,7 +11657,7 @@ cp_parser_mem_initializer (cp_parser* parser)
|
|||
}
|
||||
else
|
||||
{
|
||||
VEC(tree,gc)* vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
vec = cp_parser_parenthesized_expression_list (parser, non_attr,
|
||||
/*cast_p=*/false,
|
||||
/*allow_expansion_p=*/true,
|
||||
|
@ -12566,7 +12552,7 @@ cp_parser_template_id (cp_parser *parser,
|
|||
tree template_id;
|
||||
cp_token_position start_of_id = 0;
|
||||
deferred_access_check *chk;
|
||||
VEC (deferred_access_check,gc) *access_check;
|
||||
vec<deferred_access_check, va_gc> *access_check;
|
||||
cp_token *next_token = NULL, *next_token_2 = NULL;
|
||||
bool is_identifier;
|
||||
|
||||
|
@ -12583,7 +12569,7 @@ cp_parser_template_id (cp_parser *parser,
|
|||
access_check = check_value->checks;
|
||||
if (access_check)
|
||||
{
|
||||
FOR_EACH_VEC_ELT (deferred_access_check, access_check, i, chk)
|
||||
FOR_EACH_VEC_ELT (*access_check, i, chk)
|
||||
perform_or_defer_access_check (chk->binfo,
|
||||
chk->decl,
|
||||
chk->diag_decl,
|
||||
|
@ -15664,7 +15650,7 @@ cp_parser_asm_definition (cp_parser* parser)
|
|||
static tree
|
||||
cp_parser_init_declarator (cp_parser* parser,
|
||||
cp_decl_specifier_seq *decl_specifiers,
|
||||
VEC (deferred_access_check,gc)* checks,
|
||||
vec<deferred_access_check, va_gc> *checks,
|
||||
bool function_definition_allowed_p,
|
||||
bool member_p,
|
||||
int declares_class_or_enum,
|
||||
|
@ -17744,7 +17730,7 @@ cp_parser_initializer (cp_parser* parser, bool* is_direct_init,
|
|||
}
|
||||
else if (token->type == CPP_OPEN_PAREN)
|
||||
{
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
vec = cp_parser_parenthesized_expression_list (parser, non_attr,
|
||||
/*cast_p=*/false,
|
||||
/*allow_expansion_p=*/true,
|
||||
|
@ -17861,15 +17847,15 @@ cp_parser_braced_list (cp_parser* parser, bool* non_constant_p)
|
|||
identifier :
|
||||
[ constant-expression ] =
|
||||
|
||||
Returns a VEC of constructor_elt. The VALUE of each elt is an expression
|
||||
Returns a vec of constructor_elt. The VALUE of each elt is an expression
|
||||
for the initializer. If the INDEX of the elt is non-NULL, it is the
|
||||
IDENTIFIER_NODE naming the field to initialize. NON_CONSTANT_P is
|
||||
as for cp_parser_initializer. */
|
||||
|
||||
static VEC(constructor_elt,gc) *
|
||||
static vec<constructor_elt, va_gc> *
|
||||
cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = NULL;
|
||||
vec<constructor_elt, va_gc> *v = NULL;
|
||||
|
||||
/* Assume all of the expressions are constant. */
|
||||
*non_constant_p = false;
|
||||
|
@ -18370,8 +18356,7 @@ cp_parser_class_specifier_1 (cp_parser* parser)
|
|||
};
|
||||
|
||||
*/
|
||||
FOR_EACH_VEC_ELT (cp_default_arg_entry, unparsed_funs_with_default_args,
|
||||
ix, e)
|
||||
FOR_EACH_VEC_SAFE_ELT (unparsed_funs_with_default_args, ix, e)
|
||||
{
|
||||
decl = e->decl;
|
||||
/* If there are default arguments that have not yet been processed,
|
||||
|
@ -18390,11 +18375,11 @@ cp_parser_class_specifier_1 (cp_parser* parser)
|
|||
/* Remove any template parameters from the symbol table. */
|
||||
maybe_end_member_template_processing ();
|
||||
}
|
||||
VEC_truncate (cp_default_arg_entry, unparsed_funs_with_default_args, 0);
|
||||
vec_safe_truncate (unparsed_funs_with_default_args, 0);
|
||||
/* Now parse any NSDMIs. */
|
||||
save_ccp = current_class_ptr;
|
||||
save_ccr = current_class_ref;
|
||||
FOR_EACH_VEC_ELT (tree, unparsed_nsdmis, ix, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT (unparsed_nsdmis, ix, decl)
|
||||
{
|
||||
if (class_type != DECL_CONTEXT (decl))
|
||||
{
|
||||
|
@ -18406,15 +18391,15 @@ cp_parser_class_specifier_1 (cp_parser* parser)
|
|||
inject_this_parameter (class_type, TYPE_UNQUALIFIED);
|
||||
cp_parser_late_parsing_nsdmi (parser, decl);
|
||||
}
|
||||
VEC_truncate (tree, unparsed_nsdmis, 0);
|
||||
vec_safe_truncate (unparsed_nsdmis, 0);
|
||||
current_class_ptr = save_ccp;
|
||||
current_class_ref = save_ccr;
|
||||
if (pushed_scope)
|
||||
pop_scope (pushed_scope);
|
||||
/* Now parse the body of the functions. */
|
||||
FOR_EACH_VEC_ELT (tree, unparsed_funs_with_definitions, ix, decl)
|
||||
FOR_EACH_VEC_SAFE_ELT (unparsed_funs_with_definitions, ix, decl)
|
||||
cp_parser_late_parsing_for_member (parser, decl);
|
||||
VEC_truncate (tree, unparsed_funs_with_definitions, 0);
|
||||
vec_safe_truncate (unparsed_funs_with_definitions, 0);
|
||||
}
|
||||
|
||||
/* Put back any saved access checks. */
|
||||
|
@ -19453,7 +19438,7 @@ cp_parser_member_declaration (cp_parser* parser)
|
|||
&& !DECL_C_BIT_FIELD (decl)
|
||||
&& DECL_INITIAL (decl))
|
||||
/* Add DECL to the queue of NSDMI to be parsed later. */
|
||||
VEC_safe_push (tree, gc, unparsed_nsdmis, decl);
|
||||
vec_safe_push (unparsed_nsdmis, decl);
|
||||
}
|
||||
|
||||
if (assume_semicolon)
|
||||
|
@ -20503,7 +20488,7 @@ cp_parser_gnu_attribute_list (cp_parser* parser)
|
|||
/* If it's an `(', then parse the attribute arguments. */
|
||||
if (token->type == CPP_OPEN_PAREN)
|
||||
{
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
int attr_flag = (attribute_takes_identifier_p (identifier)
|
||||
? id_attr : normal_attr);
|
||||
vec = cp_parser_parenthesized_expression_list
|
||||
|
@ -20640,7 +20625,7 @@ cp_parser_std_attribute (cp_parser *parser)
|
|||
return attribute;
|
||||
|
||||
{
|
||||
VEC(tree, gc) *vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
int attr_flag = normal_attr;
|
||||
|
||||
if (attr_ns == get_identifier ("gnu")
|
||||
|
@ -21672,7 +21657,7 @@ static void
|
|||
cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p)
|
||||
{
|
||||
tree decl = NULL_TREE;
|
||||
VEC (deferred_access_check,gc) *checks;
|
||||
vec<deferred_access_check, va_gc> *checks;
|
||||
tree parameter_list;
|
||||
bool friend_p = false;
|
||||
bool need_lang_pop;
|
||||
|
@ -21824,7 +21809,7 @@ cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p)
|
|||
if (member_p && decl
|
||||
&& (TREE_CODE (decl) == FUNCTION_DECL
|
||||
|| DECL_FUNCTION_TEMPLATE_P (decl)))
|
||||
VEC_safe_push (tree, gc, unparsed_funs_with_definitions, decl);
|
||||
vec_safe_push (unparsed_funs_with_definitions, decl);
|
||||
}
|
||||
|
||||
/* Perform the deferred access checks from a template-parameter-list.
|
||||
|
@ -21832,7 +21817,7 @@ cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p)
|
|||
get_deferred_access_checks. */
|
||||
|
||||
static void
|
||||
cp_parser_perform_template_parameter_access_checks (VEC (deferred_access_check,gc)* checks)
|
||||
cp_parser_perform_template_parameter_access_checks (vec<deferred_access_check, va_gc> *checks)
|
||||
{
|
||||
++processing_template_parmlist;
|
||||
perform_access_checks (checks, tf_warning_or_error);
|
||||
|
@ -21848,7 +21833,7 @@ cp_parser_perform_template_parameter_access_checks (VEC (deferred_access_check,g
|
|||
|
||||
static tree
|
||||
cp_parser_single_declaration (cp_parser* parser,
|
||||
VEC (deferred_access_check,gc)* checks,
|
||||
vec<deferred_access_check, va_gc> *checks,
|
||||
bool member_p,
|
||||
bool explicit_specialization_p,
|
||||
bool* friend_p)
|
||||
|
@ -21999,7 +21984,7 @@ cp_parser_simple_cast_expression (cp_parser *parser)
|
|||
static tree
|
||||
cp_parser_functional_cast (cp_parser* parser, tree type)
|
||||
{
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
tree expression_list;
|
||||
tree cast;
|
||||
bool nonconst_p;
|
||||
|
@ -22108,7 +22093,7 @@ cp_parser_save_member_function_body (cp_parser* parser,
|
|||
DECL_INITIALIZED_IN_CLASS_P (fn) = 1;
|
||||
|
||||
/* Add FN to the queue of functions to be parsed later. */
|
||||
VEC_safe_push (tree, gc, unparsed_funs_with_definitions, fn);
|
||||
vec_safe_push (unparsed_funs_with_definitions, fn);
|
||||
|
||||
return fn;
|
||||
}
|
||||
|
@ -22319,8 +22304,7 @@ cp_parser_save_default_args (cp_parser* parser, tree decl)
|
|||
if (TREE_PURPOSE (probe))
|
||||
{
|
||||
cp_default_arg_entry entry = {current_class_type, decl};
|
||||
VEC_safe_push (cp_default_arg_entry, gc,
|
||||
unparsed_funs_with_default_args, entry);
|
||||
vec_safe_push (unparsed_funs_with_default_args, entry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -22440,7 +22424,7 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
|
|||
{
|
||||
tree default_arg = TREE_PURPOSE (parm);
|
||||
tree parsed_arg;
|
||||
VEC(tree,gc) *insts;
|
||||
vec<tree, va_gc> *insts;
|
||||
tree copy;
|
||||
unsigned ix;
|
||||
|
||||
|
@ -22465,7 +22449,7 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
|
|||
|
||||
/* Update any instantiations we've already created. */
|
||||
for (insts = DEFARG_INSTANTIATIONS (default_arg), ix = 0;
|
||||
VEC_iterate (tree, insts, ix, copy); ix++)
|
||||
vec_safe_iterate (insts, ix, ©); ix++)
|
||||
TREE_PURPOSE (copy) = parsed_arg;
|
||||
}
|
||||
|
||||
|
@ -23298,7 +23282,7 @@ cp_parser_pre_parsed_nested_name_specifier (cp_parser *parser)
|
|||
int i;
|
||||
struct tree_check *check_value;
|
||||
deferred_access_check *chk;
|
||||
VEC (deferred_access_check,gc) *checks;
|
||||
vec<deferred_access_check, va_gc> *checks;
|
||||
|
||||
/* Get the stored value. */
|
||||
check_value = cp_lexer_consume_token (parser->lexer)->u.tree_check_value;
|
||||
|
@ -23306,7 +23290,7 @@ cp_parser_pre_parsed_nested_name_specifier (cp_parser *parser)
|
|||
checks = check_value->checks;
|
||||
if (checks)
|
||||
{
|
||||
FOR_EACH_VEC_ELT (deferred_access_check, checks, i, chk)
|
||||
FOR_EACH_VEC_SAFE_ELT (checks, i, chk)
|
||||
perform_or_defer_access_check (chk->binfo,
|
||||
chk->decl,
|
||||
chk->diag_decl, tf_warning_or_error);
|
||||
|
@ -26875,7 +26859,7 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
|
|||
location_t loc_first;
|
||||
bool collapse_err = false;
|
||||
int i, collapse = 1, nbraces = 0;
|
||||
VEC(tree,gc) *for_block = make_tree_vector ();
|
||||
vec<tree, va_gc> *for_block = make_tree_vector ();
|
||||
|
||||
for (cl = clauses; cl; cl = OMP_CLAUSE_CHAIN (cl))
|
||||
if (OMP_CLAUSE_CODE (cl) == OMP_CLAUSE_COLLAPSE)
|
||||
|
@ -26994,7 +26978,7 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
|
|||
LOOKUP_ONLYCONVERTING);
|
||||
if (CLASS_TYPE_P (TREE_TYPE (decl)))
|
||||
{
|
||||
VEC_safe_push (tree, gc, for_block, this_pre_body);
|
||||
vec_safe_push (for_block, this_pre_body);
|
||||
init = NULL_TREE;
|
||||
}
|
||||
else
|
||||
|
@ -27252,8 +27236,8 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
|
|||
}
|
||||
}
|
||||
|
||||
while (!VEC_empty (tree, for_block))
|
||||
add_stmt (pop_stmt_list (VEC_pop (tree, for_block)));
|
||||
while (!for_block->is_empty ())
|
||||
add_stmt (pop_stmt_list (for_block->pop ()));
|
||||
release_tree_vector (for_block);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -30,7 +30,7 @@ struct GTY(()) tree_check {
|
|||
/* The value associated with the token. */
|
||||
tree value;
|
||||
/* The checks that have been associated with value. */
|
||||
VEC (deferred_access_check, gc)* checks;
|
||||
vec<deferred_access_check, va_gc> *checks;
|
||||
/* The token's qualifying scope (used when it is a
|
||||
CPP_NESTED_NAME_SPECIFIER). */
|
||||
tree qualifying_scope;
|
||||
|
@ -69,14 +69,9 @@ typedef struct GTY (()) cp_token {
|
|||
} GTY((desc ("(%1.type == CPP_TEMPLATE_ID) || (%1.type == CPP_NESTED_NAME_SPECIFIER)"))) u;
|
||||
} cp_token;
|
||||
|
||||
DEF_VEC_O (cp_token);
|
||||
DEF_VEC_ALLOC_O (cp_token,gc);
|
||||
DEF_VEC_ALLOC_O (cp_token,heap);
|
||||
|
||||
/* We use a stack of token pointer for saving token sets. */
|
||||
typedef struct cp_token *cp_token_position;
|
||||
DEF_VEC_P (cp_token_position);
|
||||
DEF_VEC_ALLOC_P (cp_token_position,heap);
|
||||
|
||||
/* The cp_lexer structure represents the C++ lexer. It is responsible
|
||||
for managing the token stream from the preprocessor and supplying
|
||||
|
@ -86,7 +81,7 @@ DEF_VEC_ALLOC_P (cp_token_position,heap);
|
|||
typedef struct GTY (()) cp_lexer {
|
||||
/* The memory allocated for the buffer. NULL if this lexer does not
|
||||
own the token buffer. */
|
||||
VEC(cp_token,gc) *buffer;
|
||||
vec<cp_token, va_gc> *buffer;
|
||||
|
||||
/* A pointer just past the last available token. The tokens
|
||||
in this lexer are [buffer, last_token). */
|
||||
|
@ -100,7 +95,7 @@ typedef struct GTY (()) cp_lexer {
|
|||
called. The top entry is the most recent position at which we
|
||||
began saving tokens. If the stack is non-empty, we are saving
|
||||
tokens. */
|
||||
VEC(cp_token_position,heap) *GTY ((skip)) saved_tokens;
|
||||
vec<cp_token_position> GTY ((skip)) saved_tokens;
|
||||
|
||||
/* The next lexer in a linked list of lexers. */
|
||||
struct cp_lexer *next;
|
||||
|
@ -113,8 +108,6 @@ typedef struct GTY (()) cp_lexer {
|
|||
bool in_pragma;
|
||||
} cp_lexer;
|
||||
|
||||
DEF_VEC_O (cp_lexer);
|
||||
DEF_VEC_ALLOC_O (cp_lexer,heap);
|
||||
|
||||
/* cp_token_cache is a range of tokens. There is no need to represent
|
||||
allocate heap memory for it, since tokens are never removed from the
|
||||
|
@ -131,8 +124,6 @@ typedef struct GTY(()) cp_token_cache {
|
|||
} cp_token_cache;
|
||||
|
||||
typedef cp_token_cache *cp_token_cache_ptr;
|
||||
DEF_VEC_P (cp_token_cache_ptr);
|
||||
DEF_VEC_ALLOC_P (cp_token_cache_ptr,gc);
|
||||
|
||||
struct cp_token_ident_d
|
||||
{
|
||||
|
@ -156,27 +147,23 @@ typedef struct GTY(()) cp_default_arg_entry_d {
|
|||
tree decl;
|
||||
} cp_default_arg_entry;
|
||||
|
||||
DEF_VEC_O(cp_default_arg_entry);
|
||||
DEF_VEC_ALLOC_O(cp_default_arg_entry,gc);
|
||||
|
||||
/* An entry in a stack for member functions of local classes. */
|
||||
|
||||
typedef struct GTY(()) cp_unparsed_functions_entry_d {
|
||||
/* Functions with default arguments that require post-processing.
|
||||
Functions appear in this list in declaration order. */
|
||||
VEC(cp_default_arg_entry,gc) *funs_with_default_args;
|
||||
vec<cp_default_arg_entry, va_gc> *funs_with_default_args;
|
||||
|
||||
/* Functions with defintions that require post-processing. Functions
|
||||
appear in this list in declaration order. */
|
||||
VEC(tree,gc) *funs_with_definitions;
|
||||
vec<tree, va_gc> *funs_with_definitions;
|
||||
|
||||
/* Non-static data members with initializers that require post-processing.
|
||||
FIELD_DECLs appear in this list in declaration order. */
|
||||
VEC(tree,gc) *nsdmis;
|
||||
vec<tree, va_gc> *nsdmis;
|
||||
} cp_unparsed_functions_entry;
|
||||
|
||||
DEF_VEC_O(cp_unparsed_functions_entry);
|
||||
DEF_VEC_ALLOC_O(cp_unparsed_functions_entry,gc);
|
||||
|
||||
/* The status of a tentative parse. */
|
||||
|
||||
|
@ -344,7 +331,7 @@ typedef struct GTY(()) cp_parser {
|
|||
/* A stack used for member functions of local classes. The lists
|
||||
contained in an individual entry can only be processed once the
|
||||
outermost class being defined is complete. */
|
||||
VEC(cp_unparsed_functions_entry,gc) *unparsed_queues;
|
||||
vec<cp_unparsed_functions_entry, va_gc> *unparsed_queues;
|
||||
|
||||
/* The number of classes whose definitions are currently in
|
||||
progress. */
|
||||
|
@ -356,7 +343,7 @@ typedef struct GTY(()) cp_parser {
|
|||
} cp_parser;
|
||||
|
||||
/* In parser.c */
|
||||
extern void cp_lexer_debug_tokens (VEC(cp_token,gc) *);
|
||||
extern void cp_lexer_debug_tokens (vec<cp_token, va_gc> *);
|
||||
extern void cp_debug_parser (FILE *, cp_parser *);
|
||||
|
||||
#endif /* GCC_CP_PARSER_H */
|
||||
|
|
99
gcc/cp/pt.c
99
gcc/cp/pt.c
|
@ -43,7 +43,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "toplev.h"
|
||||
#include "timevar.h"
|
||||
#include "tree-iterator.h"
|
||||
#include "vecprim.h"
|
||||
|
||||
/* The type of functions taking a tree, and some additional data, and
|
||||
returning an int. */
|
||||
|
@ -64,7 +63,7 @@ int processing_template_parmlist;
|
|||
static int template_header_count;
|
||||
|
||||
static GTY(()) tree saved_trees;
|
||||
static VEC(int,heap) *inline_parm_levels;
|
||||
static vec<int> inline_parm_levels;
|
||||
|
||||
static GTY(()) struct tinst_level *current_tinst_level;
|
||||
|
||||
|
@ -100,7 +99,7 @@ static GTY ((param_is (spec_entry)))
|
|||
the TEMPLATE_TYPE_IDX of the template parameter. Each element is a
|
||||
TREE_LIST, whose TREE_VALUEs contain the canonical template
|
||||
parameters of various types and levels. */
|
||||
static GTY(()) VEC(tree,gc) *canonical_template_parms;
|
||||
static GTY(()) vec<tree, va_gc> *canonical_template_parms;
|
||||
|
||||
#define UNIFY_ALLOW_NONE 0
|
||||
#define UNIFY_ALLOW_MORE_CV_QUAL 1
|
||||
|
@ -473,7 +472,7 @@ maybe_begin_member_template_processing (tree decl)
|
|||
|
||||
/* Remember how many levels of template parameters we pushed so that
|
||||
we can pop them later. */
|
||||
VEC_safe_push (int, heap, inline_parm_levels, levels);
|
||||
inline_parm_levels.safe_push (levels);
|
||||
}
|
||||
|
||||
/* Undo the effects of maybe_begin_member_template_processing. */
|
||||
|
@ -484,10 +483,10 @@ maybe_end_member_template_processing (void)
|
|||
int i;
|
||||
int last;
|
||||
|
||||
if (VEC_length (int, inline_parm_levels) == 0)
|
||||
if (inline_parm_levels.length () == 0)
|
||||
return;
|
||||
|
||||
last = VEC_pop (int, inline_parm_levels);
|
||||
last = inline_parm_levels.pop ();
|
||||
for (i = 0; i < last; ++i)
|
||||
{
|
||||
--processing_template_decl;
|
||||
|
@ -1018,7 +1017,7 @@ retrieve_specialization (tree tmpl, tree args, hashval_t hash)
|
|||
{
|
||||
tree class_template;
|
||||
tree class_specialization;
|
||||
VEC(tree,gc) *methods;
|
||||
vec<tree, va_gc> *methods;
|
||||
tree fns;
|
||||
int idx;
|
||||
|
||||
|
@ -1038,7 +1037,7 @@ retrieve_specialization (tree tmpl, tree args, hashval_t hash)
|
|||
/* Iterate through the methods with the indicated name, looking
|
||||
for the one that has an instance of TMPL. */
|
||||
methods = CLASSTYPE_METHOD_VEC (class_specialization);
|
||||
for (fns = VEC_index (tree, methods, idx); fns; fns = OVL_NEXT (fns))
|
||||
for (fns = (*methods)[idx]; fns; fns = OVL_NEXT (fns))
|
||||
{
|
||||
tree fn = OVL_CURRENT (fns);
|
||||
if (DECL_TEMPLATE_INFO (fn) && DECL_TI_TEMPLATE (fn) == tmpl
|
||||
|
@ -2548,11 +2547,11 @@ check_explicit_specialization (tree declarator,
|
|||
{
|
||||
idx = lookup_fnfields_1 (ctype, name);
|
||||
if (idx >= 0)
|
||||
fns = VEC_index (tree, CLASSTYPE_METHOD_VEC (ctype), idx);
|
||||
fns = (*CLASSTYPE_METHOD_VEC (ctype))[idx];
|
||||
}
|
||||
else
|
||||
{
|
||||
VEC(tree,gc) *methods;
|
||||
vec<tree, va_gc> *methods;
|
||||
tree ovl;
|
||||
|
||||
/* For a type-conversion operator, we cannot do a
|
||||
|
@ -2565,7 +2564,7 @@ check_explicit_specialization (tree declarator,
|
|||
methods = CLASSTYPE_METHOD_VEC (ctype);
|
||||
if (methods)
|
||||
for (idx = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
VEC_iterate (tree, methods, idx, ovl);
|
||||
methods->iterate (idx, &ovl);
|
||||
++idx)
|
||||
{
|
||||
if (!DECL_CONV_FN_P (OVL_CURRENT (ovl)))
|
||||
|
@ -3513,12 +3512,12 @@ canonical_type_parameter (tree type)
|
|||
tree list;
|
||||
int idx = TEMPLATE_TYPE_IDX (type);
|
||||
if (!canonical_template_parms)
|
||||
canonical_template_parms = VEC_alloc (tree, gc, idx+1);
|
||||
vec_alloc (canonical_template_parms, idx+1);
|
||||
|
||||
while (VEC_length (tree, canonical_template_parms) <= (unsigned)idx)
|
||||
VEC_safe_push (tree, gc, canonical_template_parms, NULL_TREE);
|
||||
while (canonical_template_parms->length () <= (unsigned)idx)
|
||||
vec_safe_push (canonical_template_parms, NULL_TREE);
|
||||
|
||||
list = VEC_index (tree, canonical_template_parms, idx);
|
||||
list = (*canonical_template_parms)[idx];
|
||||
while (list && !comptypes (type, TREE_VALUE (list), COMPARE_STRUCTURAL))
|
||||
list = TREE_CHAIN (list);
|
||||
|
||||
|
@ -3526,9 +3525,9 @@ canonical_type_parameter (tree type)
|
|||
return TREE_VALUE (list);
|
||||
else
|
||||
{
|
||||
VEC_replace(tree, canonical_template_parms, idx,
|
||||
tree_cons (NULL_TREE, type,
|
||||
VEC_index (tree, canonical_template_parms, idx)));
|
||||
(*canonical_template_parms)[idx]
|
||||
= tree_cons (NULL_TREE, type,
|
||||
(*canonical_template_parms)[idx]);
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
@ -8457,7 +8456,7 @@ static void
|
|||
perform_typedefs_access_check (tree tmpl, tree targs)
|
||||
{
|
||||
location_t saved_location;
|
||||
int i;
|
||||
unsigned i;
|
||||
qualified_typedef_usage_t *iter;
|
||||
|
||||
if (!tmpl
|
||||
|
@ -8466,9 +8465,7 @@ perform_typedefs_access_check (tree tmpl, tree targs)
|
|||
return;
|
||||
|
||||
saved_location = input_location;
|
||||
FOR_EACH_VEC_ELT (qualified_typedef_usage_t,
|
||||
get_types_needing_access_check (tmpl),
|
||||
i, iter)
|
||||
FOR_EACH_VEC_SAFE_ELT (get_types_needing_access_check (tmpl), i, iter)
|
||||
{
|
||||
tree type_decl = iter->typedef_decl;
|
||||
tree type_scope = iter->context;
|
||||
|
@ -10729,8 +10726,7 @@ tsubst_arg_types (tree arg_types,
|
|||
argument in a call of this function. */
|
||||
remaining_arg_types =
|
||||
tree_cons (default_arg, type, remaining_arg_types);
|
||||
VEC_safe_push (tree, gc, DEFARG_INSTANTIATIONS (default_arg),
|
||||
remaining_arg_types);
|
||||
vec_safe_push (DEFARG_INSTANTIATIONS(default_arg), remaining_arg_types);
|
||||
}
|
||||
else
|
||||
remaining_arg_types =
|
||||
|
@ -13626,8 +13622,8 @@ tsubst_copy_and_build (tree t,
|
|||
{
|
||||
tree placement = RECUR (TREE_OPERAND (t, 0));
|
||||
tree init = RECUR (TREE_OPERAND (t, 3));
|
||||
VEC(tree,gc) *placement_vec;
|
||||
VEC(tree,gc) *init_vec;
|
||||
vec<tree, va_gc> *placement_vec;
|
||||
vec<tree, va_gc> *init_vec;
|
||||
tree ret;
|
||||
|
||||
if (placement == NULL_TREE)
|
||||
|
@ -13636,7 +13632,7 @@ tsubst_copy_and_build (tree t,
|
|||
{
|
||||
placement_vec = make_tree_vector ();
|
||||
for (; placement != NULL_TREE; placement = TREE_CHAIN (placement))
|
||||
VEC_safe_push (tree, gc, placement_vec, TREE_VALUE (placement));
|
||||
vec_safe_push (placement_vec, TREE_VALUE (placement));
|
||||
}
|
||||
|
||||
/* If there was an initializer in the original tree, but it
|
||||
|
@ -13655,7 +13651,7 @@ tsubst_copy_and_build (tree t,
|
|||
else
|
||||
{
|
||||
for (; init != NULL_TREE; init = TREE_CHAIN (init))
|
||||
VEC_safe_push (tree, gc, init_vec, TREE_VALUE (init));
|
||||
vec_safe_push (init_vec, TREE_VALUE (init));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13691,7 +13687,7 @@ tsubst_copy_and_build (tree t,
|
|||
case CALL_EXPR:
|
||||
{
|
||||
tree function;
|
||||
VEC(tree,gc) *call_args;
|
||||
vec<tree, va_gc> *call_args;
|
||||
unsigned int nargs, i;
|
||||
bool qualified_p;
|
||||
bool koenig_p;
|
||||
|
@ -13751,8 +13747,7 @@ tsubst_copy_and_build (tree t,
|
|||
tree arg = CALL_EXPR_ARG (t, i);
|
||||
|
||||
if (!PACK_EXPANSION_P (arg))
|
||||
VEC_safe_push (tree, gc, call_args,
|
||||
RECUR (CALL_EXPR_ARG (t, i)));
|
||||
vec_safe_push (call_args, RECUR (CALL_EXPR_ARG (t, i)));
|
||||
else
|
||||
{
|
||||
/* Expand the pack expansion and push each entry onto
|
||||
|
@ -13768,13 +13763,13 @@ tsubst_copy_and_build (tree t,
|
|||
tree value = TREE_VEC_ELT (arg, j);
|
||||
if (value != NULL_TREE)
|
||||
value = convert_from_reference (value);
|
||||
VEC_safe_push (tree, gc, call_args, value);
|
||||
vec_safe_push (call_args, value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A partial substitution. Add one entry. */
|
||||
VEC_safe_push (tree, gc, call_args, arg);
|
||||
vec_safe_push (call_args, arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14123,7 +14118,7 @@ tsubst_copy_and_build (tree t,
|
|||
|
||||
case CONSTRUCTOR:
|
||||
{
|
||||
VEC(constructor_elt,gc) *n;
|
||||
vec<constructor_elt, va_gc> *n;
|
||||
constructor_elt *ce;
|
||||
unsigned HOST_WIDE_INT idx;
|
||||
tree type = tsubst (TREE_TYPE (t), args, complain, in_decl);
|
||||
|
@ -14144,9 +14139,9 @@ tsubst_copy_and_build (tree t,
|
|||
looked up by digest_init. */
|
||||
process_index_p = !(type && MAYBE_CLASS_TYPE_P (type));
|
||||
|
||||
n = VEC_copy (constructor_elt, gc, CONSTRUCTOR_ELTS (t));
|
||||
newlen = VEC_length (constructor_elt, n);
|
||||
FOR_EACH_VEC_ELT (constructor_elt, n, idx, ce)
|
||||
n = vec_safe_copy (CONSTRUCTOR_ELTS (t));
|
||||
newlen = vec_safe_length (n);
|
||||
FOR_EACH_VEC_SAFE_ELT (n, idx, ce)
|
||||
{
|
||||
if (ce->index && process_index_p)
|
||||
ce->index = RECUR (ce->index);
|
||||
|
@ -14178,10 +14173,10 @@ tsubst_copy_and_build (tree t,
|
|||
|
||||
if (need_copy_p)
|
||||
{
|
||||
VEC(constructor_elt,gc) *old_n = n;
|
||||
vec<constructor_elt, va_gc> *old_n = n;
|
||||
|
||||
n = VEC_alloc (constructor_elt, gc, newlen);
|
||||
FOR_EACH_VEC_ELT (constructor_elt, old_n, idx, ce)
|
||||
vec_alloc (n, newlen);
|
||||
FOR_EACH_VEC_ELT (*old_n, idx, ce)
|
||||
{
|
||||
if (TREE_CODE (ce->value) == TREE_VEC)
|
||||
{
|
||||
|
@ -19791,12 +19786,12 @@ type_dependent_expression_p_push (tree expr)
|
|||
/* Returns TRUE if ARGS contains a type-dependent expression. */
|
||||
|
||||
bool
|
||||
any_type_dependent_arguments_p (const VEC(tree,gc) *args)
|
||||
any_type_dependent_arguments_p (const vec<tree, va_gc> *args)
|
||||
{
|
||||
unsigned int i;
|
||||
tree arg;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, args, i, arg)
|
||||
FOR_EACH_VEC_SAFE_ELT (args, i, arg)
|
||||
{
|
||||
if (type_dependent_expression_p (arg))
|
||||
return true;
|
||||
|
@ -20249,16 +20244,16 @@ build_non_dependent_expr (tree expr)
|
|||
This modifies ARGS in place. */
|
||||
|
||||
void
|
||||
make_args_non_dependent (VEC(tree,gc) *args)
|
||||
make_args_non_dependent (vec<tree, va_gc> *args)
|
||||
{
|
||||
unsigned int ix;
|
||||
tree arg;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, args, ix, arg)
|
||||
FOR_EACH_VEC_SAFE_ELT (args, ix, arg)
|
||||
{
|
||||
tree newarg = build_non_dependent_expr (arg);
|
||||
if (newarg != arg)
|
||||
VEC_replace (tree, args, ix, newarg);
|
||||
(*args)[ix] = newarg;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20459,11 +20454,11 @@ type_uses_auto (tree type)
|
|||
Those typedefs were added to T by the function
|
||||
append_type_to_template_for_access_check. */
|
||||
|
||||
VEC(qualified_typedef_usage_t,gc)*
|
||||
vec<qualified_typedef_usage_t, va_gc> *
|
||||
get_types_needing_access_check (tree t)
|
||||
{
|
||||
tree ti;
|
||||
VEC(qualified_typedef_usage_t,gc) *result = NULL;
|
||||
vec<qualified_typedef_usage_t, va_gc> *result = NULL;
|
||||
|
||||
if (!t || t == error_mark_node)
|
||||
return NULL;
|
||||
|
@ -20521,9 +20516,7 @@ append_type_to_template_for_access_check_1 (tree t,
|
|||
typedef_usage.context = scope;
|
||||
typedef_usage.locus = location;
|
||||
|
||||
VEC_safe_push (qualified_typedef_usage_t, gc,
|
||||
TI_TYPEDEFS_NEEDING_ACCESS_CHECKING (ti),
|
||||
typedef_usage);
|
||||
vec_safe_push (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING (ti), typedef_usage);
|
||||
}
|
||||
|
||||
/* Append TYPE_DECL to the template TEMPL.
|
||||
|
@ -20562,14 +20555,12 @@ append_type_to_template_for_access_check (tree templ,
|
|||
location_t location)
|
||||
{
|
||||
qualified_typedef_usage_t *iter;
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
gcc_assert (type_decl && (TREE_CODE (type_decl) == TYPE_DECL));
|
||||
|
||||
/* Make sure we don't append the type to the template twice. */
|
||||
FOR_EACH_VEC_ELT (qualified_typedef_usage_t,
|
||||
get_types_needing_access_check (templ),
|
||||
i, iter)
|
||||
FOR_EACH_VEC_SAFE_ELT (get_types_needing_access_check (templ), i, iter)
|
||||
if (iter->typedef_decl == type_decl && scope == iter->context)
|
||||
return;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ static FILE *open_repo_file (const char *);
|
|||
static char *afgets (FILE *);
|
||||
static FILE *reopen_repo_file_for_write (void);
|
||||
|
||||
static GTY(()) VEC(tree,gc) *pending_repo;
|
||||
static GTY(()) vec<tree, va_gc> *pending_repo;
|
||||
static char *repo_name;
|
||||
|
||||
static const char *old_args, *old_dir, *old_main;
|
||||
|
@ -268,7 +268,7 @@ finish_repo (void)
|
|||
fprintf (repo_file, "\n");
|
||||
}
|
||||
|
||||
FOR_EACH_VEC_ELT_REVERSE (tree, pending_repo, ix, val)
|
||||
FOR_EACH_VEC_SAFE_ELT_REVERSE (pending_repo, ix, val)
|
||||
{
|
||||
tree name = DECL_ASSEMBLER_NAME (val);
|
||||
char type = IDENTIFIER_REPO_CHOSEN (name) ? 'C' : 'O';
|
||||
|
@ -353,7 +353,7 @@ repo_emit_p (tree decl)
|
|||
if (!DECL_REPO_AVAILABLE_P (decl))
|
||||
{
|
||||
DECL_REPO_AVAILABLE_P (decl) = 1;
|
||||
VEC_safe_push (tree, gc, pending_repo, decl);
|
||||
vec_safe_push (pending_repo, decl);
|
||||
}
|
||||
|
||||
return IDENTIFIER_REPO_CHOSEN (DECL_ASSEMBLER_NAME (decl)) ? 1 : ret;
|
||||
|
|
|
@ -72,8 +72,6 @@ typedef struct GTY (()) tinfo_s {
|
|||
the type_info derived type. */
|
||||
} tinfo_s;
|
||||
|
||||
DEF_VEC_O(tinfo_s);
|
||||
DEF_VEC_ALLOC_O(tinfo_s,gc);
|
||||
|
||||
typedef enum tinfo_kind
|
||||
{
|
||||
|
@ -92,12 +90,12 @@ typedef enum tinfo_kind
|
|||
} tinfo_kind;
|
||||
|
||||
/* A vector of all tinfo decls that haven't yet been emitted. */
|
||||
VEC(tree,gc) *unemitted_tinfo_decls;
|
||||
vec<tree, va_gc> *unemitted_tinfo_decls;
|
||||
|
||||
/* A vector of all type_info derived types we need. The first few are
|
||||
fixed and created early. The remainder are for multiple inheritance
|
||||
and are generated as needed. */
|
||||
static GTY (()) VEC(tinfo_s,gc) *tinfo_descs;
|
||||
static GTY (()) vec<tinfo_s, va_gc> *tinfo_descs;
|
||||
|
||||
static tree ifnonnull (tree, tree, tsubst_flags_t);
|
||||
static tree tinfo_name (tree, bool);
|
||||
|
@ -155,7 +153,7 @@ init_rtti_processing (void)
|
|||
= cp_build_qualified_type (type_info_type, TYPE_QUAL_CONST);
|
||||
type_info_ptr_type = build_pointer_type (const_type_info_type_node);
|
||||
|
||||
unemitted_tinfo_decls = VEC_alloc (tree, gc, 124);
|
||||
vec_alloc (unemitted_tinfo_decls, 124);
|
||||
|
||||
create_tinfo_types ();
|
||||
}
|
||||
|
@ -294,8 +292,7 @@ typeid_ok_p (void)
|
|||
return false;
|
||||
}
|
||||
|
||||
pseudo_type_info
|
||||
= VEC_index (tinfo_s, tinfo_descs, TK_TYPE_INFO_TYPE).type;
|
||||
pseudo_type_info = (*tinfo_descs)[TK_TYPE_INFO_TYPE].type;
|
||||
type_info_type = TYPE_MAIN_VARIANT (const_type_info_type_node);
|
||||
|
||||
/* Make sure abi::__type_info_pseudo has the same alias set
|
||||
|
@ -422,7 +419,7 @@ get_tinfo_decl (tree type)
|
|||
if (!d)
|
||||
{
|
||||
int ix = get_pseudo_ti_index (type);
|
||||
tinfo_s *ti = &VEC_index (tinfo_s, tinfo_descs, ix);
|
||||
tinfo_s *ti = &(*tinfo_descs)[ix];
|
||||
|
||||
d = build_lang_decl (VAR_DECL, name, ti->type);
|
||||
SET_DECL_ASSEMBLER_NAME (d, name);
|
||||
|
@ -444,7 +441,7 @@ get_tinfo_decl (tree type)
|
|||
CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
|
||||
|
||||
/* Add decl to the global array of tinfo decls. */
|
||||
VEC_safe_push (tree, gc, unemitted_tinfo_decls, d);
|
||||
vec_safe_push (unemitted_tinfo_decls, d);
|
||||
}
|
||||
|
||||
return d;
|
||||
|
@ -873,7 +870,7 @@ tinfo_base_init (tinfo_s *ti, tree target)
|
|||
tree init;
|
||||
tree name_decl;
|
||||
tree vtable_ptr;
|
||||
VEC(constructor_elt,gc) *v;
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
|
||||
{
|
||||
tree name_name, name_string;
|
||||
|
@ -935,7 +932,7 @@ tinfo_base_init (tinfo_s *ti, tree target)
|
|||
ti->vtable = vtable_ptr;
|
||||
}
|
||||
|
||||
v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec_alloc (v, 2);
|
||||
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, vtable_ptr);
|
||||
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
|
||||
decay_conversion (name_decl, tf_warning_or_error));
|
||||
|
@ -973,7 +970,8 @@ ptr_initializer (tinfo_s *ti, tree target)
|
|||
tree to = TREE_TYPE (target);
|
||||
int flags = qualifier_flags (to);
|
||||
bool incomplete = target_incomplete_p (to);
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 3);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, 3);
|
||||
|
||||
if (incomplete)
|
||||
flags |= 8;
|
||||
|
@ -1001,7 +999,8 @@ ptm_initializer (tinfo_s *ti, tree target)
|
|||
tree klass = TYPE_PTRMEM_CLASS_TYPE (target);
|
||||
int flags = qualifier_flags (to);
|
||||
bool incomplete = target_incomplete_p (to);
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 4);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, 4);
|
||||
|
||||
if (incomplete)
|
||||
flags |= 0x8;
|
||||
|
@ -1029,7 +1028,8 @@ class_initializer (tinfo_s *ti, tree target, unsigned n, ...)
|
|||
tree init = tinfo_base_init (ti, target);
|
||||
va_list extra_inits;
|
||||
unsigned i;
|
||||
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, n+1);
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
vec_alloc (v, n+1);
|
||||
|
||||
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init);
|
||||
va_start (extra_inits, n);
|
||||
|
@ -1079,7 +1079,7 @@ typeinfo_in_lib_p (tree type)
|
|||
static tree
|
||||
get_pseudo_ti_init (tree type, unsigned tk_index)
|
||||
{
|
||||
tinfo_s *ti = &VEC_index (tinfo_s, tinfo_descs, tk_index);
|
||||
tinfo_s *ti = &(*tinfo_descs)[tk_index];
|
||||
|
||||
gcc_assert (at_eof);
|
||||
switch (tk_index)
|
||||
|
@ -1105,7 +1105,7 @@ get_pseudo_ti_init (tree type, unsigned tk_index)
|
|||
tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
|
||||
|
||||
/* get_tinfo_ptr might have reallocated the tinfo_descs vector. */
|
||||
ti = &VEC_index (tinfo_s, tinfo_descs, tk_index);
|
||||
ti = &(*tinfo_descs)[tk_index];
|
||||
return class_initializer (ti, type, 1, tinfo);
|
||||
}
|
||||
|
||||
|
@ -1115,16 +1115,16 @@ get_pseudo_ti_init (tree type, unsigned tk_index)
|
|||
| (CLASSTYPE_DIAMOND_SHAPED_P (type) << 1));
|
||||
tree binfo = TYPE_BINFO (type);
|
||||
int nbases = BINFO_N_BASE_BINFOS (binfo);
|
||||
VEC(tree,gc) *base_accesses = BINFO_BASE_ACCESSES (binfo);
|
||||
vec<tree, va_gc> *base_accesses = BINFO_BASE_ACCESSES (binfo);
|
||||
tree offset_type = integer_types[itk_long];
|
||||
tree base_inits = NULL_TREE;
|
||||
int ix;
|
||||
VEC(constructor_elt,gc) *init_vec = NULL;
|
||||
vec<constructor_elt, va_gc> *init_vec = NULL;
|
||||
constructor_elt *e;
|
||||
|
||||
gcc_assert (tk_index >= TK_FIXED);
|
||||
|
||||
VEC_safe_grow (constructor_elt, gc, init_vec, nbases);
|
||||
vec_safe_grow (init_vec, nbases);
|
||||
/* Generate the base information initializer. */
|
||||
for (ix = nbases; ix--;)
|
||||
{
|
||||
|
@ -1133,9 +1133,9 @@ get_pseudo_ti_init (tree type, unsigned tk_index)
|
|||
int flags = 0;
|
||||
tree tinfo;
|
||||
tree offset;
|
||||
VEC(constructor_elt,gc) *v;
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
|
||||
if (VEC_index (tree, base_accesses, ix) == access_public_node)
|
||||
if ((*base_accesses)[ix] == access_public_node)
|
||||
flags |= 2;
|
||||
tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
|
||||
if (BINFO_VIRTUAL_P (base_binfo))
|
||||
|
@ -1156,18 +1156,18 @@ get_pseudo_ti_init (tree type, unsigned tk_index)
|
|||
offset = fold_build2_loc (input_location,
|
||||
BIT_IOR_EXPR, offset_type, offset,
|
||||
build_int_cst (offset_type, flags));
|
||||
v = VEC_alloc (constructor_elt, gc, 2);
|
||||
vec_alloc (v, 2);
|
||||
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, tinfo);
|
||||
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, offset);
|
||||
base_init = build_constructor (init_list_type_node, v);
|
||||
e = &VEC_index (constructor_elt, init_vec, ix);
|
||||
e = &(*init_vec)[ix];
|
||||
e->index = NULL_TREE;
|
||||
e->value = base_init;
|
||||
}
|
||||
base_inits = build_constructor (init_list_type_node, init_vec);
|
||||
|
||||
/* get_tinfo_ptr might have reallocated the tinfo_descs vector. */
|
||||
ti = &VEC_index (tinfo_s, tinfo_descs, tk_index);
|
||||
ti = &(*tinfo_descs)[tk_index];
|
||||
return class_initializer (ti, type, 3,
|
||||
build_int_cst (NULL_TREE, hint),
|
||||
build_int_cst (NULL_TREE, nbases),
|
||||
|
@ -1213,8 +1213,7 @@ create_pseudo_type_info (int tk, const char *real_name, ...)
|
|||
/* First field is the pseudo type_info base class. */
|
||||
fields = build_decl (input_location,
|
||||
FIELD_DECL, NULL_TREE,
|
||||
VEC_index (tinfo_s, tinfo_descs,
|
||||
TK_TYPE_INFO_TYPE).type);
|
||||
(*tinfo_descs)[TK_TYPE_INFO_TYPE].type);
|
||||
|
||||
/* Now add the derived fields. */
|
||||
while ((field_decl = va_arg (ap, tree)))
|
||||
|
@ -1228,7 +1227,7 @@ create_pseudo_type_info (int tk, const char *real_name, ...)
|
|||
finish_builtin_struct (pseudo_type, pseudo_name, fields, NULL_TREE);
|
||||
CLASSTYPE_AS_BASE (pseudo_type) = pseudo_type;
|
||||
|
||||
ti = &VEC_index (tinfo_s, tinfo_descs, tk);
|
||||
ti = &(*tinfo_descs)[tk];
|
||||
ti->type = cp_build_qualified_type (pseudo_type, TYPE_QUAL_CONST);
|
||||
ti->name = get_identifier (real_name);
|
||||
ti->vtable = NULL_TREE;
|
||||
|
@ -1293,12 +1292,12 @@ get_pseudo_ti_index (tree type)
|
|||
else
|
||||
{
|
||||
tree binfo = TYPE_BINFO (type);
|
||||
VEC(tree,gc) *base_accesses = BINFO_BASE_ACCESSES (binfo);
|
||||
vec<tree, va_gc> *base_accesses = BINFO_BASE_ACCESSES (binfo);
|
||||
tree base_binfo = BINFO_BASE_BINFO (binfo, 0);
|
||||
int num_bases = BINFO_N_BASE_BINFOS (binfo);
|
||||
|
||||
if (num_bases == 1
|
||||
&& VEC_index (tree, base_accesses, 0) == access_public_node
|
||||
&& (*base_accesses)[0] == access_public_node
|
||||
&& !BINFO_VIRTUAL_P (base_binfo)
|
||||
&& integer_zerop (BINFO_OFFSET (base_binfo)))
|
||||
{
|
||||
|
@ -1312,16 +1311,16 @@ get_pseudo_ti_index (tree type)
|
|||
tree array_domain, base_array;
|
||||
|
||||
ix = TK_FIXED + num_bases;
|
||||
if (VEC_length (tinfo_s, tinfo_descs) <= ix)
|
||||
if (vec_safe_length (tinfo_descs) <= ix)
|
||||
{
|
||||
/* too short, extend. */
|
||||
unsigned len = VEC_length (tinfo_s, tinfo_descs);
|
||||
unsigned len = vec_safe_length (tinfo_descs);
|
||||
|
||||
VEC_safe_grow (tinfo_s, gc, tinfo_descs, ix + 1);
|
||||
while (VEC_iterate (tinfo_s, tinfo_descs, len++, ti))
|
||||
vec_safe_grow (tinfo_descs, ix + 1);
|
||||
while (tinfo_descs->iterate (len++, &ti))
|
||||
ti->type = ti->vtable = ti->name = NULL_TREE;
|
||||
}
|
||||
else if (VEC_index (tinfo_s, tinfo_descs, ix).type)
|
||||
else if ((*tinfo_descs)[ix].type)
|
||||
/* already created. */
|
||||
break;
|
||||
|
||||
|
@ -1333,10 +1332,8 @@ get_pseudo_ti_index (tree type)
|
|||
array_domain = build_index_type (size_int (num_bases - 1));
|
||||
else
|
||||
array_domain = build_index_type (size_int (num_bases));
|
||||
base_array =
|
||||
build_array_type (VEC_index (tinfo_s, tinfo_descs,
|
||||
TK_BASE_TYPE).type,
|
||||
array_domain);
|
||||
base_array = build_array_type ((*tinfo_descs)[TK_BASE_TYPE].type,
|
||||
array_domain);
|
||||
|
||||
push_abi_namespace ();
|
||||
create_pseudo_type_info
|
||||
|
@ -1369,7 +1366,7 @@ create_tinfo_types (void)
|
|||
|
||||
gcc_assert (!tinfo_descs);
|
||||
|
||||
VEC_safe_grow (tinfo_s, gc, tinfo_descs, TK_FIXED);
|
||||
vec_safe_grow (tinfo_descs, TK_FIXED);
|
||||
|
||||
push_abi_namespace ();
|
||||
|
||||
|
@ -1387,7 +1384,7 @@ create_tinfo_types (void)
|
|||
DECL_CHAIN (field) = fields;
|
||||
fields = field;
|
||||
|
||||
ti = &VEC_index (tinfo_s, tinfo_descs, TK_TYPE_INFO_TYPE);
|
||||
ti = &(*tinfo_descs)[TK_TYPE_INFO_TYPE];
|
||||
ti->type = make_class_type (RECORD_TYPE);
|
||||
ti->vtable = NULL_TREE;
|
||||
ti->name = NULL_TREE;
|
||||
|
@ -1427,7 +1424,7 @@ create_tinfo_types (void)
|
|||
DECL_CHAIN (field) = fields;
|
||||
fields = field;
|
||||
|
||||
ti = &VEC_index (tinfo_s, tinfo_descs, TK_BASE_TYPE);
|
||||
ti = &(*tinfo_descs)[TK_BASE_TYPE];
|
||||
|
||||
ti->type = make_class_type (RECORD_TYPE);
|
||||
ti->vtable = NULL_TREE;
|
||||
|
|
|
@ -639,14 +639,14 @@ dfs_access_in_type (tree binfo, void *data)
|
|||
{
|
||||
int i;
|
||||
tree base_binfo;
|
||||
VEC(tree,gc) *accesses;
|
||||
vec<tree, va_gc> *accesses;
|
||||
|
||||
/* Otherwise, scan our baseclasses, and pick the most favorable
|
||||
access. */
|
||||
accesses = BINFO_BASE_ACCESSES (binfo);
|
||||
for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
|
||||
{
|
||||
tree base_access = VEC_index (tree, accesses, i);
|
||||
tree base_access = (*accesses)[i];
|
||||
access_kind base_access_now = BINFO_ACCESS (base_binfo);
|
||||
|
||||
if (base_access_now == ak_none || base_access_now == ak_private)
|
||||
|
@ -1316,10 +1316,10 @@ lookup_conversion_operator (tree class_type, tree type)
|
|||
{
|
||||
int i;
|
||||
tree fn;
|
||||
VEC(tree,gc) *methods = CLASSTYPE_METHOD_VEC (class_type);
|
||||
vec<tree, va_gc> *methods = CLASSTYPE_METHOD_VEC (class_type);
|
||||
|
||||
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
VEC_iterate (tree, methods, i, fn); ++i)
|
||||
vec_safe_iterate (methods, i, &fn); ++i)
|
||||
{
|
||||
/* All the conversion operators come near the beginning of
|
||||
the class. Therefore, if FN is not a conversion
|
||||
|
@ -1348,7 +1348,7 @@ lookup_conversion_operator (tree class_type, tree type)
|
|||
static int
|
||||
lookup_fnfields_idx_nolazy (tree type, tree name)
|
||||
{
|
||||
VEC(tree,gc) *method_vec;
|
||||
vec<tree, va_gc> *method_vec;
|
||||
tree fn;
|
||||
tree tmp;
|
||||
size_t i;
|
||||
|
@ -1380,7 +1380,7 @@ lookup_fnfields_idx_nolazy (tree type, tree name)
|
|||
|
||||
/* Skip the conversion operators. */
|
||||
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
VEC_iterate (tree, method_vec, i, fn);
|
||||
vec_safe_iterate (method_vec, i, &fn);
|
||||
++i)
|
||||
if (!DECL_CONV_FN_P (OVL_CURRENT (fn)))
|
||||
break;
|
||||
|
@ -1392,7 +1392,7 @@ lookup_fnfields_idx_nolazy (tree type, tree name)
|
|||
int hi;
|
||||
|
||||
lo = i;
|
||||
hi = VEC_length (tree, method_vec);
|
||||
hi = method_vec->length ();
|
||||
while (lo < hi)
|
||||
{
|
||||
i = (lo + hi) / 2;
|
||||
|
@ -1400,7 +1400,7 @@ lookup_fnfields_idx_nolazy (tree type, tree name)
|
|||
if (GATHER_STATISTICS)
|
||||
n_outer_fields_searched++;
|
||||
|
||||
tmp = VEC_index (tree, method_vec, i);
|
||||
tmp = (*method_vec)[i];
|
||||
tmp = DECL_NAME (OVL_CURRENT (tmp));
|
||||
if (tmp > name)
|
||||
hi = i;
|
||||
|
@ -1411,7 +1411,7 @@ lookup_fnfields_idx_nolazy (tree type, tree name)
|
|||
}
|
||||
}
|
||||
else
|
||||
for (; VEC_iterate (tree, method_vec, i, fn); ++i)
|
||||
for (; vec_safe_iterate (method_vec, i, &fn); ++i)
|
||||
{
|
||||
if (GATHER_STATISTICS)
|
||||
n_outer_fields_searched++;
|
||||
|
@ -1471,7 +1471,7 @@ lookup_fnfields_slot (tree type, tree name)
|
|||
int ix = lookup_fnfields_1 (complete_type (type), name);
|
||||
if (ix < 0)
|
||||
return NULL_TREE;
|
||||
return VEC_index (tree, CLASSTYPE_METHOD_VEC (type), ix);
|
||||
return (*CLASSTYPE_METHOD_VEC (type))[ix];
|
||||
}
|
||||
|
||||
/* As above, but avoid lazily declaring functions. */
|
||||
|
@ -1482,7 +1482,7 @@ lookup_fnfields_slot_nolazy (tree type, tree name)
|
|||
int ix = lookup_fnfields_idx_nolazy (complete_type (type), name);
|
||||
if (ix < 0)
|
||||
return NULL_TREE;
|
||||
return VEC_index (tree, CLASSTYPE_METHOD_VEC (type), ix);
|
||||
return (*CLASSTYPE_METHOD_VEC (type))[ix];
|
||||
}
|
||||
|
||||
/* Like lookup_fnfields_1, except that the name is extracted from
|
||||
|
@ -1701,12 +1701,12 @@ dfs_walk_once (tree binfo, tree (*pre_fn) (tree, void *),
|
|||
/* We are at the top of the hierarchy, and can use the
|
||||
CLASSTYPE_VBASECLASSES list for unmarking the virtual
|
||||
bases. */
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
unsigned ix;
|
||||
tree base_binfo;
|
||||
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo)), ix = 0;
|
||||
VEC_iterate (tree, vbases, ix, base_binfo); ix++)
|
||||
vec_safe_iterate (vbases, ix, &base_binfo); ix++)
|
||||
BINFO_MARKED (base_binfo) = 0;
|
||||
}
|
||||
else
|
||||
|
@ -1809,12 +1809,12 @@ dfs_walk_once_accessible (tree binfo, bool friends_p,
|
|||
/* We are at the top of the hierarchy, and can use the
|
||||
CLASSTYPE_VBASECLASSES list for unmarking the virtual
|
||||
bases. */
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
unsigned ix;
|
||||
tree base_binfo;
|
||||
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo)), ix = 0;
|
||||
VEC_iterate (tree, vbases, ix, base_binfo); ix++)
|
||||
vec_safe_iterate (vbases, ix, &base_binfo); ix++)
|
||||
BINFO_MARKED (base_binfo) = 0;
|
||||
}
|
||||
else
|
||||
|
@ -2019,7 +2019,7 @@ look_for_overrides_here (tree type, tree fndecl)
|
|||
ix = lookup_fnfields_1 (type, DECL_NAME (fndecl));
|
||||
if (ix >= 0)
|
||||
{
|
||||
tree fns = VEC_index (tree, CLASSTYPE_METHOD_VEC (type), ix);
|
||||
tree fns = (*CLASSTYPE_METHOD_VEC (type))[ix];
|
||||
|
||||
for (; fns; fns = OVL_NEXT (fns))
|
||||
{
|
||||
|
@ -2090,8 +2090,7 @@ dfs_get_pure_virtuals (tree binfo, void *data)
|
|||
virtuals;
|
||||
virtuals = TREE_CHAIN (virtuals))
|
||||
if (DECL_PURE_VIRTUAL_P (BV_FN (virtuals)))
|
||||
VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (type),
|
||||
BV_FN (virtuals));
|
||||
vec_safe_push (CLASSTYPE_PURE_VIRTUALS (type), BV_FN (virtuals));
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
|
@ -2364,7 +2363,7 @@ lookup_conversions_r (tree binfo,
|
|||
tree child_tpl_convs = NULL_TREE;
|
||||
unsigned i;
|
||||
tree base_binfo;
|
||||
VEC(tree,gc) *method_vec = CLASSTYPE_METHOD_VEC (BINFO_TYPE (binfo));
|
||||
vec<tree, va_gc> *method_vec = CLASSTYPE_METHOD_VEC (BINFO_TYPE (binfo));
|
||||
tree conv;
|
||||
|
||||
/* If we have no conversion operators, then don't look. */
|
||||
|
@ -2380,7 +2379,7 @@ lookup_conversions_r (tree binfo,
|
|||
|
||||
/* First, locate the unhidden ones at this level. */
|
||||
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
||||
VEC_iterate (tree, method_vec, i, conv);
|
||||
vec_safe_iterate (method_vec, i, &conv);
|
||||
++i)
|
||||
{
|
||||
tree cur = OVL_CURRENT (conv);
|
||||
|
@ -2622,10 +2621,10 @@ binfo_for_vbase (tree base, tree t)
|
|||
{
|
||||
unsigned ix;
|
||||
tree binfo;
|
||||
VEC(tree,gc) *vbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (t), ix = 0;
|
||||
VEC_iterate (tree, vbases, ix, binfo); ix++)
|
||||
vec_safe_iterate (vbases, ix, &binfo); ix++)
|
||||
if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), base))
|
||||
return binfo;
|
||||
return NULL;
|
||||
|
|
|
@ -92,7 +92,7 @@ static tree capture_decltype (tree);
|
|||
|
||||
2. When a declaration such as a type, or a variable, is encountered,
|
||||
the function `perform_or_defer_access_check' is called. It
|
||||
maintains a VEC of all deferred checks.
|
||||
maintains a vector of all deferred checks.
|
||||
|
||||
3. The global `current_class_type' or `current_function_decl' is then
|
||||
setup by the parser. `enforce_access' relies on these information
|
||||
|
@ -100,14 +100,14 @@ static tree capture_decltype (tree);
|
|||
|
||||
4. Upon exiting the context mentioned in step 1,
|
||||
`perform_deferred_access_checks' is called to check all declaration
|
||||
stored in the VEC. `pop_deferring_access_checks' is then
|
||||
stored in the vector. `pop_deferring_access_checks' is then
|
||||
called to restore the previous access checking mode.
|
||||
|
||||
In case of parsing error, we simply call `pop_deferring_access_checks'
|
||||
without `perform_deferred_access_checks'. */
|
||||
|
||||
typedef struct GTY(()) deferred_access {
|
||||
/* A VEC representing name-lookups for which we have deferred
|
||||
/* A vector representing name-lookups for which we have deferred
|
||||
checking access controls. We cannot check the accessibility of
|
||||
names used in a decl-specifier-seq until we know what is being
|
||||
declared because code like:
|
||||
|
@ -120,17 +120,15 @@ typedef struct GTY(()) deferred_access {
|
|||
A::B* A::f() { return 0; }
|
||||
|
||||
is valid, even though `A::B' is not generally accessible. */
|
||||
VEC (deferred_access_check,gc)* GTY(()) deferred_access_checks;
|
||||
vec<deferred_access_check, va_gc> * GTY(()) deferred_access_checks;
|
||||
|
||||
/* The current mode of access checks. */
|
||||
enum deferring_kind deferring_access_checks_kind;
|
||||
|
||||
} deferred_access;
|
||||
DEF_VEC_O (deferred_access);
|
||||
DEF_VEC_ALLOC_O (deferred_access,gc);
|
||||
|
||||
/* Data for deferred access checking. */
|
||||
static GTY(()) VEC(deferred_access,gc) *deferred_access_stack;
|
||||
static GTY(()) vec<deferred_access, va_gc> *deferred_access_stack;
|
||||
static GTY(()) unsigned deferred_access_no_check;
|
||||
|
||||
/* Save the current deferred access states and start deferred
|
||||
|
@ -146,7 +144,7 @@ push_deferring_access_checks (deferring_kind deferring)
|
|||
else
|
||||
{
|
||||
deferred_access e = {NULL, deferring};
|
||||
VEC_safe_push (deferred_access, gc, deferred_access_stack, e);
|
||||
vec_safe_push (deferred_access_stack, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,8 +155,7 @@ void
|
|||
resume_deferring_access_checks (void)
|
||||
{
|
||||
if (!deferred_access_no_check)
|
||||
VEC_last (deferred_access, deferred_access_stack)
|
||||
.deferring_access_checks_kind = dk_deferred;
|
||||
deferred_access_stack->last().deferring_access_checks_kind = dk_deferred;
|
||||
}
|
||||
|
||||
/* Stop deferring access checks. */
|
||||
|
@ -167,8 +164,7 @@ void
|
|||
stop_deferring_access_checks (void)
|
||||
{
|
||||
if (!deferred_access_no_check)
|
||||
VEC_last (deferred_access, deferred_access_stack)
|
||||
.deferring_access_checks_kind = dk_no_deferred;
|
||||
deferred_access_stack->last().deferring_access_checks_kind = dk_no_deferred;
|
||||
}
|
||||
|
||||
/* Discard the current deferred access checks and restore the
|
||||
|
@ -180,7 +176,7 @@ pop_deferring_access_checks (void)
|
|||
if (deferred_access_no_check)
|
||||
deferred_access_no_check--;
|
||||
else
|
||||
VEC_pop (deferred_access, deferred_access_stack);
|
||||
deferred_access_stack->pop ();
|
||||
}
|
||||
|
||||
/* Returns a TREE_LIST representing the deferred checks.
|
||||
|
@ -188,14 +184,13 @@ pop_deferring_access_checks (void)
|
|||
access occurred; the TREE_VALUE is the declaration named.
|
||||
*/
|
||||
|
||||
VEC (deferred_access_check,gc)*
|
||||
vec<deferred_access_check, va_gc> *
|
||||
get_deferred_access_checks (void)
|
||||
{
|
||||
if (deferred_access_no_check)
|
||||
return NULL;
|
||||
else
|
||||
return (VEC_last (deferred_access, deferred_access_stack)
|
||||
.deferred_access_checks);
|
||||
return (deferred_access_stack->last().deferred_access_checks);
|
||||
}
|
||||
|
||||
/* Take current deferred checks and combine with the
|
||||
|
@ -209,14 +204,13 @@ pop_to_parent_deferring_access_checks (void)
|
|||
deferred_access_no_check--;
|
||||
else
|
||||
{
|
||||
VEC (deferred_access_check,gc) *checks;
|
||||
vec<deferred_access_check, va_gc> *checks;
|
||||
deferred_access *ptr;
|
||||
|
||||
checks = (VEC_last (deferred_access, deferred_access_stack)
|
||||
.deferred_access_checks);
|
||||
checks = (deferred_access_stack->last ().deferred_access_checks);
|
||||
|
||||
VEC_pop (deferred_access, deferred_access_stack);
|
||||
ptr = &VEC_last (deferred_access, deferred_access_stack);
|
||||
deferred_access_stack->pop ();
|
||||
ptr = &deferred_access_stack->last ();
|
||||
if (ptr->deferring_access_checks_kind == dk_no_deferred)
|
||||
{
|
||||
/* Check access. */
|
||||
|
@ -228,10 +222,9 @@ pop_to_parent_deferring_access_checks (void)
|
|||
int i, j;
|
||||
deferred_access_check *chk, *probe;
|
||||
|
||||
FOR_EACH_VEC_ELT (deferred_access_check, checks, i, chk)
|
||||
FOR_EACH_VEC_SAFE_ELT (checks, i, chk)
|
||||
{
|
||||
FOR_EACH_VEC_ELT (deferred_access_check,
|
||||
ptr->deferred_access_checks, j, probe)
|
||||
FOR_EACH_VEC_SAFE_ELT (ptr->deferred_access_checks, j, probe)
|
||||
{
|
||||
if (probe->binfo == chk->binfo &&
|
||||
probe->decl == chk->decl &&
|
||||
|
@ -239,8 +232,7 @@ pop_to_parent_deferring_access_checks (void)
|
|||
goto found;
|
||||
}
|
||||
/* Insert into parent's checks. */
|
||||
VEC_safe_push (deferred_access_check, gc,
|
||||
ptr->deferred_access_checks, *chk);
|
||||
vec_safe_push (ptr->deferred_access_checks, *chk);
|
||||
found:;
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +246,7 @@ pop_to_parent_deferring_access_checks (void)
|
|||
otherwise FALSE. */
|
||||
|
||||
bool
|
||||
perform_access_checks (VEC (deferred_access_check,gc)* checks,
|
||||
perform_access_checks (vec<deferred_access_check, va_gc> *checks,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
int i;
|
||||
|
@ -265,7 +257,7 @@ perform_access_checks (VEC (deferred_access_check,gc)* checks,
|
|||
if (!checks)
|
||||
return true;
|
||||
|
||||
FOR_EACH_VEC_ELT (deferred_access_check, checks, i, chk)
|
||||
FOR_EACH_VEC_SAFE_ELT (checks, i, chk)
|
||||
{
|
||||
input_location = chk->loc;
|
||||
ok &= enforce_access (chk->binfo, chk->decl, chk->diag_decl, complain);
|
||||
|
@ -317,7 +309,7 @@ perform_or_defer_access_check (tree binfo, tree decl, tree diag_decl,
|
|||
|
||||
gcc_assert (TREE_CODE (binfo) == TREE_BINFO);
|
||||
|
||||
ptr = &VEC_last (deferred_access, deferred_access_stack);
|
||||
ptr = &deferred_access_stack->last ();
|
||||
|
||||
/* If we are not supposed to defer access checks, just check now. */
|
||||
if (ptr->deferring_access_checks_kind == dk_no_deferred)
|
||||
|
@ -327,8 +319,7 @@ perform_or_defer_access_check (tree binfo, tree decl, tree diag_decl,
|
|||
}
|
||||
|
||||
/* See if we are already going to perform this check. */
|
||||
FOR_EACH_VEC_ELT (deferred_access_check,
|
||||
ptr->deferred_access_checks, i, chk)
|
||||
FOR_EACH_VEC_SAFE_ELT (ptr->deferred_access_checks, i, chk)
|
||||
{
|
||||
if (chk->decl == decl && chk->binfo == binfo &&
|
||||
chk->diag_decl == diag_decl)
|
||||
|
@ -338,8 +329,7 @@ perform_or_defer_access_check (tree binfo, tree decl, tree diag_decl,
|
|||
}
|
||||
/* If not, record the check. */
|
||||
deferred_access_check new_access = {binfo, decl, diag_decl, input_location};
|
||||
VEC_safe_push (deferred_access_check, gc, ptr->deferred_access_checks,
|
||||
new_access);
|
||||
vec_safe_push (ptr->deferred_access_checks, new_access);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -375,7 +365,7 @@ add_stmt (tree t)
|
|||
|
||||
/* Add T to the statement-tree. Non-side-effect statements need to be
|
||||
recorded during statement expressions. */
|
||||
gcc_checking_assert (!VEC_empty (tree, stmt_list_stack));
|
||||
gcc_checking_assert (!stmt_list_stack->is_empty ());
|
||||
append_to_statement_list_force (t, &cur_stmt_list);
|
||||
|
||||
return t;
|
||||
|
@ -1972,7 +1962,7 @@ empty_expr_stmt_p (tree expr_stmt)
|
|||
Returns the functions to be considered by overload resolution. */
|
||||
|
||||
tree
|
||||
perform_koenig_lookup (tree fn, VEC(tree,gc) *args, bool include_std,
|
||||
perform_koenig_lookup (tree fn, vec<tree, va_gc> *args, bool include_std,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
tree identifier = NULL_TREE;
|
||||
|
@ -2038,12 +2028,12 @@ perform_koenig_lookup (tree fn, VEC(tree,gc) *args, bool include_std,
|
|||
Returns code for the call. */
|
||||
|
||||
tree
|
||||
finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual,
|
||||
finish_call_expr (tree fn, vec<tree, va_gc> **args, bool disallow_virtual,
|
||||
bool koenig_p, tsubst_flags_t complain)
|
||||
{
|
||||
tree result;
|
||||
tree orig_fn;
|
||||
VEC(tree,gc) *orig_args = NULL;
|
||||
vec<tree, va_gc> *orig_args = NULL;
|
||||
|
||||
if (fn == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
@ -2172,7 +2162,7 @@ finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual,
|
|||
if (!result)
|
||||
{
|
||||
if (warn_sizeof_pointer_memaccess
|
||||
&& !VEC_empty(tree, *args)
|
||||
&& !vec_safe_is_empty (*args)
|
||||
&& !processing_template_decl)
|
||||
{
|
||||
location_t sizeof_arg_loc[3];
|
||||
|
@ -2184,9 +2174,9 @@ finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual,
|
|||
|
||||
sizeof_arg_loc[i] = UNKNOWN_LOCATION;
|
||||
sizeof_arg[i] = NULL_TREE;
|
||||
if (i >= VEC_length (tree, *args))
|
||||
if (i >= (*args)->length ())
|
||||
continue;
|
||||
t = VEC_index (tree, *args, i);
|
||||
t = (**args)[i];
|
||||
if (TREE_CODE (t) != SIZEOF_EXPR)
|
||||
continue;
|
||||
if (SIZEOF_EXPR_TYPE_P (t))
|
||||
|
@ -2206,7 +2196,7 @@ finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual,
|
|||
}
|
||||
else if (TREE_CODE (fn) == PSEUDO_DTOR_EXPR)
|
||||
{
|
||||
if (!VEC_empty (tree, *args))
|
||||
if (!vec_safe_is_empty (*args))
|
||||
error ("arguments to destructor are not allowed");
|
||||
/* Mark the pseudo-destructor call as having side-effects so
|
||||
that we do not issue warnings about its use. */
|
||||
|
@ -3448,9 +3438,9 @@ finish_underlying_type (tree type)
|
|||
tree
|
||||
calculate_direct_bases (tree type)
|
||||
{
|
||||
VEC(tree, gc) *vector = make_tree_vector();
|
||||
vec<tree, va_gc> *vector = make_tree_vector();
|
||||
tree bases_vec = NULL_TREE;
|
||||
VEC(tree, none) *base_binfos;
|
||||
vec<tree, va_gc> *base_binfos;
|
||||
tree binfo;
|
||||
unsigned i;
|
||||
|
||||
|
@ -3462,29 +3452,29 @@ calculate_direct_bases (tree type)
|
|||
base_binfos = BINFO_BASE_BINFOS (TYPE_BINFO (type));
|
||||
|
||||
/* Virtual bases are initialized first */
|
||||
for (i = 0; VEC_iterate (tree, base_binfos, i, binfo); i++)
|
||||
for (i = 0; base_binfos->iterate (i, &binfo); i++)
|
||||
{
|
||||
if (BINFO_VIRTUAL_P (binfo))
|
||||
{
|
||||
VEC_safe_push (tree, gc, vector, binfo);
|
||||
vec_safe_push (vector, binfo);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now non-virtuals */
|
||||
for (i = 0; VEC_iterate (tree, base_binfos, i, binfo); i++)
|
||||
for (i = 0; base_binfos->iterate (i, &binfo); i++)
|
||||
{
|
||||
if (!BINFO_VIRTUAL_P (binfo))
|
||||
{
|
||||
VEC_safe_push (tree, gc, vector, binfo);
|
||||
vec_safe_push (vector, binfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bases_vec = make_tree_vec (VEC_length (tree, vector));
|
||||
bases_vec = make_tree_vec (vector->length ());
|
||||
|
||||
for (i = 0; i < VEC_length (tree, vector); ++i)
|
||||
for (i = 0; i < vector->length (); ++i)
|
||||
{
|
||||
TREE_VEC_ELT (bases_vec, i) = BINFO_TYPE (VEC_index (tree, vector, i));
|
||||
TREE_VEC_ELT (bases_vec, i) = BINFO_TYPE ((*vector)[i]);
|
||||
}
|
||||
return bases_vec;
|
||||
}
|
||||
|
@ -3505,19 +3495,19 @@ dfs_calculate_bases_pre (tree binfo, void * /*data_*/)
|
|||
static tree
|
||||
dfs_calculate_bases_post (tree binfo, void *data_)
|
||||
{
|
||||
VEC(tree, gc) **data = (VEC(tree, gc) **) data_;
|
||||
vec<tree, va_gc> **data = ((vec<tree, va_gc> **) data_);
|
||||
if (!BINFO_VIRTUAL_P (binfo))
|
||||
{
|
||||
VEC_safe_push (tree, gc, *data, BINFO_TYPE (binfo));
|
||||
vec_safe_push (*data, BINFO_TYPE (binfo));
|
||||
}
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Calculates the morally non-virtual base classes of a class */
|
||||
static VEC(tree, gc) *
|
||||
static vec<tree, va_gc> *
|
||||
calculate_bases_helper (tree type)
|
||||
{
|
||||
VEC(tree, gc) *vector = make_tree_vector();
|
||||
vec<tree, va_gc> *vector = make_tree_vector();
|
||||
|
||||
/* Now add non-virtual base classes in order of construction */
|
||||
dfs_walk_all (TYPE_BINFO (type),
|
||||
|
@ -3528,11 +3518,11 @@ calculate_bases_helper (tree type)
|
|||
tree
|
||||
calculate_bases (tree type)
|
||||
{
|
||||
VEC(tree, gc) *vector = make_tree_vector();
|
||||
vec<tree, va_gc> *vector = make_tree_vector();
|
||||
tree bases_vec = NULL_TREE;
|
||||
unsigned i;
|
||||
VEC(tree, gc) *vbases;
|
||||
VEC(tree, gc) *nonvbases;
|
||||
vec<tree, va_gc> *vbases;
|
||||
vec<tree, va_gc> *nonvbases;
|
||||
tree binfo;
|
||||
|
||||
complete_type (type);
|
||||
|
@ -3542,24 +3532,25 @@ calculate_bases (tree type)
|
|||
|
||||
/* First go through virtual base classes */
|
||||
for (vbases = CLASSTYPE_VBASECLASSES (type), i = 0;
|
||||
VEC_iterate (tree, vbases, i, binfo); i++)
|
||||
vec_safe_iterate (vbases, i, &binfo); i++)
|
||||
{
|
||||
VEC(tree, gc) *vbase_bases = calculate_bases_helper (BINFO_TYPE (binfo));
|
||||
VEC_safe_splice (tree, gc, vector, vbase_bases);
|
||||
vec<tree, va_gc> *vbase_bases;
|
||||
vbase_bases = calculate_bases_helper (BINFO_TYPE (binfo));
|
||||
vec_safe_splice (vector, vbase_bases);
|
||||
release_tree_vector (vbase_bases);
|
||||
}
|
||||
|
||||
/* Now for the non-virtual bases */
|
||||
nonvbases = calculate_bases_helper (type);
|
||||
VEC_safe_splice (tree, gc, vector, nonvbases);
|
||||
vec_safe_splice (vector, nonvbases);
|
||||
release_tree_vector (nonvbases);
|
||||
|
||||
/* Last element is entire class, so don't copy */
|
||||
bases_vec = make_tree_vec (VEC_length (tree, vector) - 1);
|
||||
bases_vec = make_tree_vec (vector->length () - 1);
|
||||
|
||||
for (i = 0; i < VEC_length (tree, vector) - 1; ++i)
|
||||
for (i = 0; i < vector->length () - 1; ++i)
|
||||
{
|
||||
TREE_VEC_ELT (bases_vec, i) = VEC_index (tree, vector, i);
|
||||
TREE_VEC_ELT (bases_vec, i) = (*vector)[i];
|
||||
}
|
||||
release_tree_vector (vector);
|
||||
return bases_vec;
|
||||
|
@ -5010,7 +5001,7 @@ void
|
|||
finish_omp_barrier (void)
|
||||
{
|
||||
tree fn = builtin_decl_explicit (BUILT_IN_GOMP_BARRIER);
|
||||
VEC(tree,gc) *vec = make_tree_vector ();
|
||||
vec<tree, va_gc> *vec = make_tree_vector ();
|
||||
tree stmt = finish_call_expr (fn, &vec, false, false, tf_warning_or_error);
|
||||
release_tree_vector (vec);
|
||||
finish_expr_stmt (stmt);
|
||||
|
@ -5020,7 +5011,7 @@ void
|
|||
finish_omp_flush (void)
|
||||
{
|
||||
tree fn = builtin_decl_explicit (BUILT_IN_SYNC_SYNCHRONIZE);
|
||||
VEC(tree,gc) *vec = make_tree_vector ();
|
||||
vec<tree, va_gc> *vec = make_tree_vector ();
|
||||
tree stmt = finish_call_expr (fn, &vec, false, false, tf_warning_or_error);
|
||||
release_tree_vector (vec);
|
||||
finish_expr_stmt (stmt);
|
||||
|
@ -5030,7 +5021,7 @@ void
|
|||
finish_omp_taskwait (void)
|
||||
{
|
||||
tree fn = builtin_decl_explicit (BUILT_IN_GOMP_TASKWAIT);
|
||||
VEC(tree,gc) *vec = make_tree_vector ();
|
||||
vec<tree, va_gc> *vec = make_tree_vector ();
|
||||
tree stmt = finish_call_expr (fn, &vec, false, false, tf_warning_or_error);
|
||||
release_tree_vector (vec);
|
||||
finish_expr_stmt (stmt);
|
||||
|
@ -5040,7 +5031,7 @@ void
|
|||
finish_omp_taskyield (void)
|
||||
{
|
||||
tree fn = builtin_decl_explicit (BUILT_IN_GOMP_TASKYIELD);
|
||||
VEC(tree,gc) *vec = make_tree_vector ();
|
||||
vec<tree, va_gc> *vec = make_tree_vector ();
|
||||
tree stmt = finish_call_expr (fn, &vec, false, false, tf_warning_or_error);
|
||||
release_tree_vector (vec);
|
||||
finish_expr_stmt (stmt);
|
||||
|
@ -5380,7 +5371,7 @@ classtype_has_nothrow_assign_or_copy_p (tree type, bool assign_p)
|
|||
ix = lookup_fnfields_1 (type, ansi_assopname (NOP_EXPR));
|
||||
if (ix < 0)
|
||||
return false;
|
||||
fns = VEC_index (tree, CLASSTYPE_METHOD_VEC (type), ix);
|
||||
fns = (*CLASSTYPE_METHOD_VEC (type))[ix];
|
||||
}
|
||||
else if (TYPE_HAS_COPY_CTOR (type))
|
||||
{
|
||||
|
@ -5806,7 +5797,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
|
|||
to the existing initialization pair INITS. */
|
||||
|
||||
static bool
|
||||
build_data_member_initialization (tree t, VEC(constructor_elt,gc) **vec)
|
||||
build_data_member_initialization (tree t, vec<constructor_elt, va_gc> **vec)
|
||||
{
|
||||
tree member, init;
|
||||
if (TREE_CODE (t) == CLEANUP_POINT_EXPR)
|
||||
|
@ -5933,13 +5924,13 @@ check_constexpr_ctor_body (tree last, tree list)
|
|||
return ok;
|
||||
}
|
||||
|
||||
/* VEC is a vector of constructor elements built up for the base and member
|
||||
/* V is a vector of constructor elements built up for the base and member
|
||||
initializers of a constructor for TYPE. They need to be in increasing
|
||||
offset order, which they might not be yet if TYPE has a primary base
|
||||
which is not first in the base-clause. */
|
||||
|
||||
static VEC(constructor_elt,gc) *
|
||||
sort_constexpr_mem_initializers (tree type, VEC(constructor_elt,gc) *vec)
|
||||
static vec<constructor_elt, va_gc> *
|
||||
sort_constexpr_mem_initializers (tree type, vec<constructor_elt, va_gc> *v)
|
||||
{
|
||||
tree pri = CLASSTYPE_PRIMARY_BINFO (type);
|
||||
constructor_elt elt;
|
||||
|
@ -5947,21 +5938,21 @@ sort_constexpr_mem_initializers (tree type, VEC(constructor_elt,gc) *vec)
|
|||
|
||||
if (pri == NULL_TREE
|
||||
|| pri == BINFO_BASE_BINFO (TYPE_BINFO (type), 0))
|
||||
return vec;
|
||||
return v;
|
||||
|
||||
/* Find the element for the primary base and move it to the beginning of
|
||||
the vec. */
|
||||
VEC(constructor_elt,gc) &v = *vec;
|
||||
vec<constructor_elt, va_gc> &vref = *v;
|
||||
pri = BINFO_TYPE (pri);
|
||||
for (i = 1; ; ++i)
|
||||
if (TREE_TYPE (v[i].index) == pri)
|
||||
if (TREE_TYPE (vref[i].index) == pri)
|
||||
break;
|
||||
|
||||
elt = v[i];
|
||||
elt = vref[i];
|
||||
for (; i > 0; --i)
|
||||
v[i] = v[i-1];
|
||||
v[0] = elt;
|
||||
return vec;
|
||||
vref[i] = vref[i-1];
|
||||
vref[0] = elt;
|
||||
return v;
|
||||
}
|
||||
|
||||
/* Build compile-time evalable representations of member-initializer list
|
||||
|
@ -5970,7 +5961,7 @@ sort_constexpr_mem_initializers (tree type, VEC(constructor_elt,gc) *vec)
|
|||
static tree
|
||||
build_constexpr_constructor_member_initializers (tree type, tree body)
|
||||
{
|
||||
VEC(constructor_elt,gc) *vec = NULL;
|
||||
vec<constructor_elt, va_gc> *vec = NULL;
|
||||
bool ok = true;
|
||||
if (TREE_CODE (body) == MUST_NOT_THROW_EXPR
|
||||
|| TREE_CODE (body) == EH_SPEC_BLOCK)
|
||||
|
@ -6015,14 +6006,14 @@ build_constexpr_constructor_member_initializers (tree type, tree body)
|
|||
gcc_assert (errorcount > 0);
|
||||
if (ok)
|
||||
{
|
||||
if (VEC_length (constructor_elt, vec) > 0)
|
||||
if (vec_safe_length (vec) > 0)
|
||||
{
|
||||
/* In a delegating constructor, return the target. */
|
||||
constructor_elt *ce = &VEC_index (constructor_elt, vec, 0);
|
||||
constructor_elt *ce = &(*vec)[0];
|
||||
if (ce->index == current_class_ptr)
|
||||
{
|
||||
body = ce->value;
|
||||
VEC_free (constructor_elt, gc, vec);
|
||||
vec_free (vec);
|
||||
return body;
|
||||
}
|
||||
}
|
||||
|
@ -6519,7 +6510,7 @@ cxx_bind_parameters_in_call (const constexpr_call *old_call, tree t,
|
|||
These do not need to be marked for PCH or GC. */
|
||||
|
||||
/* FIXME remember and print actual constant arguments. */
|
||||
static VEC(tree,heap) *call_stack = NULL;
|
||||
static vec<tree> call_stack = vec<tree>();
|
||||
static int call_stack_tick;
|
||||
static int last_cx_error_tick;
|
||||
|
||||
|
@ -6529,8 +6520,8 @@ push_cx_call_context (tree call)
|
|||
++call_stack_tick;
|
||||
if (!EXPR_HAS_LOCATION (call))
|
||||
SET_EXPR_LOCATION (call, input_location);
|
||||
VEC_safe_push (tree, heap, call_stack, call);
|
||||
if (VEC_length (tree, call_stack) > (unsigned) max_constexpr_depth)
|
||||
call_stack.safe_push (call);
|
||||
if (call_stack.length () > (unsigned) max_constexpr_depth)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -6539,15 +6530,15 @@ static void
|
|||
pop_cx_call_context (void)
|
||||
{
|
||||
++call_stack_tick;
|
||||
VEC_pop (tree, call_stack);
|
||||
call_stack.pop ();
|
||||
}
|
||||
|
||||
VEC(tree,heap) *
|
||||
vec<tree>
|
||||
cx_error_context (void)
|
||||
{
|
||||
VEC(tree,heap) *r = NULL;
|
||||
vec<tree> r = vec<tree>();
|
||||
if (call_stack_tick != last_cx_error_tick
|
||||
&& !VEC_empty (tree, call_stack))
|
||||
&& !call_stack.is_empty ())
|
||||
r = call_stack;
|
||||
last_cx_error_tick = call_stack_tick;
|
||||
return r;
|
||||
|
@ -6893,7 +6884,7 @@ cxx_eval_array_reference (const constexpr_call *call, tree t,
|
|||
}
|
||||
i = tree_low_cst (index, 0);
|
||||
if (TREE_CODE (ary) == CONSTRUCTOR)
|
||||
return VEC_index (constructor_elt, CONSTRUCTOR_ELTS (ary), i).value;
|
||||
return (*CONSTRUCTOR_ELTS (ary))[i].value;
|
||||
else if (elem_nchars == 1)
|
||||
return build_int_cst (cv_unqualified (TREE_TYPE (TREE_TYPE (ary))),
|
||||
TREE_STRING_POINTER (ary)[i]);
|
||||
|
@ -7076,7 +7067,7 @@ cxx_eval_logical_expression (const constexpr_call *call, tree t,
|
|||
initialization of the field. */
|
||||
|
||||
static constructor_elt *
|
||||
base_field_constructor_elt (VEC(constructor_elt,gc) *v, tree ref)
|
||||
base_field_constructor_elt (vec<constructor_elt, va_gc> *v, tree ref)
|
||||
{
|
||||
tree aggr = TREE_OPERAND (ref, 0);
|
||||
tree field = TREE_OPERAND (ref, 1);
|
||||
|
@ -7092,7 +7083,7 @@ base_field_constructor_elt (VEC(constructor_elt,gc) *v, tree ref)
|
|||
v = CONSTRUCTOR_ELTS (base_ce->value);
|
||||
}
|
||||
|
||||
for (i = 0; VEC_iterate (constructor_elt, v, i, ce); ++i)
|
||||
for (i = 0; vec_safe_iterate (v, i, &ce); ++i)
|
||||
if (ce->index == field)
|
||||
return ce;
|
||||
|
||||
|
@ -7109,14 +7100,14 @@ cxx_eval_bare_aggregate (const constexpr_call *call, tree t,
|
|||
bool allow_non_constant, bool addr,
|
||||
bool *non_constant_p)
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (t);
|
||||
VEC(constructor_elt,gc) *n = VEC_alloc (constructor_elt, gc,
|
||||
VEC_length (constructor_elt, v));
|
||||
vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (t);
|
||||
vec<constructor_elt, va_gc> *n;
|
||||
vec_alloc (n, vec_safe_length (v));
|
||||
constructor_elt *ce;
|
||||
HOST_WIDE_INT i;
|
||||
bool changed = false;
|
||||
gcc_assert (!BRACE_ENCLOSED_INITIALIZER_P (t));
|
||||
for (i = 0; VEC_iterate (constructor_elt, v, i, ce); ++i)
|
||||
for (i = 0; vec_safe_iterate (v, i, &ce); ++i)
|
||||
{
|
||||
tree elt = cxx_eval_constant_expression (call, ce->value,
|
||||
allow_non_constant, addr,
|
||||
|
@ -7146,7 +7137,7 @@ cxx_eval_bare_aggregate (const constexpr_call *call, tree t,
|
|||
if (*non_constant_p || !changed)
|
||||
{
|
||||
fail:
|
||||
VEC_free (constructor_elt, gc, n);
|
||||
vec_free (n);
|
||||
return t;
|
||||
}
|
||||
t = build_constructor (TREE_TYPE (t), n);
|
||||
|
@ -7173,7 +7164,8 @@ cxx_eval_vec_init_1 (const constexpr_call *call, tree atype, tree init,
|
|||
{
|
||||
tree elttype = TREE_TYPE (atype);
|
||||
int max = tree_low_cst (array_type_nelts (atype), 0);
|
||||
VEC(constructor_elt,gc) *n = VEC_alloc (constructor_elt, gc, max + 1);
|
||||
vec<constructor_elt, va_gc> *n;
|
||||
vec_alloc (n, max + 1);
|
||||
bool pre_init = false;
|
||||
int i;
|
||||
|
||||
|
@ -7193,7 +7185,7 @@ cxx_eval_vec_init_1 (const constexpr_call *call, tree atype, tree init,
|
|||
}
|
||||
else if (!init)
|
||||
{
|
||||
VEC(tree,gc) *argvec = make_tree_vector ();
|
||||
vec<tree, va_gc> *argvec = make_tree_vector ();
|
||||
init = build_special_member_call (NULL_TREE, complete_ctor_identifier,
|
||||
&argvec, elttype, LOOKUP_NORMAL,
|
||||
tf_warning_or_error);
|
||||
|
@ -7234,7 +7226,7 @@ cxx_eval_vec_init_1 (const constexpr_call *call, tree atype, tree init,
|
|||
else
|
||||
{
|
||||
/* Copying an element. */
|
||||
VEC(tree,gc) *argvec;
|
||||
vec<tree, va_gc> *argvec;
|
||||
gcc_assert (same_type_ignoring_top_level_qualifiers_p
|
||||
(atype, TREE_TYPE (init)));
|
||||
eltinit = cp_build_array_ref (input_location, init, idx,
|
||||
|
@ -7242,7 +7234,7 @@ cxx_eval_vec_init_1 (const constexpr_call *call, tree atype, tree init,
|
|||
if (!real_lvalue_p (init))
|
||||
eltinit = move (eltinit);
|
||||
argvec = make_tree_vector ();
|
||||
VEC_quick_push (tree, argvec, eltinit);
|
||||
argvec->quick_push (eltinit);
|
||||
eltinit = (build_special_member_call
|
||||
(NULL_TREE, complete_ctor_identifier, &argvec,
|
||||
elttype, LOOKUP_NORMAL, tf_warning_or_error));
|
||||
|
@ -7263,7 +7255,7 @@ cxx_eval_vec_init_1 (const constexpr_call *call, tree atype, tree init,
|
|||
}
|
||||
|
||||
fail:
|
||||
VEC_free (constructor_elt, gc, n);
|
||||
vec_free (n);
|
||||
return init;
|
||||
}
|
||||
|
||||
|
@ -8517,9 +8509,9 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
|
|||
|
||||
case CONSTRUCTOR:
|
||||
{
|
||||
VEC(constructor_elt, gc) *v = CONSTRUCTOR_ELTS (t);
|
||||
vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (t);
|
||||
constructor_elt *ce;
|
||||
for (i = 0; VEC_iterate (constructor_elt, v, i, ce); ++i)
|
||||
for (i = 0; vec_safe_iterate (v, i, &ce); ++i)
|
||||
if (!potential_constant_expression_1 (ce->value, want_rval, flags))
|
||||
return false;
|
||||
return true;
|
||||
|
@ -8747,7 +8739,7 @@ build_lambda_object (tree lambda_expr)
|
|||
/* Build aggregate constructor call.
|
||||
- cp_parser_braced_list
|
||||
- cp_parser_functional_cast */
|
||||
VEC(constructor_elt,gc) *elts = NULL;
|
||||
vec<constructor_elt, va_gc> *elts = NULL;
|
||||
tree node, expr, type;
|
||||
location_t saved_loc;
|
||||
|
||||
|
@ -9067,8 +9059,7 @@ insert_capture_proxy (tree var)
|
|||
|
||||
/* And put a DECL_EXPR in the STATEMENT_LIST for the same block. */
|
||||
var = build_stmt (DECL_SOURCE_LOCATION (var), DECL_EXPR, var);
|
||||
stmt_list = VEC_index (tree, stmt_list_stack,
|
||||
VEC_length (tree, stmt_list_stack) - 1 - skip);
|
||||
stmt_list = (*stmt_list_stack)[stmt_list_stack->length () - 1 - skip];
|
||||
gcc_assert (stmt_list);
|
||||
append_to_statement_list_force (var, &stmt_list);
|
||||
}
|
||||
|
@ -9081,7 +9072,7 @@ void
|
|||
insert_pending_capture_proxies (void)
|
||||
{
|
||||
tree lam;
|
||||
VEC(tree,gc) *proxies;
|
||||
vec<tree, va_gc> *proxies;
|
||||
unsigned i;
|
||||
|
||||
if (!current_function_decl || !LAMBDA_FUNCTION_P (current_function_decl))
|
||||
|
@ -9089,9 +9080,9 @@ insert_pending_capture_proxies (void)
|
|||
|
||||
lam = CLASSTYPE_LAMBDA_EXPR (DECL_CONTEXT (current_function_decl));
|
||||
proxies = LAMBDA_EXPR_PENDING_PROXIES (lam);
|
||||
for (i = 0; i < VEC_length (tree, proxies); ++i)
|
||||
for (i = 0; i < vec_safe_length (proxies); ++i)
|
||||
{
|
||||
tree var = VEC_index (tree, proxies, i);
|
||||
tree var = (*proxies)[i];
|
||||
insert_capture_proxy (var);
|
||||
}
|
||||
release_tree_vector (LAMBDA_EXPR_PENDING_PROXIES (lam));
|
||||
|
@ -9158,7 +9149,7 @@ build_capture_proxy (tree member)
|
|||
if (fn == current_function_decl)
|
||||
insert_capture_proxy (var);
|
||||
else
|
||||
VEC_safe_push (tree, gc, LAMBDA_EXPR_PENDING_PROXIES (lam), var);
|
||||
vec_safe_push (LAMBDA_EXPR_PENDING_PROXIES (lam), var);
|
||||
|
||||
return var;
|
||||
}
|
||||
|
@ -9405,7 +9396,7 @@ maybe_add_lambda_conv_op (tree type)
|
|||
tree callop = lambda_function (type);
|
||||
tree rettype, name, fntype, fn, body, compound_stmt;
|
||||
tree thistype, stattype, statfn, convfn, call, arg;
|
||||
VEC (tree, gc) *argvec;
|
||||
vec<tree, va_gc> *argvec;
|
||||
|
||||
if (LAMBDA_EXPR_CAPTURE_LIST (CLASSTYPE_LAMBDA_EXPR (type)) != NULL_TREE)
|
||||
return;
|
||||
|
@ -9495,14 +9486,13 @@ maybe_add_lambda_conv_op (tree type)
|
|||
arg = build1 (NOP_EXPR, TREE_TYPE (DECL_ARGUMENTS (callop)),
|
||||
null_pointer_node);
|
||||
argvec = make_tree_vector ();
|
||||
VEC_quick_push (tree, argvec, arg);
|
||||
argvec->quick_push (arg);
|
||||
for (arg = DECL_ARGUMENTS (statfn); arg; arg = DECL_CHAIN (arg))
|
||||
{
|
||||
mark_exp_read (arg);
|
||||
VEC_safe_push (tree, gc, argvec, arg);
|
||||
vec_safe_push (argvec, arg);
|
||||
}
|
||||
call = build_call_a (callop, VEC_length (tree, argvec),
|
||||
VEC_address (tree, argvec));
|
||||
call = build_call_a (callop, argvec->length (), argvec->address ());
|
||||
CALL_FROM_THUNK_P (call) = 1;
|
||||
if (MAYBE_CLASS_TYPE_P (TREE_TYPE (call)))
|
||||
call = build_cplus_new (TREE_TYPE (call), call, tf_warning_or_error);
|
||||
|
|
|
@ -508,7 +508,7 @@ static tree
|
|||
build_vec_init_elt (tree type, tree init, tsubst_flags_t complain)
|
||||
{
|
||||
tree inner_type = strip_array_types (type);
|
||||
VEC(tree,gc) *argvec;
|
||||
vec<tree, va_gc> *argvec;
|
||||
|
||||
if (integer_zerop (array_type_nelts_total (type))
|
||||
|| !CLASS_TYPE_P (inner_type))
|
||||
|
@ -527,7 +527,7 @@ build_vec_init_elt (tree type, tree init, tsubst_flags_t complain)
|
|||
tree dummy = build_dummy_object (inner_type);
|
||||
if (!real_lvalue_p (init))
|
||||
dummy = move (dummy);
|
||||
VEC_quick_push (tree, argvec, dummy);
|
||||
argvec->quick_push (dummy);
|
||||
}
|
||||
init = build_special_member_call (NULL_TREE, complete_ctor_identifier,
|
||||
&argvec, inner_type, LOOKUP_NORMAL,
|
||||
|
@ -1286,13 +1286,13 @@ strip_typedefs_expr (tree t)
|
|||
|
||||
case TREE_LIST:
|
||||
{
|
||||
VEC(tree,gc) *vec = make_tree_vector ();
|
||||
vec<tree, va_gc> *vec = make_tree_vector ();
|
||||
bool changed = false;
|
||||
tree it;
|
||||
for (it = t; it; it = TREE_CHAIN (it))
|
||||
{
|
||||
tree val = strip_typedefs_expr (TREE_VALUE (t));
|
||||
VEC_safe_push (tree, gc, vec, val);
|
||||
vec_safe_push (vec, val);
|
||||
if (val != TREE_VALUE (t))
|
||||
changed = true;
|
||||
gcc_assert (TREE_PURPOSE (it) == NULL_TREE);
|
||||
|
@ -1300,7 +1300,7 @@ strip_typedefs_expr (tree t)
|
|||
if (changed)
|
||||
{
|
||||
r = NULL_TREE;
|
||||
FOR_EACH_VEC_ELT_REVERSE (tree, vec, i, it)
|
||||
FOR_EACH_VEC_ELT_REVERSE (*vec, i, it)
|
||||
r = tree_cons (NULL_TREE, it, r);
|
||||
}
|
||||
else
|
||||
|
@ -1312,13 +1312,13 @@ strip_typedefs_expr (tree t)
|
|||
case TREE_VEC:
|
||||
{
|
||||
bool changed = false;
|
||||
VEC(tree,gc)* vec = make_tree_vector ();
|
||||
vec<tree, va_gc> *vec = make_tree_vector ();
|
||||
n = TREE_VEC_LENGTH (t);
|
||||
VEC_reserve (tree, gc, vec, n);
|
||||
vec_safe_reserve (vec, n);
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
tree op = strip_typedefs_expr (TREE_VEC_ELT (t, i));
|
||||
VEC_quick_push (tree, vec, op);
|
||||
vec->quick_push (op);
|
||||
if (op != TREE_VEC_ELT (t, i))
|
||||
changed = true;
|
||||
}
|
||||
|
@ -1326,7 +1326,7 @@ strip_typedefs_expr (tree t)
|
|||
{
|
||||
r = copy_node (t);
|
||||
for (i = 0; i < n; ++i)
|
||||
TREE_VEC_ELT (r, i) = VEC_index (tree, vec, i);
|
||||
TREE_VEC_ELT (r, i) = (*vec)[i];
|
||||
}
|
||||
else
|
||||
r = t;
|
||||
|
@ -1337,13 +1337,13 @@ strip_typedefs_expr (tree t)
|
|||
case CONSTRUCTOR:
|
||||
{
|
||||
bool changed = false;
|
||||
VEC(constructor_elt,gc) *vec
|
||||
= VEC_copy (constructor_elt, gc, CONSTRUCTOR_ELTS (t));
|
||||
vec<constructor_elt, va_gc> *vec
|
||||
= vec_safe_copy (CONSTRUCTOR_ELTS (t));
|
||||
n = CONSTRUCTOR_NELTS (t);
|
||||
type = strip_typedefs (TREE_TYPE (t));
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
constructor_elt *e = &VEC_index (constructor_elt, vec, i);
|
||||
constructor_elt *e = &(*vec)[i];
|
||||
tree op = strip_typedefs_expr (e->value);
|
||||
if (op != e->value)
|
||||
{
|
||||
|
@ -1355,7 +1355,7 @@ strip_typedefs_expr (tree t)
|
|||
|
||||
if (!changed && type == TREE_TYPE (t))
|
||||
{
|
||||
VEC_free (constructor_elt, gc, vec);
|
||||
vec_free (vec);
|
||||
return t;
|
||||
}
|
||||
else
|
||||
|
@ -1484,7 +1484,7 @@ copy_binfo (tree binfo, tree type, tree t, tree *igo_prev, int virt)
|
|||
{
|
||||
/* Push it onto the list after any virtual bases it contains
|
||||
will have been pushed. */
|
||||
VEC_quick_push (tree, CLASSTYPE_VBASECLASSES (t), new_binfo);
|
||||
CLASSTYPE_VBASECLASSES (t)->quick_push (new_binfo);
|
||||
BINFO_VIRTUAL_P (new_binfo) = 1;
|
||||
BINFO_INHERITANCE_CHAIN (new_binfo) = TYPE_BINFO (t);
|
||||
}
|
||||
|
@ -2184,9 +2184,9 @@ bot_replace (tree* t, int* /*walk_subtrees*/, void* data)
|
|||
/* In an NSDMI build_base_path defers building conversions to virtual
|
||||
bases, and we handle it here. */
|
||||
tree basetype = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (*t)));
|
||||
VEC(tree,gc) *vbases = CLASSTYPE_VBASECLASSES (current_class_type);
|
||||
vec<tree, va_gc> *vbases = CLASSTYPE_VBASECLASSES (current_class_type);
|
||||
int i; tree binfo;
|
||||
FOR_EACH_VEC_ELT (tree, vbases, i, binfo)
|
||||
FOR_EACH_VEC_SAFE_ELT (vbases, i, binfo)
|
||||
if (BINFO_TYPE (binfo) == basetype)
|
||||
break;
|
||||
*t = build_base_path (PLUS_EXPR, TREE_OPERAND (*t, 0), binfo, true,
|
||||
|
@ -2327,7 +2327,7 @@ build_min_non_dep (enum tree_code code, tree non_dep, ...)
|
|||
that has been built. */
|
||||
|
||||
tree
|
||||
build_min_non_dep_call_vec (tree non_dep, tree fn, VEC(tree,gc) *argvec)
|
||||
build_min_non_dep_call_vec (tree non_dep, tree fn, vec<tree, va_gc> *argvec)
|
||||
{
|
||||
tree t = build_nt_call_vec (fn, argvec);
|
||||
if (REFERENCE_REF_P (non_dep))
|
||||
|
@ -3742,8 +3742,8 @@ stabilize_init (tree init, tree *initp)
|
|||
unsigned i;
|
||||
constructor_elt *ce;
|
||||
bool good = true;
|
||||
VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (t);
|
||||
for (i = 0; VEC_iterate (constructor_elt, v, i, ce); ++i)
|
||||
vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (t);
|
||||
for (i = 0; vec_safe_iterate (v, i, &ce); ++i)
|
||||
{
|
||||
tree type = TREE_TYPE (ce->value);
|
||||
tree subinit;
|
||||
|
@ -3827,7 +3827,7 @@ cp_fix_function_decl_p (tree decl)
|
|||
/* Don't fix same_body aliases. Although they don't have their own
|
||||
CFG, they share it with what they alias to. */
|
||||
if (!node || !node->alias
|
||||
|| !VEC_length (ipa_ref_t, node->symbol.ref_list.references))
|
||||
|| !vec_safe_length (node->symbol.ref_list.references))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ static bool casts_away_constness (tree, tree, tsubst_flags_t);
|
|||
static void maybe_warn_about_returning_address_of_local (tree);
|
||||
static tree lookup_destructor (tree, tree, tree);
|
||||
static void warn_args_num (location_t, tree, bool);
|
||||
static int convert_arguments (tree, VEC(tree,gc) **, tree, int,
|
||||
static int convert_arguments (tree, vec<tree, va_gc> **, tree, int,
|
||||
tsubst_flags_t);
|
||||
|
||||
/* Do `exp = require_complete_type (exp);' to make sure exp
|
||||
|
@ -3270,10 +3270,10 @@ build_function_call (location_t /*loc*/,
|
|||
/* Used by the C-common bits. */
|
||||
tree
|
||||
build_function_call_vec (location_t /*loc*/,
|
||||
tree function, VEC(tree,gc) *params,
|
||||
VEC(tree,gc) * /*origtypes*/)
|
||||
tree function, vec<tree, va_gc> *params,
|
||||
vec<tree, va_gc> * /*origtypes*/)
|
||||
{
|
||||
VEC(tree,gc) *orig_params = params;
|
||||
vec<tree, va_gc> *orig_params = params;
|
||||
tree ret = cp_build_function_call_vec (function, ¶ms,
|
||||
tf_warning_or_error);
|
||||
|
||||
|
@ -3290,12 +3290,12 @@ build_function_call_vec (location_t /*loc*/,
|
|||
tree
|
||||
cp_build_function_call (tree function, tree params, tsubst_flags_t complain)
|
||||
{
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
tree ret;
|
||||
|
||||
vec = make_tree_vector ();
|
||||
for (; params != NULL_TREE; params = TREE_CHAIN (params))
|
||||
VEC_safe_push (tree, gc, vec, TREE_VALUE (params));
|
||||
vec_safe_push (vec, TREE_VALUE (params));
|
||||
ret = cp_build_function_call_vec (function, &vec, complain);
|
||||
release_tree_vector (vec);
|
||||
return ret;
|
||||
|
@ -3306,14 +3306,14 @@ cp_build_function_call (tree function, tree params, tsubst_flags_t complain)
|
|||
tree
|
||||
cp_build_function_call_nary (tree function, tsubst_flags_t complain, ...)
|
||||
{
|
||||
VEC(tree,gc) *vec;
|
||||
vec<tree, va_gc> *vec;
|
||||
va_list args;
|
||||
tree ret, t;
|
||||
|
||||
vec = make_tree_vector ();
|
||||
va_start (args, complain);
|
||||
for (t = va_arg (args, tree); t != NULL_TREE; t = va_arg (args, tree))
|
||||
VEC_safe_push (tree, gc, vec, t);
|
||||
vec_safe_push (vec, t);
|
||||
va_end (args);
|
||||
ret = cp_build_function_call_vec (function, &vec, complain);
|
||||
release_tree_vector (vec);
|
||||
|
@ -3325,7 +3325,7 @@ cp_build_function_call_nary (tree function, tsubst_flags_t complain, ...)
|
|||
PARAMS. */
|
||||
|
||||
tree
|
||||
cp_build_function_call_vec (tree function, VEC(tree,gc) **params,
|
||||
cp_build_function_call_vec (tree function, vec<tree, va_gc> **params,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
tree fntype, fndecl;
|
||||
|
@ -3334,14 +3334,13 @@ cp_build_function_call_vec (tree function, VEC(tree,gc) **params,
|
|||
int nargs;
|
||||
tree *argarray;
|
||||
tree parm_types;
|
||||
VEC(tree,gc) *allocated = NULL;
|
||||
vec<tree, va_gc> *allocated = NULL;
|
||||
tree ret;
|
||||
|
||||
/* For Objective-C, convert any calls via a cast to OBJC_TYPE_REF
|
||||
expressions, like those used for ObjC messenger dispatches. */
|
||||
if (params != NULL && !VEC_empty (tree, *params))
|
||||
function = objc_rewrite_function_call (function,
|
||||
VEC_index (tree, *params, 0));
|
||||
if (params != NULL && !vec_safe_is_empty (*params))
|
||||
function = objc_rewrite_function_call (function, (**params)[0]);
|
||||
|
||||
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
|
||||
Strip such NOP_EXPRs, since FUNCTION is used in non-lvalue context. */
|
||||
|
@ -3421,7 +3420,7 @@ cp_build_function_call_vec (tree function, VEC(tree,gc) **params,
|
|||
if (nargs < 0)
|
||||
return error_mark_node;
|
||||
|
||||
argarray = VEC_address (tree, *params);
|
||||
argarray = (*params)->address ();
|
||||
|
||||
/* Check for errors in format strings and inappropriately
|
||||
null parameters. */
|
||||
|
@ -3499,7 +3498,7 @@ warn_args_num (location_t loc, tree fndecl, bool too_many_p)
|
|||
default arguments, if such were specified. Do so here. */
|
||||
|
||||
static int
|
||||
convert_arguments (tree typelist, VEC(tree,gc) **values, tree fndecl,
|
||||
convert_arguments (tree typelist, vec<tree, va_gc> **values, tree fndecl,
|
||||
int flags, tsubst_flags_t complain)
|
||||
{
|
||||
tree typetail;
|
||||
|
@ -3509,11 +3508,11 @@ convert_arguments (tree typelist, VEC(tree,gc) **values, tree fndecl,
|
|||
flags |= LOOKUP_ONLYCONVERTING;
|
||||
|
||||
for (i = 0, typetail = typelist;
|
||||
i < VEC_length (tree, *values);
|
||||
i < vec_safe_length (*values);
|
||||
i++)
|
||||
{
|
||||
tree type = typetail ? TREE_VALUE (typetail) : 0;
|
||||
tree val = VEC_index (tree, *values, i);
|
||||
tree val = (**values)[i];
|
||||
|
||||
if (val == error_mark_node || type == error_mark_node)
|
||||
return -1;
|
||||
|
@ -3575,7 +3574,7 @@ convert_arguments (tree typelist, VEC(tree,gc) **values, tree fndecl,
|
|||
if (parmval == error_mark_node)
|
||||
return -1;
|
||||
|
||||
VEC_replace (tree, *values, i, parmval);
|
||||
(**values)[i] = parmval;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3588,7 +3587,7 @@ convert_arguments (tree typelist, VEC(tree,gc) **values, tree fndecl,
|
|||
else
|
||||
val = convert_arg_to_ellipsis (val, complain);
|
||||
|
||||
VEC_replace (tree, *values, i, val);
|
||||
(**values)[i] = val;
|
||||
}
|
||||
|
||||
if (typetail)
|
||||
|
@ -3617,7 +3616,7 @@ convert_arguments (tree typelist, VEC(tree,gc) **values, tree fndecl,
|
|||
if (parmval == error_mark_node)
|
||||
return -1;
|
||||
|
||||
VEC_safe_push (tree, gc, *values, parmval);
|
||||
vec_safe_push (*values, parmval);
|
||||
typetail = TREE_CHAIN (typetail);
|
||||
/* ends with `...'. */
|
||||
if (typetail == NULL_TREE)
|
||||
|
@ -5880,13 +5879,13 @@ build_x_compound_expr_from_list (tree list, expr_list_kind exp,
|
|||
/* Like build_x_compound_expr_from_list, but using a VEC. */
|
||||
|
||||
tree
|
||||
build_x_compound_expr_from_vec (VEC(tree,gc) *vec, const char *msg,
|
||||
build_x_compound_expr_from_vec (vec<tree, va_gc> *vec, const char *msg,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
if (VEC_empty (tree, vec))
|
||||
if (vec_safe_is_empty (vec))
|
||||
return NULL_TREE;
|
||||
else if (VEC_length (tree, vec) == 1)
|
||||
return VEC_index (tree, vec, 0);
|
||||
else if (vec->length () == 1)
|
||||
return (*vec)[0];
|
||||
else
|
||||
{
|
||||
tree expr;
|
||||
|
@ -5903,8 +5902,8 @@ build_x_compound_expr_from_vec (VEC(tree,gc) *vec, const char *msg,
|
|||
return error_mark_node;
|
||||
}
|
||||
|
||||
expr = VEC_index (tree, vec, 0);
|
||||
for (ix = 1; VEC_iterate (tree, vec, ix, t); ++ix)
|
||||
expr = (*vec)[0];
|
||||
for (ix = 1; vec->iterate (ix, &t); ++ix)
|
||||
expr = build_x_compound_expr (EXPR_LOCATION (t), expr,
|
||||
t, complain);
|
||||
|
||||
|
@ -7090,7 +7089,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
|
|||
/* Do the default thing. */;
|
||||
else
|
||||
{
|
||||
VEC(tree,gc) *rhs_vec = make_tree_vector_single (rhs);
|
||||
vec<tree, va_gc> *rhs_vec = make_tree_vector_single (rhs);
|
||||
result = build_special_member_call (lhs, complete_ctor_identifier,
|
||||
&rhs_vec, lhstype, LOOKUP_NORMAL,
|
||||
complain);
|
||||
|
@ -7457,7 +7456,7 @@ build_ptrmemfunc1 (tree type, tree delta, tree pfn)
|
|||
tree u = NULL_TREE;
|
||||
tree delta_field;
|
||||
tree pfn_field;
|
||||
VEC(constructor_elt, gc) *v;
|
||||
vec<constructor_elt, va_gc> *v;
|
||||
|
||||
/* Pull the FIELD_DECLs out of the type. */
|
||||
pfn_field = TYPE_FIELDS (type);
|
||||
|
@ -7470,7 +7469,7 @@ build_ptrmemfunc1 (tree type, tree delta, tree pfn)
|
|||
pfn = fold_convert (TREE_TYPE (pfn_field), pfn);
|
||||
|
||||
/* Finish creating the initializer. */
|
||||
v = VEC_alloc(constructor_elt, gc, 2);
|
||||
vec_alloc (v, 2);
|
||||
CONSTRUCTOR_APPEND_ELT(v, pfn_field, pfn);
|
||||
CONSTRUCTOR_APPEND_ELT(v, delta_field, delta);
|
||||
u = build_constructor (type, v);
|
||||
|
|
|
@ -253,7 +253,7 @@ complete_type_check_abstract (tree type)
|
|||
int
|
||||
abstract_virtuals_error_sfinae (tree decl, tree type, tsubst_flags_t complain)
|
||||
{
|
||||
VEC(tree,gc) *pure;
|
||||
vec<tree, va_gc> *pure;
|
||||
|
||||
/* This function applies only to classes. Any other entity can never
|
||||
be abstract. */
|
||||
|
@ -331,7 +331,7 @@ abstract_virtuals_error_sfinae (tree decl, tree type, tsubst_flags_t complain)
|
|||
error ("cannot allocate an object of abstract type %qT", type);
|
||||
|
||||
/* Only go through this once. */
|
||||
if (VEC_length (tree, pure))
|
||||
if (pure->length ())
|
||||
{
|
||||
unsigned ix;
|
||||
tree fn;
|
||||
|
@ -340,7 +340,7 @@ abstract_virtuals_error_sfinae (tree decl, tree type, tsubst_flags_t complain)
|
|||
" because the following virtual functions are pure within %qT:",
|
||||
type);
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, pure, ix, fn)
|
||||
FOR_EACH_VEC_ELT (*pure, ix, fn)
|
||||
if (! DECL_CLONED_FUNCTION_P (fn)
|
||||
|| DECL_COMPLETE_DESTRUCTOR_P (fn))
|
||||
inform (input_location, "\t%+#D", fn);
|
||||
|
@ -348,7 +348,7 @@ abstract_virtuals_error_sfinae (tree decl, tree type, tsubst_flags_t complain)
|
|||
/* Now truncate the vector. This leaves it non-null, so we know
|
||||
there are pure virtuals, but empty so we don't list them out
|
||||
again. */
|
||||
VEC_truncate (tree, pure, 0);
|
||||
pure->truncate (0);
|
||||
}
|
||||
else
|
||||
inform (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type)),
|
||||
|
@ -566,8 +566,7 @@ split_nonconstant_init_1 (tree dest, tree init)
|
|||
split_non_constant_init into process_init_constructor_array,
|
||||
that is separating constants from non-constants while building
|
||||
the vector. */
|
||||
VEC_ordered_remove (constructor_elt, CONSTRUCTOR_ELTS (init),
|
||||
idx);
|
||||
CONSTRUCTOR_ELTS (init)->ordered_remove (idx);
|
||||
--idx;
|
||||
|
||||
if (array_type_p)
|
||||
|
@ -661,7 +660,7 @@ split_nonconstant_init (tree dest, tree init)
|
|||
for static variable. In that case, caller must emit the code. */
|
||||
|
||||
tree
|
||||
store_init_value (tree decl, tree init, VEC(tree,gc)** cleanups, int flags)
|
||||
store_init_value (tree decl, tree init, vec<tree, va_gc>** cleanups, int flags)
|
||||
{
|
||||
tree value, type;
|
||||
|
||||
|
@ -1047,7 +1046,7 @@ process_init_constructor_array (tree type, tree init,
|
|||
int flags = 0;
|
||||
bool unbounded = false;
|
||||
constructor_elt *ce;
|
||||
VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (init);
|
||||
vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (init);
|
||||
|
||||
gcc_assert (TREE_CODE (type) == ARRAY_TYPE
|
||||
|| TREE_CODE (type) == VECTOR_TYPE);
|
||||
|
@ -1070,7 +1069,7 @@ process_init_constructor_array (tree type, tree init,
|
|||
len = TYPE_VECTOR_SUBPARTS (type);
|
||||
|
||||
/* There must not be more initializers than needed. */
|
||||
if (!unbounded && VEC_length (constructor_elt, v) > len)
|
||||
if (!unbounded && vec_safe_length (v) > len)
|
||||
{
|
||||
if (complain & tf_error)
|
||||
error ("too many initializers for %qT", type);
|
||||
|
@ -1078,7 +1077,7 @@ process_init_constructor_array (tree type, tree init,
|
|||
return PICFLAG_ERRONEOUS;
|
||||
}
|
||||
|
||||
FOR_EACH_VEC_ELT (constructor_elt, v, i, ce)
|
||||
FOR_EACH_VEC_SAFE_ELT (v, i, ce)
|
||||
{
|
||||
if (ce->index)
|
||||
{
|
||||
|
@ -1142,7 +1141,7 @@ static int
|
|||
process_init_constructor_record (tree type, tree init,
|
||||
tsubst_flags_t complain)
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = NULL;
|
||||
vec<constructor_elt, va_gc> *v = NULL;
|
||||
int flags = 0;
|
||||
tree field;
|
||||
unsigned HOST_WIDE_INT idx = 0;
|
||||
|
@ -1176,10 +1175,9 @@ process_init_constructor_record (tree type, tree init,
|
|||
if (DECL_BIT_FIELD_TYPE (field))
|
||||
type = DECL_BIT_FIELD_TYPE (field);
|
||||
|
||||
if (idx < VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)))
|
||||
if (idx < vec_safe_length (CONSTRUCTOR_ELTS (init)))
|
||||
{
|
||||
constructor_elt *ce = &VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (init), idx);
|
||||
constructor_elt *ce = &(*CONSTRUCTOR_ELTS (init))[idx];
|
||||
if (ce->index)
|
||||
{
|
||||
/* We can have either a FIELD_DECL or an IDENTIFIER_NODE. The
|
||||
|
@ -1269,7 +1267,7 @@ process_init_constructor_record (tree type, tree init,
|
|||
CONSTRUCTOR_APPEND_ELT (v, field, next);
|
||||
}
|
||||
|
||||
if (idx < VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)))
|
||||
if (idx < vec_safe_length (CONSTRUCTOR_ELTS (init)))
|
||||
{
|
||||
if (complain & tf_error)
|
||||
error ("too many initializers for %qT", type);
|
||||
|
@ -1293,19 +1291,19 @@ process_init_constructor_union (tree type, tree init,
|
|||
int len;
|
||||
|
||||
/* If the initializer was empty, use default zero initialization. */
|
||||
if (VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (init)))
|
||||
if (vec_safe_is_empty (CONSTRUCTOR_ELTS (init)))
|
||||
return 0;
|
||||
|
||||
len = VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init));
|
||||
len = CONSTRUCTOR_ELTS (init)->length ();
|
||||
if (len > 1)
|
||||
{
|
||||
if (!(complain & tf_error))
|
||||
return PICFLAG_ERRONEOUS;
|
||||
error ("too many initializers for %qT", type);
|
||||
VEC_block_remove (constructor_elt, CONSTRUCTOR_ELTS (init), 1, len-1);
|
||||
CONSTRUCTOR_ELTS (init)->block_remove (1, len-1);
|
||||
}
|
||||
|
||||
ce = &VEC_index (constructor_elt, CONSTRUCTOR_ELTS (init), 0);
|
||||
ce = &(*CONSTRUCTOR_ELTS (init))[0];
|
||||
|
||||
/* If this element specifies a field, initialize via that field. */
|
||||
if (ce->index)
|
||||
|
@ -1476,7 +1474,7 @@ build_x_arrow (location_t loc, tree expr, tsubst_flags_t complain)
|
|||
tree orig_expr = expr;
|
||||
tree type = TREE_TYPE (expr);
|
||||
tree last_rval = NULL_TREE;
|
||||
VEC(tree,gc) *types_memoized = NULL;
|
||||
vec<tree, va_gc> *types_memoized = NULL;
|
||||
|
||||
if (type == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
@ -1511,7 +1509,7 @@ build_x_arrow (location_t loc, tree expr, tsubst_flags_t complain)
|
|||
return error_mark_node;
|
||||
}
|
||||
|
||||
VEC_safe_push (tree, gc, types_memoized, TREE_TYPE (expr));
|
||||
vec_safe_push (types_memoized, TREE_TYPE (expr));
|
||||
last_rval = expr;
|
||||
}
|
||||
|
||||
|
@ -1665,7 +1663,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain)
|
|||
|
||||
/* The type to which we are casting. */
|
||||
tree type;
|
||||
VEC(tree,gc) *parmvec;
|
||||
vec<tree, va_gc> *parmvec;
|
||||
|
||||
if (exp == error_mark_node || parms == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
@ -1762,7 +1760,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain)
|
|||
/* Call the constructor. */
|
||||
parmvec = make_tree_vector ();
|
||||
for (; parms != NULL_TREE; parms = TREE_CHAIN (parms))
|
||||
VEC_safe_push (tree, gc, parmvec, TREE_VALUE (parms));
|
||||
vec_safe_push (parmvec, TREE_VALUE (parms));
|
||||
exp = build_special_member_call (NULL_TREE, complete_ctor_identifier,
|
||||
&parmvec, type, LOOKUP_NORMAL, complain);
|
||||
release_tree_vector (parmvec);
|
||||
|
|
|
@ -65,8 +65,6 @@ struct occr
|
|||
};
|
||||
|
||||
typedef struct occr *occr_t;
|
||||
DEF_VEC_P (occr_t);
|
||||
DEF_VEC_ALLOC_P (occr_t, heap);
|
||||
|
||||
/* Hash table entry for assignment expressions. */
|
||||
|
||||
|
|
|
@ -31,8 +31,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
static unsigned const BITS_PER_BITPACK_WORD = HOST_BITS_PER_WIDE_INT;
|
||||
|
||||
typedef unsigned HOST_WIDE_INT bitpack_word_t;
|
||||
DEF_VEC_I(bitpack_word_t);
|
||||
DEF_VEC_ALLOC_I(bitpack_word_t, heap);
|
||||
|
||||
struct bitpack_d
|
||||
{
|
||||
|
|
21
gcc/dbxout.c
21
gcc/dbxout.c
|
@ -2184,7 +2184,7 @@ dbxout_type (tree type, int full)
|
|||
{
|
||||
int i;
|
||||
tree child;
|
||||
VEC(tree,gc) *accesses = BINFO_BASE_ACCESSES (binfo);
|
||||
vec<tree, va_gc> *accesses = BINFO_BASE_ACCESSES (binfo);
|
||||
|
||||
if (use_gnu_debug_info_extensions)
|
||||
{
|
||||
|
@ -2197,8 +2197,7 @@ dbxout_type (tree type, int full)
|
|||
}
|
||||
for (i = 0; BINFO_BASE_ITERATE (binfo, i, child); i++)
|
||||
{
|
||||
tree access = (accesses ? VEC_index (tree, accesses, i)
|
||||
: access_public_node);
|
||||
tree access = (accesses ? (*accesses)[i] : access_public_node);
|
||||
|
||||
if (use_gnu_debug_info_extensions)
|
||||
{
|
||||
|
@ -2541,7 +2540,7 @@ static int
|
|||
output_used_types_helper (void **slot, void *data)
|
||||
{
|
||||
tree type = (tree) *slot;
|
||||
VEC(tree, heap) **types_p = (VEC(tree, heap) **) data;
|
||||
vec<tree> *types_p = (vec<tree> *) data;
|
||||
|
||||
if ((TREE_CODE (type) == RECORD_TYPE
|
||||
|| TREE_CODE (type) == UNION_TYPE
|
||||
|
@ -2550,10 +2549,10 @@ output_used_types_helper (void **slot, void *data)
|
|||
&& TYPE_STUB_DECL (type)
|
||||
&& DECL_P (TYPE_STUB_DECL (type))
|
||||
&& ! DECL_IGNORED_P (TYPE_STUB_DECL (type)))
|
||||
VEC_quick_push (tree, *types_p, TYPE_STUB_DECL (type));
|
||||
types_p->quick_push (TYPE_STUB_DECL (type));
|
||||
else if (TYPE_NAME (type)
|
||||
&& TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
|
||||
VEC_quick_push (tree, *types_p, TYPE_NAME (type));
|
||||
types_p->quick_push (TYPE_NAME (type));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -2593,20 +2592,20 @@ output_used_types (void)
|
|||
{
|
||||
if (cfun && cfun->used_types_hash)
|
||||
{
|
||||
VEC(tree, heap) *types;
|
||||
vec<tree> types;
|
||||
int i;
|
||||
tree type;
|
||||
|
||||
types = VEC_alloc (tree, heap, htab_elements (cfun->used_types_hash));
|
||||
types.create (htab_elements (cfun->used_types_hash));
|
||||
htab_traverse (cfun->used_types_hash, output_used_types_helper, &types);
|
||||
|
||||
/* Sort by UID to prevent dependence on hash table ordering. */
|
||||
VEC_qsort (tree, types, output_types_sort);
|
||||
types.qsort (output_types_sort);
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, types, i, type)
|
||||
FOR_EACH_VEC_ELT (types, i, type)
|
||||
debug_queue_symbol (type);
|
||||
|
||||
VEC_free (tree, heap, types);
|
||||
types.release ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
10
gcc/dce.c
10
gcc/dce.c
|
@ -52,7 +52,7 @@ static bool can_alter_cfg = false;
|
|||
|
||||
/* Instructions that have been marked but whose dependencies have not
|
||||
yet been processed. */
|
||||
static VEC(rtx,heap) *worklist;
|
||||
static vec<rtx> worklist;
|
||||
|
||||
/* Bitmap of instructions marked as needed indexed by INSN_UID. */
|
||||
static sbitmap marked;
|
||||
|
@ -182,7 +182,7 @@ mark_insn (rtx insn, bool fast)
|
|||
if (!marked_insn_p (insn))
|
||||
{
|
||||
if (!fast)
|
||||
VEC_safe_push (rtx, heap, worklist, insn);
|
||||
worklist.safe_push (insn);
|
||||
bitmap_set_bit (marked, INSN_UID (insn));
|
||||
if (dump_file)
|
||||
fprintf (dump_file, " Adding insn %d to worklist\n", INSN_UID (insn));
|
||||
|
@ -760,12 +760,12 @@ rest_of_handle_ud_dce (void)
|
|||
|
||||
prescan_insns_for_dce (false);
|
||||
mark_artificial_uses ();
|
||||
while (VEC_length (rtx, worklist) > 0)
|
||||
while (worklist.length () > 0)
|
||||
{
|
||||
insn = VEC_pop (rtx, worklist);
|
||||
insn = worklist.pop ();
|
||||
mark_reg_dependencies (insn);
|
||||
}
|
||||
VEC_free (rtx, heap, worklist);
|
||||
worklist.release ();
|
||||
|
||||
if (MAY_HAVE_DEBUG_INSNS)
|
||||
reset_unmarked_insns_debug_uses ();
|
||||
|
|
|
@ -991,12 +991,12 @@ df_worklist_dataflow_doublequeue (struct dataflow *dataflow,
|
|||
bitmap worklist = BITMAP_ALLOC (&df_bitmap_obstack);
|
||||
int age = 0;
|
||||
bool changed;
|
||||
VEC(int, heap) *last_visit_age = NULL;
|
||||
vec<int> last_visit_age = vec<int>();
|
||||
int prev_age;
|
||||
basic_block bb;
|
||||
int i;
|
||||
|
||||
VEC_safe_grow_cleared (int, heap, last_visit_age, n_blocks);
|
||||
last_visit_age.safe_grow_cleared (n_blocks);
|
||||
|
||||
/* Double-queueing. Worklist is for the current iteration,
|
||||
and pending is for the next. */
|
||||
|
@ -1018,7 +1018,7 @@ df_worklist_dataflow_doublequeue (struct dataflow *dataflow,
|
|||
bitmap_clear_bit (pending, index);
|
||||
bb_index = blocks_in_postorder[index];
|
||||
bb = BASIC_BLOCK (bb_index);
|
||||
prev_age = VEC_index (int, last_visit_age, index);
|
||||
prev_age = last_visit_age[index];
|
||||
if (dir == DF_FORWARD)
|
||||
changed = df_worklist_propagate_forward (dataflow, bb_index,
|
||||
bbindex_to_postorder,
|
||||
|
@ -1029,7 +1029,7 @@ df_worklist_dataflow_doublequeue (struct dataflow *dataflow,
|
|||
bbindex_to_postorder,
|
||||
pending, considered,
|
||||
prev_age);
|
||||
VEC_replace (int, last_visit_age, index, ++age);
|
||||
last_visit_age[index] = ++age;
|
||||
if (changed)
|
||||
bb->aux = (void *)(ptrdiff_t)age;
|
||||
}
|
||||
|
@ -1040,7 +1040,7 @@ df_worklist_dataflow_doublequeue (struct dataflow *dataflow,
|
|||
|
||||
BITMAP_FREE (worklist);
|
||||
BITMAP_FREE (pending);
|
||||
VEC_free (int, heap, last_visit_age);
|
||||
last_visit_age.release ();
|
||||
|
||||
/* Dump statistics. */
|
||||
if (dump_file)
|
||||
|
|
|
@ -43,7 +43,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "df.h"
|
||||
#include "except.h"
|
||||
#include "dce.h"
|
||||
#include "vecprim.h"
|
||||
#include "valtrack.h"
|
||||
#include "dumpfile.h"
|
||||
|
||||
|
|
215
gcc/df-scan.c
215
gcc/df-scan.c
|
@ -45,18 +45,9 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "df.h"
|
||||
#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
|
||||
|
||||
DEF_VEC_P(df_ref);
|
||||
DEF_VEC_ALLOC_P_STACK(df_ref);
|
||||
|
||||
#define VEC_df_ref_stack_alloc(alloc) VEC_stack_alloc (df_ref, alloc)
|
||||
|
||||
typedef struct df_mw_hardreg *df_mw_hardreg_ptr;
|
||||
|
||||
DEF_VEC_P(df_mw_hardreg_ptr);
|
||||
DEF_VEC_ALLOC_P_STACK(df_mw_hardreg_ptr);
|
||||
|
||||
#define VEC_df_mw_hardreg_ptr_stack_alloc(alloc) \
|
||||
VEC_stack_alloc (df_mw_hardreg_ptr, alloc)
|
||||
|
||||
#ifndef HAVE_epilogue
|
||||
#define HAVE_epilogue 0
|
||||
|
@ -96,10 +87,10 @@ static HARD_REG_SET elim_reg_set;
|
|||
|
||||
struct df_collection_rec
|
||||
{
|
||||
VEC(df_ref,stack) *def_vec;
|
||||
VEC(df_ref,stack) *use_vec;
|
||||
VEC(df_ref,stack) *eq_use_vec;
|
||||
VEC(df_mw_hardreg_ptr,stack) *mw_vec;
|
||||
vec<df_ref, va_stack> def_vec;
|
||||
vec<df_ref, va_stack> use_vec;
|
||||
vec<df_ref, va_stack> eq_use_vec;
|
||||
vec<df_mw_hardreg_ptr, va_stack> mw_vec;
|
||||
};
|
||||
|
||||
static df_ref df_null_ref_rec[1];
|
||||
|
@ -1181,19 +1172,19 @@ df_free_collection_rec (struct df_collection_rec *collection_rec)
|
|||
df_ref ref;
|
||||
struct df_mw_hardreg *mw;
|
||||
|
||||
FOR_EACH_VEC_ELT (df_ref, collection_rec->def_vec, ix, ref)
|
||||
FOR_EACH_VEC_ELT (collection_rec->def_vec, ix, ref)
|
||||
df_free_ref (ref);
|
||||
FOR_EACH_VEC_ELT (df_ref, collection_rec->use_vec, ix, ref)
|
||||
FOR_EACH_VEC_ELT (collection_rec->use_vec, ix, ref)
|
||||
df_free_ref (ref);
|
||||
FOR_EACH_VEC_ELT (df_ref, collection_rec->eq_use_vec, ix, ref)
|
||||
FOR_EACH_VEC_ELT (collection_rec->eq_use_vec, ix, ref)
|
||||
df_free_ref (ref);
|
||||
FOR_EACH_VEC_ELT (df_mw_hardreg_ptr, collection_rec->mw_vec, ix, mw)
|
||||
FOR_EACH_VEC_ELT (collection_rec->mw_vec, ix, mw)
|
||||
pool_free (problem_data->mw_reg_pool, mw);
|
||||
|
||||
VEC_free (df_ref, stack, collection_rec->def_vec);
|
||||
VEC_free (df_ref, stack, collection_rec->use_vec);
|
||||
VEC_free (df_ref, stack, collection_rec->eq_use_vec);
|
||||
VEC_free (df_mw_hardreg_ptr, stack, collection_rec->mw_vec);
|
||||
collection_rec->def_vec.release ();
|
||||
collection_rec->use_vec.release ();
|
||||
collection_rec->eq_use_vec.release ();
|
||||
collection_rec->mw_vec.release ();
|
||||
}
|
||||
|
||||
/* Rescan INSN. Return TRUE if the rescanning produced any changes. */
|
||||
|
@ -1245,10 +1236,10 @@ df_insn_rescan (rtx insn)
|
|||
return false;
|
||||
}
|
||||
|
||||
collection_rec.def_vec = VEC_alloc (df_ref, stack, 128);
|
||||
collection_rec.use_vec = VEC_alloc (df_ref, stack, 32);
|
||||
collection_rec.eq_use_vec = VEC_alloc (df_ref, stack, 32);
|
||||
collection_rec.mw_vec = VEC_alloc (df_mw_hardreg_ptr, stack, 32);
|
||||
vec_stack_alloc (df_ref, collection_rec.def_vec, 128);
|
||||
vec_stack_alloc (df_ref, collection_rec.use_vec, 32);
|
||||
vec_stack_alloc (df_ref, collection_rec.eq_use_vec, 32);
|
||||
vec_stack_alloc (df_mw_hardreg_ptr, collection_rec.mw_vec, 32);
|
||||
|
||||
bitmap_clear_bit (&df->insns_to_delete, uid);
|
||||
bitmap_clear_bit (&df->insns_to_rescan, uid);
|
||||
|
@ -1287,10 +1278,10 @@ df_insn_rescan (rtx insn)
|
|||
if (!DEBUG_INSN_P (insn))
|
||||
df_set_bb_dirty (bb);
|
||||
|
||||
VEC_free (df_ref, stack, collection_rec.def_vec);
|
||||
VEC_free (df_ref, stack, collection_rec.use_vec);
|
||||
VEC_free (df_ref, stack, collection_rec.eq_use_vec);
|
||||
VEC_free (df_mw_hardreg_ptr, stack, collection_rec.mw_vec);
|
||||
collection_rec.def_vec.release ();
|
||||
collection_rec.use_vec.release ();
|
||||
collection_rec.eq_use_vec.release ();
|
||||
collection_rec.mw_vec.release ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2198,8 +2189,8 @@ df_notes_rescan (rtx insn)
|
|||
unsigned int mw_len;
|
||||
|
||||
memset (&collection_rec, 0, sizeof (struct df_collection_rec));
|
||||
collection_rec.eq_use_vec = VEC_alloc (df_ref, stack, 32);
|
||||
collection_rec.mw_vec = VEC_alloc (df_mw_hardreg_ptr, stack, 32);
|
||||
vec_stack_alloc (df_ref, collection_rec.eq_use_vec, 32);
|
||||
vec_stack_alloc (df_mw_hardreg_ptr, collection_rec.mw_vec, 32);
|
||||
|
||||
num_deleted = df_mw_hardreg_chain_delete_eq_uses (insn_info);
|
||||
df_ref_chain_delete (insn_info->eq_uses);
|
||||
|
@ -2223,7 +2214,7 @@ df_notes_rescan (rtx insn)
|
|||
|
||||
/* Find some place to put any new mw_hardregs. */
|
||||
df_canonize_collection_rec (&collection_rec);
|
||||
mw_len = VEC_length (df_mw_hardreg_ptr, collection_rec.mw_vec);
|
||||
mw_len = collection_rec.mw_vec.length ();
|
||||
if (mw_len)
|
||||
{
|
||||
unsigned int count = 0;
|
||||
|
@ -2246,7 +2237,7 @@ df_notes_rescan (rtx insn)
|
|||
count + 1 + mw_len);
|
||||
}
|
||||
memcpy (&insn_info->mw_hardregs[count],
|
||||
VEC_address (df_mw_hardreg_ptr, collection_rec.mw_vec),
|
||||
collection_rec.mw_vec.address (),
|
||||
mw_len * sizeof (struct df_mw_hardreg *));
|
||||
insn_info->mw_hardregs[count + mw_len] = NULL;
|
||||
qsort (insn_info->mw_hardregs, count + mw_len,
|
||||
|
@ -2258,16 +2249,16 @@ df_notes_rescan (rtx insn)
|
|||
insn_info->mw_hardregs
|
||||
= XNEWVEC (struct df_mw_hardreg*, 1 + mw_len);
|
||||
memcpy (insn_info->mw_hardregs,
|
||||
VEC_address (df_mw_hardreg_ptr, collection_rec.mw_vec),
|
||||
collection_rec.mw_vec.address (),
|
||||
mw_len * sizeof (struct df_mw_hardreg *));
|
||||
insn_info->mw_hardregs[mw_len] = NULL;
|
||||
}
|
||||
}
|
||||
/* Get rid of the mw_rec so that df_refs_add_to_chains will
|
||||
ignore it. */
|
||||
VEC_free (df_mw_hardreg_ptr, stack, collection_rec.mw_vec);
|
||||
collection_rec.mw_vec.release ();
|
||||
df_refs_add_to_chains (&collection_rec, bb, insn);
|
||||
VEC_free (df_ref, stack, collection_rec.eq_use_vec);
|
||||
collection_rec.eq_use_vec.release ();
|
||||
}
|
||||
else
|
||||
df_insn_rescan (insn);
|
||||
|
@ -2367,31 +2358,31 @@ df_ref_compare (const void *r1, const void *r2)
|
|||
}
|
||||
|
||||
static void
|
||||
df_swap_refs (VEC(df_ref,stack) **ref_vec, int i, int j)
|
||||
df_swap_refs (vec<df_ref, va_stack> *ref_vec, int i, int j)
|
||||
{
|
||||
df_ref tmp = VEC_index (df_ref, *ref_vec, i);
|
||||
VEC_replace (df_ref, *ref_vec, i, VEC_index (df_ref, *ref_vec, j));
|
||||
VEC_replace (df_ref, *ref_vec, j, tmp);
|
||||
df_ref tmp = (*ref_vec)[i];
|
||||
(*ref_vec)[i] = (*ref_vec)[j];
|
||||
(*ref_vec)[j] = tmp;
|
||||
}
|
||||
|
||||
/* Sort and compress a set of refs. */
|
||||
|
||||
static void
|
||||
df_sort_and_compress_refs (VEC(df_ref,stack) **ref_vec)
|
||||
df_sort_and_compress_refs (vec<df_ref, va_stack> *ref_vec)
|
||||
{
|
||||
unsigned int count;
|
||||
unsigned int i;
|
||||
unsigned int dist = 0;
|
||||
|
||||
count = VEC_length (df_ref, *ref_vec);
|
||||
count = ref_vec->length ();
|
||||
|
||||
/* If there are 1 or 0 elements, there is nothing to do. */
|
||||
if (count < 2)
|
||||
return;
|
||||
else if (count == 2)
|
||||
{
|
||||
df_ref r0 = VEC_index (df_ref, *ref_vec, 0);
|
||||
df_ref r1 = VEC_index (df_ref, *ref_vec, 1);
|
||||
df_ref r0 = (*ref_vec)[0];
|
||||
df_ref r1 = (*ref_vec)[1];
|
||||
if (df_ref_compare (&r0, &r1) > 0)
|
||||
df_swap_refs (ref_vec, 0, 1);
|
||||
}
|
||||
|
@ -2399,8 +2390,8 @@ df_sort_and_compress_refs (VEC(df_ref,stack) **ref_vec)
|
|||
{
|
||||
for (i = 0; i < count - 1; i++)
|
||||
{
|
||||
df_ref r0 = VEC_index (df_ref, *ref_vec, i);
|
||||
df_ref r1 = VEC_index (df_ref, *ref_vec, i + 1);
|
||||
df_ref r0 = (*ref_vec)[i];
|
||||
df_ref r1 = (*ref_vec)[i + 1];
|
||||
if (df_ref_compare (&r0, &r1) >= 0)
|
||||
break;
|
||||
}
|
||||
|
@ -2413,27 +2404,26 @@ df_sort_and_compress_refs (VEC(df_ref,stack) **ref_vec)
|
|||
of DF_REF_COMPARE. */
|
||||
if (i == count - 1)
|
||||
return;
|
||||
VEC_qsort (df_ref, *ref_vec, df_ref_compare);
|
||||
ref_vec->qsort (df_ref_compare);
|
||||
}
|
||||
|
||||
for (i=0; i<count-dist; i++)
|
||||
{
|
||||
/* Find the next ref that is not equal to the current ref. */
|
||||
while (i + dist + 1 < count
|
||||
&& df_ref_equal_p (VEC_index (df_ref, *ref_vec, i),
|
||||
VEC_index (df_ref, *ref_vec, i + dist + 1)))
|
||||
&& df_ref_equal_p ((*ref_vec)[i],
|
||||
(*ref_vec)[i + dist + 1]))
|
||||
{
|
||||
df_free_ref (VEC_index (df_ref, *ref_vec, i + dist + 1));
|
||||
df_free_ref ((*ref_vec)[i + dist + 1]);
|
||||
dist++;
|
||||
}
|
||||
/* Copy it down to the next position. */
|
||||
if (dist && i + dist + 1 < count)
|
||||
VEC_replace (df_ref, *ref_vec, i + 1,
|
||||
VEC_index (df_ref, *ref_vec, i + dist + 1));
|
||||
(*ref_vec)[i + 1] = (*ref_vec)[i + dist + 1];
|
||||
}
|
||||
|
||||
count -= dist;
|
||||
VEC_truncate (df_ref, *ref_vec, count);
|
||||
ref_vec->truncate (count);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2487,7 +2477,7 @@ df_mw_compare (const void *m1, const void *m2)
|
|||
/* Sort and compress a set of refs. */
|
||||
|
||||
static void
|
||||
df_sort_and_compress_mws (VEC(df_mw_hardreg_ptr,stack) **mw_vec)
|
||||
df_sort_and_compress_mws (vec<df_mw_hardreg_ptr, va_stack> *mw_vec)
|
||||
{
|
||||
unsigned int count;
|
||||
struct df_scan_problem_data *problem_data
|
||||
|
@ -2495,45 +2485,40 @@ df_sort_and_compress_mws (VEC(df_mw_hardreg_ptr,stack) **mw_vec)
|
|||
unsigned int i;
|
||||
unsigned int dist = 0;
|
||||
|
||||
count = VEC_length (df_mw_hardreg_ptr, *mw_vec);
|
||||
count = mw_vec->length ();
|
||||
if (count < 2)
|
||||
return;
|
||||
else if (count == 2)
|
||||
{
|
||||
struct df_mw_hardreg *m0 = VEC_index (df_mw_hardreg_ptr, *mw_vec, 0);
|
||||
struct df_mw_hardreg *m1 = VEC_index (df_mw_hardreg_ptr, *mw_vec, 1);
|
||||
struct df_mw_hardreg *m0 = (*mw_vec)[0];
|
||||
struct df_mw_hardreg *m1 = (*mw_vec)[1];
|
||||
if (df_mw_compare (&m0, &m1) > 0)
|
||||
{
|
||||
struct df_mw_hardreg *tmp = VEC_index (df_mw_hardreg_ptr,
|
||||
*mw_vec, 0);
|
||||
VEC_replace (df_mw_hardreg_ptr, *mw_vec, 0,
|
||||
VEC_index (df_mw_hardreg_ptr, *mw_vec, 1));
|
||||
VEC_replace (df_mw_hardreg_ptr, *mw_vec, 1, tmp);
|
||||
struct df_mw_hardreg *tmp = (*mw_vec)[0];
|
||||
(*mw_vec)[0] = (*mw_vec)[1];
|
||||
(*mw_vec)[1] = tmp;
|
||||
}
|
||||
}
|
||||
else
|
||||
VEC_qsort (df_mw_hardreg_ptr, *mw_vec, df_mw_compare);
|
||||
mw_vec->qsort (df_mw_compare);
|
||||
|
||||
for (i=0; i<count-dist; i++)
|
||||
{
|
||||
/* Find the next ref that is not equal to the current ref. */
|
||||
while (i + dist + 1 < count
|
||||
&& df_mw_equal_p (VEC_index (df_mw_hardreg_ptr, *mw_vec, i),
|
||||
VEC_index (df_mw_hardreg_ptr, *mw_vec,
|
||||
i + dist + 1)))
|
||||
&& df_mw_equal_p ((*mw_vec)[i], (*mw_vec)[i + dist + 1]))
|
||||
{
|
||||
pool_free (problem_data->mw_reg_pool,
|
||||
VEC_index (df_mw_hardreg_ptr, *mw_vec, i + dist + 1));
|
||||
(*mw_vec)[i + dist + 1]);
|
||||
dist++;
|
||||
}
|
||||
/* Copy it down to the next position. */
|
||||
if (dist && i + dist + 1 < count)
|
||||
VEC_replace (df_mw_hardreg_ptr, *mw_vec, i + 1,
|
||||
VEC_index (df_mw_hardreg_ptr, *mw_vec, i + dist + 1));
|
||||
(*mw_vec)[i + 1] = (*mw_vec)[i + dist + 1];
|
||||
}
|
||||
|
||||
count -= dist;
|
||||
VEC_truncate (df_mw_hardreg_ptr, *mw_vec, count);
|
||||
mw_vec->truncate (count);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2603,14 +2588,14 @@ df_install_ref (df_ref this_ref,
|
|||
|
||||
static df_ref *
|
||||
df_install_refs (basic_block bb,
|
||||
VEC(df_ref,stack)* old_vec,
|
||||
vec<df_ref, va_stack> old_vec,
|
||||
struct df_reg_info **reg_info,
|
||||
struct df_ref_info *ref_info,
|
||||
bool is_notes)
|
||||
{
|
||||
unsigned int count;
|
||||
|
||||
count = VEC_length (df_ref, old_vec);
|
||||
count = old_vec.length ();
|
||||
if (count)
|
||||
{
|
||||
df_ref *new_vec = XNEWVEC (df_ref, count + 1);
|
||||
|
@ -2641,7 +2626,7 @@ df_install_refs (basic_block bb,
|
|||
if (add_to_table && df->analyze_subset)
|
||||
add_to_table = bitmap_bit_p (df->blocks_to_analyze, bb->index);
|
||||
|
||||
FOR_EACH_VEC_ELT (df_ref, old_vec, ix, this_ref)
|
||||
FOR_EACH_VEC_ELT (old_vec, ix, this_ref)
|
||||
{
|
||||
new_vec[ix] = this_ref;
|
||||
df_install_ref (this_ref, reg_info[DF_REF_REGNO (this_ref)],
|
||||
|
@ -2660,16 +2645,16 @@ df_install_refs (basic_block bb,
|
|||
insn. */
|
||||
|
||||
static struct df_mw_hardreg **
|
||||
df_install_mws (VEC(df_mw_hardreg_ptr,stack) *old_vec)
|
||||
df_install_mws (vec<df_mw_hardreg_ptr, va_stack> old_vec)
|
||||
{
|
||||
unsigned int count;
|
||||
|
||||
count = VEC_length (df_mw_hardreg_ptr, old_vec);
|
||||
count = old_vec.length ();
|
||||
if (count)
|
||||
{
|
||||
struct df_mw_hardreg **new_vec
|
||||
= XNEWVEC (struct df_mw_hardreg*, count + 1);
|
||||
memcpy (new_vec, VEC_address (df_mw_hardreg_ptr, old_vec),
|
||||
memcpy (new_vec, old_vec.address (),
|
||||
sizeof (struct df_mw_hardreg*) * count);
|
||||
new_vec[count] = NULL;
|
||||
return new_vec;
|
||||
|
@ -2692,7 +2677,7 @@ df_refs_add_to_chains (struct df_collection_rec *collection_rec,
|
|||
/* If there is a vector in the collection rec, add it to the
|
||||
insn. A null rec is a signal that the caller will handle the
|
||||
chain specially. */
|
||||
if (collection_rec->def_vec)
|
||||
if (collection_rec->def_vec.exists ())
|
||||
{
|
||||
df_scan_free_ref_vec (insn_rec->defs);
|
||||
insn_rec->defs
|
||||
|
@ -2700,7 +2685,7 @@ df_refs_add_to_chains (struct df_collection_rec *collection_rec,
|
|||
df->def_regs,
|
||||
&df->def_info, false);
|
||||
}
|
||||
if (collection_rec->use_vec)
|
||||
if (collection_rec->use_vec.exists ())
|
||||
{
|
||||
df_scan_free_ref_vec (insn_rec->uses);
|
||||
insn_rec->uses
|
||||
|
@ -2708,7 +2693,7 @@ df_refs_add_to_chains (struct df_collection_rec *collection_rec,
|
|||
df->use_regs,
|
||||
&df->use_info, false);
|
||||
}
|
||||
if (collection_rec->eq_use_vec)
|
||||
if (collection_rec->eq_use_vec.exists ())
|
||||
{
|
||||
df_scan_free_ref_vec (insn_rec->eq_uses);
|
||||
insn_rec->eq_uses
|
||||
|
@ -2716,7 +2701,7 @@ df_refs_add_to_chains (struct df_collection_rec *collection_rec,
|
|||
df->eq_use_regs,
|
||||
&df->use_info, true);
|
||||
}
|
||||
if (collection_rec->mw_vec)
|
||||
if (collection_rec->mw_vec.exists ())
|
||||
{
|
||||
df_scan_free_mws_vec (insn_rec->mw_hardregs);
|
||||
insn_rec->mw_hardregs
|
||||
|
@ -2812,11 +2797,11 @@ df_ref_create_structure (enum df_ref_class cl,
|
|||
if (collection_rec)
|
||||
{
|
||||
if (DF_REF_REG_DEF_P (this_ref))
|
||||
VEC_safe_push (df_ref, stack, collection_rec->def_vec, this_ref);
|
||||
collection_rec->def_vec.safe_push (this_ref);
|
||||
else if (DF_REF_FLAGS (this_ref) & DF_REF_IN_NOTE)
|
||||
VEC_safe_push (df_ref, stack, collection_rec->eq_use_vec, this_ref);
|
||||
collection_rec->eq_use_vec.safe_push (this_ref);
|
||||
else
|
||||
VEC_safe_push (df_ref, stack, collection_rec->use_vec, this_ref);
|
||||
collection_rec->use_vec.safe_push (this_ref);
|
||||
}
|
||||
else
|
||||
df_install_ref_incremental (this_ref);
|
||||
|
@ -2879,8 +2864,7 @@ df_ref_record (enum df_ref_class cl,
|
|||
hardreg->start_regno = regno;
|
||||
hardreg->end_regno = endregno - 1;
|
||||
hardreg->mw_order = df->ref_order++;
|
||||
VEC_safe_push (df_mw_hardreg_ptr, stack, collection_rec->mw_vec,
|
||||
hardreg);
|
||||
collection_rec->mw_vec.safe_push (hardreg);
|
||||
}
|
||||
|
||||
for (i = regno; i < endregno; i++)
|
||||
|
@ -3352,7 +3336,7 @@ df_get_conditional_uses (struct df_collection_rec *collection_rec)
|
|||
unsigned int ix;
|
||||
df_ref ref;
|
||||
|
||||
FOR_EACH_VEC_ELT (df_ref, collection_rec->def_vec, ix, ref)
|
||||
FOR_EACH_VEC_ELT (collection_rec->def_vec, ix, ref)
|
||||
{
|
||||
if (DF_REF_FLAGS_IS_SET (ref, DF_REF_CONDITIONAL))
|
||||
{
|
||||
|
@ -3458,10 +3442,10 @@ df_insn_refs_collect (struct df_collection_rec *collection_rec,
|
|||
bool is_cond_exec = (GET_CODE (PATTERN (insn_info->insn)) == COND_EXEC);
|
||||
|
||||
/* Clear out the collection record. */
|
||||
VEC_truncate (df_ref, collection_rec->def_vec, 0);
|
||||
VEC_truncate (df_ref, collection_rec->use_vec, 0);
|
||||
VEC_truncate (df_ref, collection_rec->eq_use_vec, 0);
|
||||
VEC_truncate (df_mw_hardreg_ptr, collection_rec->mw_vec, 0);
|
||||
collection_rec->def_vec.truncate (0);
|
||||
collection_rec->use_vec.truncate (0);
|
||||
collection_rec->eq_use_vec.truncate (0);
|
||||
collection_rec->mw_vec.truncate (0);
|
||||
|
||||
/* Process REG_EQUIV/REG_EQUAL notes. */
|
||||
for (note = REG_NOTES (insn_info->insn); note;
|
||||
|
@ -3550,10 +3534,10 @@ df_recompute_luids (basic_block bb)
|
|||
static void
|
||||
df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
|
||||
{
|
||||
VEC_truncate (df_ref, collection_rec->def_vec, 0);
|
||||
VEC_truncate (df_ref, collection_rec->use_vec, 0);
|
||||
VEC_truncate (df_ref, collection_rec->eq_use_vec, 0);
|
||||
VEC_truncate (df_mw_hardreg_ptr, collection_rec->mw_vec, 0);
|
||||
collection_rec->def_vec.truncate (0);
|
||||
collection_rec->use_vec.truncate (0);
|
||||
collection_rec->eq_use_vec.truncate (0);
|
||||
collection_rec->mw_vec.truncate (0);
|
||||
|
||||
if (bb->index == ENTRY_BLOCK)
|
||||
{
|
||||
|
@ -3622,10 +3606,10 @@ df_bb_refs_record (int bb_index, bool scan_insns)
|
|||
return;
|
||||
|
||||
df_grow_bb_info (df_scan);
|
||||
collection_rec.def_vec = VEC_alloc (df_ref, stack, 128);
|
||||
collection_rec.use_vec = VEC_alloc (df_ref, stack, 32);
|
||||
collection_rec.eq_use_vec = VEC_alloc (df_ref, stack, 32);
|
||||
collection_rec.mw_vec = VEC_alloc (df_mw_hardreg_ptr, stack, 32);
|
||||
vec_stack_alloc (df_ref, collection_rec.def_vec, 128);
|
||||
vec_stack_alloc (df_ref, collection_rec.use_vec, 32);
|
||||
vec_stack_alloc (df_ref, collection_rec.eq_use_vec, 32);
|
||||
vec_stack_alloc (df_mw_hardreg_ptr, collection_rec.mw_vec, 32);
|
||||
|
||||
if (scan_insns)
|
||||
/* Scan the block an insn at a time from beginning to end. */
|
||||
|
@ -3649,10 +3633,10 @@ df_bb_refs_record (int bb_index, bool scan_insns)
|
|||
df_bb_refs_collect (&collection_rec, bb);
|
||||
df_refs_add_to_chains (&collection_rec, bb, NULL);
|
||||
|
||||
VEC_free (df_ref, stack, collection_rec.def_vec);
|
||||
VEC_free (df_ref, stack, collection_rec.use_vec);
|
||||
VEC_free (df_ref, stack, collection_rec.eq_use_vec);
|
||||
VEC_free (df_mw_hardreg_ptr, stack, collection_rec.mw_vec);
|
||||
collection_rec.def_vec.release ();
|
||||
collection_rec.use_vec.release ();
|
||||
collection_rec.eq_use_vec.release ();
|
||||
collection_rec.mw_vec.release ();
|
||||
|
||||
/* Now that the block has been processed, set the block as dirty so
|
||||
LR and LIVE will get it processed. */
|
||||
|
@ -3895,12 +3879,12 @@ df_record_entry_block_defs (bitmap entry_block_defs)
|
|||
{
|
||||
struct df_collection_rec collection_rec;
|
||||
memset (&collection_rec, 0, sizeof (struct df_collection_rec));
|
||||
collection_rec.def_vec = VEC_alloc (df_ref, stack, FIRST_PSEUDO_REGISTER);
|
||||
vec_stack_alloc (df_ref, collection_rec.def_vec, FIRST_PSEUDO_REGISTER);
|
||||
df_entry_block_defs_collect (&collection_rec, entry_block_defs);
|
||||
|
||||
/* Process bb_refs chain */
|
||||
df_refs_add_to_chains (&collection_rec, BASIC_BLOCK (ENTRY_BLOCK), NULL);
|
||||
VEC_free (df_ref, stack, collection_rec.def_vec);
|
||||
collection_rec.def_vec.release ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -4068,13 +4052,12 @@ df_record_exit_block_uses (bitmap exit_block_uses)
|
|||
{
|
||||
struct df_collection_rec collection_rec;
|
||||
memset (&collection_rec, 0, sizeof (struct df_collection_rec));
|
||||
collection_rec.use_vec = VEC_alloc (df_ref, stack, FIRST_PSEUDO_REGISTER);
|
||||
|
||||
vec_stack_alloc (df_ref, collection_rec.use_vec, FIRST_PSEUDO_REGISTER);
|
||||
df_exit_block_uses_collect (&collection_rec, exit_block_uses);
|
||||
|
||||
/* Process bb_refs chain */
|
||||
df_refs_add_to_chains (&collection_rec, BASIC_BLOCK (EXIT_BLOCK), NULL);
|
||||
VEC_free (df_ref, stack, collection_rec.use_vec);
|
||||
collection_rec.use_vec.release ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -4251,7 +4234,7 @@ df_compute_regs_ever_live (bool reset)
|
|||
|
||||
df_reg_chain_mark (refs, regno, is_def, is_eq_use)
|
||||
df_reg_chain_verify_unmarked (refs)
|
||||
df_refs_verify (VEC(stack,df_ref)*, ref*, bool)
|
||||
df_refs_verify (vec<stack, va_df_ref>, ref*, bool)
|
||||
df_mws_verify (mw*, mw*, bool)
|
||||
df_insn_refs_verify (collection_rec, bb, insn, bool)
|
||||
df_bb_refs_verify (bb, refs, bool)
|
||||
|
@ -4315,13 +4298,13 @@ df_reg_chain_verify_unmarked (df_ref refs)
|
|||
/* Verify that NEW_REC and OLD_REC have exactly the same members. */
|
||||
|
||||
static bool
|
||||
df_refs_verify (VEC(df_ref,stack) *new_rec, df_ref *old_rec,
|
||||
df_refs_verify (vec<df_ref, va_stack> new_rec, df_ref *old_rec,
|
||||
bool abort_if_fail)
|
||||
{
|
||||
unsigned int ix;
|
||||
df_ref new_ref;
|
||||
|
||||
FOR_EACH_VEC_ELT (df_ref, new_rec, ix, new_ref)
|
||||
FOR_EACH_VEC_ELT (new_rec, ix, new_ref)
|
||||
{
|
||||
if (*old_rec == NULL || !df_ref_equal_p (new_ref, *old_rec))
|
||||
{
|
||||
|
@ -4353,14 +4336,14 @@ df_refs_verify (VEC(df_ref,stack) *new_rec, df_ref *old_rec,
|
|||
/* Verify that NEW_REC and OLD_REC have exactly the same members. */
|
||||
|
||||
static bool
|
||||
df_mws_verify (VEC(df_mw_hardreg_ptr,stack) *new_rec,
|
||||
df_mws_verify (vec<df_mw_hardreg_ptr, va_stack> new_rec,
|
||||
struct df_mw_hardreg **old_rec,
|
||||
bool abort_if_fail)
|
||||
{
|
||||
unsigned int ix;
|
||||
struct df_mw_hardreg *new_reg;
|
||||
|
||||
FOR_EACH_VEC_ELT (df_mw_hardreg_ptr, new_rec, ix, new_reg)
|
||||
FOR_EACH_VEC_ELT (new_rec, ix, new_reg)
|
||||
{
|
||||
if (*old_rec == NULL || !df_mw_equal_p (new_reg, *old_rec))
|
||||
{
|
||||
|
@ -4438,10 +4421,10 @@ df_bb_verify (basic_block bb)
|
|||
struct df_collection_rec collection_rec;
|
||||
|
||||
memset (&collection_rec, 0, sizeof (struct df_collection_rec));
|
||||
collection_rec.def_vec = VEC_alloc (df_ref, stack, 128);
|
||||
collection_rec.use_vec = VEC_alloc (df_ref, stack, 32);
|
||||
collection_rec.eq_use_vec = VEC_alloc (df_ref, stack, 32);
|
||||
collection_rec.mw_vec = VEC_alloc (df_mw_hardreg_ptr, stack, 32);
|
||||
vec_stack_alloc (df_ref, collection_rec.def_vec, 128);
|
||||
vec_stack_alloc (df_ref, collection_rec.use_vec, 32);
|
||||
vec_stack_alloc (df_ref, collection_rec.eq_use_vec, 32);
|
||||
vec_stack_alloc (df_mw_hardreg_ptr, collection_rec.mw_vec, 32);
|
||||
|
||||
gcc_assert (bb_info);
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "diagnostic-core.h"
|
||||
#include "et-forest.h"
|
||||
#include "timevar.h"
|
||||
#include "vecprim.h"
|
||||
#include "pointer-set.h"
|
||||
#include "graphds.h"
|
||||
#include "bitmap.h"
|
||||
|
@ -741,21 +740,21 @@ set_immediate_dominator (enum cdi_direction dir, basic_block bb,
|
|||
|
||||
/* Returns the list of basic blocks immediately dominated by BB, in the
|
||||
direction DIR. */
|
||||
VEC (basic_block, heap) *
|
||||
vec<basic_block>
|
||||
get_dominated_by (enum cdi_direction dir, basic_block bb)
|
||||
{
|
||||
unsigned int dir_index = dom_convert_dir_to_idx (dir);
|
||||
struct et_node *node = bb->dom[dir_index], *son = node->son, *ason;
|
||||
VEC (basic_block, heap) *bbs = NULL;
|
||||
vec<basic_block> bbs = vec<basic_block>();
|
||||
|
||||
gcc_checking_assert (dom_computed[dir_index]);
|
||||
|
||||
if (!son)
|
||||
return NULL;
|
||||
return vec<basic_block>();
|
||||
|
||||
VEC_safe_push (basic_block, heap, bbs, (basic_block) son->data);
|
||||
bbs.safe_push ((basic_block) son->data);
|
||||
for (ason = son->right; ason != son; ason = ason->right)
|
||||
VEC_safe_push (basic_block, heap, bbs, (basic_block) ason->data);
|
||||
bbs.safe_push ((basic_block) ason->data);
|
||||
|
||||
return bbs;
|
||||
}
|
||||
|
@ -764,13 +763,13 @@ get_dominated_by (enum cdi_direction dir, basic_block bb)
|
|||
direction DIR) by some block between N_REGION ones stored in REGION,
|
||||
except for blocks in the REGION itself. */
|
||||
|
||||
VEC (basic_block, heap) *
|
||||
vec<basic_block>
|
||||
get_dominated_by_region (enum cdi_direction dir, basic_block *region,
|
||||
unsigned n_region)
|
||||
{
|
||||
unsigned i;
|
||||
basic_block dom;
|
||||
VEC (basic_block, heap) *doms = NULL;
|
||||
vec<basic_block> doms = vec<basic_block>();
|
||||
|
||||
for (i = 0; i < n_region; i++)
|
||||
region[i]->flags |= BB_DUPLICATED;
|
||||
|
@ -779,7 +778,7 @@ get_dominated_by_region (enum cdi_direction dir, basic_block *region,
|
|||
dom;
|
||||
dom = next_dom_son (dir, dom))
|
||||
if (!(dom->flags & BB_DUPLICATED))
|
||||
VEC_safe_push (basic_block, heap, doms, dom);
|
||||
doms.safe_push (dom);
|
||||
for (i = 0; i < n_region; i++)
|
||||
region[i]->flags &= ~BB_DUPLICATED;
|
||||
|
||||
|
@ -791,29 +790,29 @@ get_dominated_by_region (enum cdi_direction dir, basic_block *region,
|
|||
produce a vector containing all dominated blocks. The vector will be sorted
|
||||
in preorder. */
|
||||
|
||||
VEC (basic_block, heap) *
|
||||
vec<basic_block>
|
||||
get_dominated_to_depth (enum cdi_direction dir, basic_block bb, int depth)
|
||||
{
|
||||
VEC(basic_block, heap) *bbs = NULL;
|
||||
vec<basic_block> bbs = vec<basic_block>();
|
||||
unsigned i;
|
||||
unsigned next_level_start;
|
||||
|
||||
i = 0;
|
||||
VEC_safe_push (basic_block, heap, bbs, bb);
|
||||
next_level_start = 1; /* = VEC_length (basic_block, bbs); */
|
||||
bbs.safe_push (bb);
|
||||
next_level_start = 1; /* = bbs.length (); */
|
||||
|
||||
do
|
||||
{
|
||||
basic_block son;
|
||||
|
||||
bb = VEC_index (basic_block, bbs, i++);
|
||||
bb = bbs[i++];
|
||||
for (son = first_dom_son (dir, bb);
|
||||
son;
|
||||
son = next_dom_son (dir, son))
|
||||
VEC_safe_push (basic_block, heap, bbs, son);
|
||||
bbs.safe_push (son);
|
||||
|
||||
if (i == next_level_start && --depth)
|
||||
next_level_start = VEC_length (basic_block, bbs);
|
||||
next_level_start = bbs.length ();
|
||||
}
|
||||
while (i < next_level_start);
|
||||
|
||||
|
@ -823,7 +822,7 @@ get_dominated_to_depth (enum cdi_direction dir, basic_block bb, int depth)
|
|||
/* Returns the list of basic blocks including BB dominated by BB, in the
|
||||
direction DIR. The vector will be sorted in preorder. */
|
||||
|
||||
VEC (basic_block, heap) *
|
||||
vec<basic_block>
|
||||
get_all_dominated_blocks (enum cdi_direction dir, basic_block bb)
|
||||
{
|
||||
return get_dominated_to_depth (dir, bb, 0);
|
||||
|
@ -1088,7 +1087,7 @@ recompute_dominator (enum cdi_direction dir, basic_block bb)
|
|||
from BBS. */
|
||||
|
||||
static void
|
||||
prune_bbs_to_update_dominators (VEC (basic_block, heap) *bbs,
|
||||
prune_bbs_to_update_dominators (vec<basic_block> bbs,
|
||||
bool conservative)
|
||||
{
|
||||
unsigned i;
|
||||
|
@ -1097,7 +1096,7 @@ prune_bbs_to_update_dominators (VEC (basic_block, heap) *bbs,
|
|||
edge_iterator ei;
|
||||
edge e;
|
||||
|
||||
for (i = 0; VEC_iterate (basic_block, bbs, i, bb);)
|
||||
for (i = 0; bbs.iterate (i, &bb);)
|
||||
{
|
||||
if (bb == ENTRY_BLOCK_PTR)
|
||||
goto succeed;
|
||||
|
@ -1140,7 +1139,7 @@ fail:
|
|||
continue;
|
||||
|
||||
succeed:
|
||||
VEC_unordered_remove (basic_block, bbs, i);
|
||||
bbs.unordered_remove (i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1159,12 +1158,12 @@ root_of_dom_tree (enum cdi_direction dir, basic_block bb)
|
|||
blocks. */
|
||||
|
||||
static void
|
||||
determine_dominators_for_sons (struct graph *g, VEC (basic_block, heap) *bbs,
|
||||
determine_dominators_for_sons (struct graph *g, vec<basic_block> bbs,
|
||||
int y, int *son, int *brother)
|
||||
{
|
||||
bitmap gprime;
|
||||
int i, a, nc;
|
||||
VEC (int, heap) **sccs;
|
||||
vec<int> *sccs;
|
||||
basic_block bb, dom, ybb;
|
||||
unsigned si;
|
||||
edge e;
|
||||
|
@ -1172,15 +1171,15 @@ determine_dominators_for_sons (struct graph *g, VEC (basic_block, heap) *bbs,
|
|||
|
||||
if (son[y] == -1)
|
||||
return;
|
||||
if (y == (int) VEC_length (basic_block, bbs))
|
||||
if (y == (int) bbs.length ())
|
||||
ybb = ENTRY_BLOCK_PTR;
|
||||
else
|
||||
ybb = VEC_index (basic_block, bbs, y);
|
||||
ybb = bbs[y];
|
||||
|
||||
if (brother[son[y]] == -1)
|
||||
{
|
||||
/* Handle the common case Y has just one son specially. */
|
||||
bb = VEC_index (basic_block, bbs, son[y]);
|
||||
bb = bbs[son[y]];
|
||||
set_immediate_dominator (CDI_DOMINATORS, bb,
|
||||
recompute_dominator (CDI_DOMINATORS, bb));
|
||||
identify_vertices (g, y, son[y]);
|
||||
|
@ -1194,16 +1193,19 @@ determine_dominators_for_sons (struct graph *g, VEC (basic_block, heap) *bbs,
|
|||
nc = graphds_scc (g, gprime);
|
||||
BITMAP_FREE (gprime);
|
||||
|
||||
sccs = XCNEWVEC (VEC (int, heap) *, nc);
|
||||
/* ??? Needed to work around the pre-processor confusion with
|
||||
using a multi-argument template type as macro argument. */
|
||||
typedef vec<int> vec_int_heap;
|
||||
sccs = XCNEWVEC (vec_int_heap, nc);
|
||||
for (a = son[y]; a != -1; a = brother[a])
|
||||
VEC_safe_push (int, heap, sccs[g->vertices[a].component], a);
|
||||
sccs[g->vertices[a].component].safe_push (a);
|
||||
|
||||
for (i = nc - 1; i >= 0; i--)
|
||||
{
|
||||
dom = NULL;
|
||||
FOR_EACH_VEC_ELT (int, sccs[i], si, a)
|
||||
FOR_EACH_VEC_ELT (sccs[i], si, a)
|
||||
{
|
||||
bb = VEC_index (basic_block, bbs, a);
|
||||
bb = bbs[a];
|
||||
FOR_EACH_EDGE (e, ei, bb->preds)
|
||||
{
|
||||
if (root_of_dom_tree (CDI_DOMINATORS, e->src) != ybb)
|
||||
|
@ -1214,15 +1216,15 @@ determine_dominators_for_sons (struct graph *g, VEC (basic_block, heap) *bbs,
|
|||
}
|
||||
|
||||
gcc_assert (dom != NULL);
|
||||
FOR_EACH_VEC_ELT (int, sccs[i], si, a)
|
||||
FOR_EACH_VEC_ELT (sccs[i], si, a)
|
||||
{
|
||||
bb = VEC_index (basic_block, bbs, a);
|
||||
bb = bbs[a];
|
||||
set_immediate_dominator (CDI_DOMINATORS, bb, dom);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < nc; i++)
|
||||
VEC_free (int, heap, sccs[i]);
|
||||
sccs[i].release ();
|
||||
free (sccs);
|
||||
|
||||
for (a = son[y]; a != -1; a = brother[a])
|
||||
|
@ -1237,7 +1239,7 @@ determine_dominators_for_sons (struct graph *g, VEC (basic_block, heap) *bbs,
|
|||
a block of BBS in the current dominance tree dominate it. */
|
||||
|
||||
void
|
||||
iterate_fix_dominators (enum cdi_direction dir, VEC (basic_block, heap) *bbs,
|
||||
iterate_fix_dominators (enum cdi_direction dir, vec<basic_block> bbs,
|
||||
bool conservative)
|
||||
{
|
||||
unsigned i;
|
||||
|
@ -1316,19 +1318,19 @@ iterate_fix_dominators (enum cdi_direction dir, VEC (basic_block, heap) *bbs,
|
|||
conservatively correct, setting the dominators using the
|
||||
heuristics in prune_bbs_to_update_dominators could
|
||||
create cycles in the dominance "tree", and cause ICE. */
|
||||
FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
|
||||
FOR_EACH_VEC_ELT (bbs, i, bb)
|
||||
set_immediate_dominator (CDI_DOMINATORS, bb, NULL);
|
||||
}
|
||||
|
||||
prune_bbs_to_update_dominators (bbs, conservative);
|
||||
n = VEC_length (basic_block, bbs);
|
||||
n = bbs.length ();
|
||||
|
||||
if (n == 0)
|
||||
return;
|
||||
|
||||
if (n == 1)
|
||||
{
|
||||
bb = VEC_index (basic_block, bbs, 0);
|
||||
bb = bbs[0];
|
||||
set_immediate_dominator (CDI_DOMINATORS, bb,
|
||||
recompute_dominator (CDI_DOMINATORS, bb));
|
||||
return;
|
||||
|
@ -1336,7 +1338,7 @@ iterate_fix_dominators (enum cdi_direction dir, VEC (basic_block, heap) *bbs,
|
|||
|
||||
/* Construct the graph G. */
|
||||
map = pointer_map_create ();
|
||||
FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
|
||||
FOR_EACH_VEC_ELT (bbs, i, bb)
|
||||
{
|
||||
/* If the dominance tree is conservatively correct, split it now. */
|
||||
if (conservative)
|
||||
|
@ -1348,7 +1350,7 @@ iterate_fix_dominators (enum cdi_direction dir, VEC (basic_block, heap) *bbs,
|
|||
g = new_graph (n + 1);
|
||||
for (y = 0; y < g->n_vertices; y++)
|
||||
g->vertices[y].data = BITMAP_ALLOC (NULL);
|
||||
FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
|
||||
FOR_EACH_VEC_ELT (bbs, i, bb)
|
||||
{
|
||||
FOR_EACH_EDGE (e, ei, bb->preds)
|
||||
{
|
||||
|
|
|
@ -162,9 +162,9 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb)
|
|||
|
||||
/* First get some local data, reusing any local data
|
||||
pointer we may have saved. */
|
||||
if (VEC_length (void_p, walk_data->free_block_data) > 0)
|
||||
if (walk_data->free_block_data.length () > 0)
|
||||
{
|
||||
bd = VEC_pop (void_p, walk_data->free_block_data);
|
||||
bd = walk_data->free_block_data.pop ();
|
||||
recycled = 1;
|
||||
}
|
||||
else
|
||||
|
@ -174,7 +174,7 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb)
|
|||
}
|
||||
|
||||
/* Push the local data into the local data stack. */
|
||||
VEC_safe_push (void_p, heap, walk_data->block_data_stack, bd);
|
||||
walk_data->block_data_stack.safe_push (bd);
|
||||
|
||||
/* Call the initializer. */
|
||||
walk_data->initialize_block_local_data (walk_data, bb,
|
||||
|
@ -212,9 +212,9 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb)
|
|||
if (walk_data->initialize_block_local_data)
|
||||
{
|
||||
/* And finally pop the record off the block local data stack. */
|
||||
bd = VEC_pop (void_p, walk_data->block_data_stack);
|
||||
bd = walk_data->block_data_stack.pop ();
|
||||
/* And save the block data so that we can re-use it. */
|
||||
VEC_safe_push (void_p, heap, walk_data->free_block_data, bd);
|
||||
walk_data->free_block_data.safe_push (bd);
|
||||
}
|
||||
}
|
||||
if (sp)
|
||||
|
@ -261,8 +261,8 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb)
|
|||
void
|
||||
init_walk_dominator_tree (struct dom_walk_data *walk_data)
|
||||
{
|
||||
walk_data->free_block_data = NULL;
|
||||
walk_data->block_data_stack = NULL;
|
||||
walk_data->free_block_data.create (0);
|
||||
walk_data->block_data_stack.create (0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -270,10 +270,10 @@ fini_walk_dominator_tree (struct dom_walk_data *walk_data)
|
|||
{
|
||||
if (walk_data->initialize_block_local_data)
|
||||
{
|
||||
while (VEC_length (void_p, walk_data->free_block_data) > 0)
|
||||
free (VEC_pop (void_p, walk_data->free_block_data));
|
||||
while (walk_data->free_block_data.length () > 0)
|
||||
free (walk_data->free_block_data.pop ());
|
||||
}
|
||||
|
||||
VEC_free (void_p, heap, walk_data->free_block_data);
|
||||
VEC_free (void_p, heap, walk_data->block_data_stack);
|
||||
walk_data->free_block_data.release ();
|
||||
walk_data->block_data_stack.release ();
|
||||
}
|
||||
|
|
|
@ -19,8 +19,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
typedef void *void_p;
|
||||
DEF_VEC_P(void_p);
|
||||
DEF_VEC_ALLOC_P(void_p,heap);
|
||||
|
||||
/* This is the main data structure for the dominator walker. It provides
|
||||
the callback hooks as well as a convenient place to hang block local
|
||||
|
@ -58,7 +56,7 @@ struct dom_walk_data
|
|||
/* Stack of any data we need to keep on a per-block basis.
|
||||
|
||||
If you have no local data, then BLOCK_DATA_STACK will be NULL. */
|
||||
VEC(void_p,heap) *block_data_stack;
|
||||
vec<void_p> block_data_stack;
|
||||
|
||||
/* Size of the block local data. If this is zero, then it is assumed
|
||||
you have no local data and thus no BLOCK_DATA_STACK as well. */
|
||||
|
@ -68,7 +66,7 @@ struct dom_walk_data
|
|||
information/data outside domwalk.c. */
|
||||
|
||||
/* Stack of available block local structures. */
|
||||
VEC(void_p,heap) *free_block_data;
|
||||
vec<void_p> free_block_data;
|
||||
};
|
||||
|
||||
void walk_dominator_tree (struct dom_walk_data *, basic_block);
|
||||
|
|
39
gcc/dse.c
39
gcc/dse.c
|
@ -550,10 +550,8 @@ static alloc_pool rtx_group_info_pool;
|
|||
/* Index into the rtx_group_vec. */
|
||||
static int rtx_group_next_id;
|
||||
|
||||
DEF_VEC_P(group_info_t);
|
||||
DEF_VEC_ALLOC_P(group_info_t,heap);
|
||||
|
||||
static VEC(group_info_t,heap) *rtx_group_vec;
|
||||
static vec<group_info_t> rtx_group_vec;
|
||||
|
||||
|
||||
/* This structure holds the set of changes that are being deferred
|
||||
|
@ -715,7 +713,7 @@ get_group_info (rtx base)
|
|||
gi->offset_map_size_p = 0;
|
||||
gi->offset_map_n = NULL;
|
||||
gi->offset_map_p = NULL;
|
||||
VEC_safe_push (group_info_t, heap, rtx_group_vec, gi);
|
||||
rtx_group_vec.safe_push (gi);
|
||||
}
|
||||
return clear_alias_group;
|
||||
}
|
||||
|
@ -741,7 +739,7 @@ get_group_info (rtx base)
|
|||
gi->offset_map_size_p = 0;
|
||||
gi->offset_map_n = NULL;
|
||||
gi->offset_map_p = NULL;
|
||||
VEC_safe_push (group_info_t, heap, rtx_group_vec, gi);
|
||||
rtx_group_vec.safe_push (gi);
|
||||
}
|
||||
|
||||
return gi;
|
||||
|
@ -1527,7 +1525,7 @@ record_store (rtx body, bb_info_t bb_info)
|
|||
frame pointer we can do global analysis. */
|
||||
|
||||
group_info_t group
|
||||
= VEC_index (group_info_t, rtx_group_vec, group_id);
|
||||
= rtx_group_vec[group_id];
|
||||
tree expr = MEM_EXPR (mem);
|
||||
|
||||
store_info = (store_info_t) pool_alloc (rtx_store_info_pool);
|
||||
|
@ -1597,7 +1595,7 @@ record_store (rtx body, bb_info_t bb_info)
|
|||
else
|
||||
{
|
||||
group_info_t group
|
||||
= VEC_index (group_info_t, rtx_group_vec, group_id);
|
||||
= rtx_group_vec[group_id];
|
||||
mem_addr = group->canon_base_addr;
|
||||
}
|
||||
if (offset)
|
||||
|
@ -2214,7 +2212,7 @@ check_mem_read_rtx (rtx *loc, void *data)
|
|||
else
|
||||
{
|
||||
group_info_t group
|
||||
= VEC_index (group_info_t, rtx_group_vec, group_id);
|
||||
= rtx_group_vec[group_id];
|
||||
mem_addr = group->canon_base_addr;
|
||||
}
|
||||
if (offset)
|
||||
|
@ -2598,8 +2596,7 @@ scan_insn (bb_info_t bb_info, rtx insn)
|
|||
store_info = store_info->next;
|
||||
|
||||
if (store_info->group_id >= 0
|
||||
&& VEC_index (group_info_t, rtx_group_vec,
|
||||
store_info->group_id)->frame_related)
|
||||
&& rtx_group_vec[store_info->group_id]->frame_related)
|
||||
remove_store = true;
|
||||
}
|
||||
|
||||
|
@ -2826,7 +2823,7 @@ dse_step1 (void)
|
|||
if (store_info->group_id >= 0)
|
||||
{
|
||||
group_info_t group
|
||||
= VEC_index (group_info_t, rtx_group_vec, store_info->group_id);
|
||||
= rtx_group_vec[store_info->group_id];
|
||||
if (group->frame_related && !i_ptr->cannot_delete)
|
||||
delete_dead_store_insn (i_ptr);
|
||||
}
|
||||
|
@ -2917,7 +2914,7 @@ dse_step2_init (void)
|
|||
unsigned int i;
|
||||
group_info_t group;
|
||||
|
||||
FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
|
||||
FOR_EACH_VEC_ELT (rtx_group_vec, i, group)
|
||||
{
|
||||
/* For all non stack related bases, we only consider a store to
|
||||
be deletable if there are two or more stores for that
|
||||
|
@ -2970,7 +2967,7 @@ dse_step2_nospill (void)
|
|||
/* Position 0 is unused because 0 is used in the maps to mean
|
||||
unused. */
|
||||
current_position = 1;
|
||||
FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
|
||||
FOR_EACH_VEC_ELT (rtx_group_vec, i, group)
|
||||
{
|
||||
bitmap_iterator bi;
|
||||
unsigned int j;
|
||||
|
@ -3084,7 +3081,7 @@ scan_stores_nospill (store_info_t store_info, bitmap gen, bitmap kill)
|
|||
{
|
||||
HOST_WIDE_INT i;
|
||||
group_info_t group_info
|
||||
= VEC_index (group_info_t, rtx_group_vec, store_info->group_id);
|
||||
= rtx_group_vec[store_info->group_id];
|
||||
if (group_info->process_globally)
|
||||
for (i = store_info->begin; i < store_info->end; i++)
|
||||
{
|
||||
|
@ -3138,7 +3135,7 @@ scan_reads_nospill (insn_info_t insn_info, bitmap gen, bitmap kill)
|
|||
/* If this insn reads the frame, kill all the frame related stores. */
|
||||
if (insn_info->frame_read)
|
||||
{
|
||||
FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
|
||||
FOR_EACH_VEC_ELT (rtx_group_vec, i, group)
|
||||
if (group->process_globally && group->frame_related)
|
||||
{
|
||||
if (kill)
|
||||
|
@ -3153,7 +3150,7 @@ scan_reads_nospill (insn_info_t insn_info, bitmap gen, bitmap kill)
|
|||
if (kill)
|
||||
bitmap_ior_into (kill, kill_on_calls);
|
||||
bitmap_and_compl_into (gen, kill_on_calls);
|
||||
FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
|
||||
FOR_EACH_VEC_ELT (rtx_group_vec, i, group)
|
||||
if (group->process_globally && !group->frame_related)
|
||||
{
|
||||
if (kill)
|
||||
|
@ -3163,7 +3160,7 @@ scan_reads_nospill (insn_info_t insn_info, bitmap gen, bitmap kill)
|
|||
}
|
||||
while (read_info)
|
||||
{
|
||||
FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
|
||||
FOR_EACH_VEC_ELT (rtx_group_vec, i, group)
|
||||
{
|
||||
if (group->process_globally)
|
||||
{
|
||||
|
@ -3343,7 +3340,7 @@ dse_step3_exit_block_scan (bb_info_t bb_info)
|
|||
unsigned int i;
|
||||
group_info_t group;
|
||||
|
||||
FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
|
||||
FOR_EACH_VEC_ELT (rtx_group_vec, i, group)
|
||||
{
|
||||
if (group->process_globally && group->frame_related)
|
||||
bitmap_ior_into (bb_info->gen, group->group_kill);
|
||||
|
@ -3425,7 +3422,7 @@ dse_step3 (bool for_spills)
|
|||
group_info_t group;
|
||||
|
||||
all_ones = BITMAP_ALLOC (&dse_bitmap_obstack);
|
||||
FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, j, group)
|
||||
FOR_EACH_VEC_ELT (rtx_group_vec, j, group)
|
||||
bitmap_ior_into (all_ones, group->group_kill);
|
||||
}
|
||||
if (!bb_info->out)
|
||||
|
@ -3641,7 +3638,7 @@ dse_step5_nospill (void)
|
|||
{
|
||||
HOST_WIDE_INT i;
|
||||
group_info_t group_info
|
||||
= VEC_index (group_info_t, rtx_group_vec, store_info->group_id);
|
||||
= rtx_group_vec[store_info->group_id];
|
||||
|
||||
for (i = store_info->begin; i < store_info->end; i++)
|
||||
{
|
||||
|
@ -3840,7 +3837,7 @@ dse_step7 (void)
|
|||
end_alias_analysis ();
|
||||
free (bb_table);
|
||||
rtx_group_table.dispose ();
|
||||
VEC_free (group_info_t, heap, rtx_group_vec);
|
||||
rtx_group_vec.release ();
|
||||
BITMAP_FREE (all_blocks);
|
||||
BITMAP_FREE (scratch);
|
||||
|
||||
|
|
144
gcc/dwarf2cfi.c
144
gcc/dwarf2cfi.c
|
@ -78,8 +78,6 @@ typedef struct GTY(()) reg_saved_in_data_struct {
|
|||
rtx saved_in_reg;
|
||||
} reg_saved_in_data;
|
||||
|
||||
DEF_VEC_O (reg_saved_in_data);
|
||||
DEF_VEC_ALLOC_O (reg_saved_in_data, heap);
|
||||
|
||||
/* Since we no longer have a proper CFG, we're going to create a facsimile
|
||||
of one on the fly while processing the frame-related insns.
|
||||
|
@ -141,7 +139,7 @@ typedef struct
|
|||
implemented as a flat array because it normally contains zero or 1
|
||||
entry, depending on the target. IA-64 is the big spender here, using
|
||||
a maximum of 5 entries. */
|
||||
VEC(reg_saved_in_data, heap) *regs_saved_in_regs;
|
||||
vec<reg_saved_in_data> regs_saved_in_regs;
|
||||
|
||||
/* An identifier for this trace. Used only for debugging dumps. */
|
||||
unsigned id;
|
||||
|
@ -153,17 +151,13 @@ typedef struct
|
|||
bool args_size_undefined;
|
||||
} dw_trace_info;
|
||||
|
||||
DEF_VEC_O (dw_trace_info);
|
||||
DEF_VEC_ALLOC_O (dw_trace_info, heap);
|
||||
|
||||
typedef dw_trace_info *dw_trace_info_ref;
|
||||
|
||||
DEF_VEC_P (dw_trace_info_ref);
|
||||
DEF_VEC_ALLOC_P (dw_trace_info_ref, heap);
|
||||
|
||||
/* The variables making up the pseudo-cfg, as described above. */
|
||||
static VEC (dw_trace_info, heap) *trace_info;
|
||||
static VEC (dw_trace_info_ref, heap) *trace_work_list;
|
||||
static vec<dw_trace_info> trace_info;
|
||||
static vec<dw_trace_info_ref> trace_work_list;
|
||||
static htab_t trace_index;
|
||||
|
||||
/* A vector of call frame insns for the CIE. */
|
||||
|
@ -203,10 +197,8 @@ typedef struct {
|
|||
HOST_WIDE_INT cfa_offset;
|
||||
} queued_reg_save;
|
||||
|
||||
DEF_VEC_O (queued_reg_save);
|
||||
DEF_VEC_ALLOC_O (queued_reg_save, heap);
|
||||
|
||||
static VEC(queued_reg_save, heap) *queued_reg_saves;
|
||||
static vec<queued_reg_save> queued_reg_saves;
|
||||
|
||||
/* True if any CFI directives were emitted at the current insn. */
|
||||
static bool any_cfis_emitted;
|
||||
|
@ -383,7 +375,7 @@ copy_cfi_row (dw_cfi_row *src)
|
|||
dw_cfi_row *dst = ggc_alloc_dw_cfi_row ();
|
||||
|
||||
*dst = *src;
|
||||
dst->reg_save = VEC_copy (dw_cfi_ref, gc, src->reg_save);
|
||||
dst->reg_save = vec_safe_copy (src->reg_save);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
@ -415,7 +407,7 @@ add_cfi (dw_cfi_ref cfi)
|
|||
}
|
||||
|
||||
if (add_cfi_vec != NULL)
|
||||
VEC_safe_push (dw_cfi_ref, gc, *add_cfi_vec, cfi);
|
||||
vec_safe_push (*add_cfi_vec, cfi);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -450,9 +442,9 @@ add_cfi_restore (unsigned reg)
|
|||
static void
|
||||
update_row_reg_save (dw_cfi_row *row, unsigned column, dw_cfi_ref cfi)
|
||||
{
|
||||
if (VEC_length (dw_cfi_ref, row->reg_save) <= column)
|
||||
VEC_safe_grow_cleared (dw_cfi_ref, gc, row->reg_save, column + 1);
|
||||
VEC_replace (dw_cfi_ref, row->reg_save, column, cfi);
|
||||
if (vec_safe_length (row->reg_save) <= column)
|
||||
vec_safe_grow_cleared (row->reg_save, column + 1);
|
||||
(*row->reg_save)[column] = cfi;
|
||||
}
|
||||
|
||||
/* This function fills in aa dw_cfa_location structure from a dwarf location
|
||||
|
@ -677,8 +669,8 @@ cfi_row_equal_p (dw_cfi_row *a, dw_cfi_row *b)
|
|||
else if (!cfa_equal_p (&a->cfa, &b->cfa))
|
||||
return false;
|
||||
|
||||
n_a = VEC_length (dw_cfi_ref, a->reg_save);
|
||||
n_b = VEC_length (dw_cfi_ref, b->reg_save);
|
||||
n_a = vec_safe_length (a->reg_save);
|
||||
n_b = vec_safe_length (b->reg_save);
|
||||
n_max = MAX (n_a, n_b);
|
||||
|
||||
for (i = 0; i < n_max; ++i)
|
||||
|
@ -686,9 +678,9 @@ cfi_row_equal_p (dw_cfi_row *a, dw_cfi_row *b)
|
|||
dw_cfi_ref r_a = NULL, r_b = NULL;
|
||||
|
||||
if (i < n_a)
|
||||
r_a = VEC_index (dw_cfi_ref, a->reg_save, i);
|
||||
r_a = (*a->reg_save)[i];
|
||||
if (i < n_b)
|
||||
r_b = VEC_index (dw_cfi_ref, b->reg_save, i);
|
||||
r_b = (*b->reg_save)[i];
|
||||
|
||||
if (!cfi_equal_p (r_a, r_b))
|
||||
return false;
|
||||
|
@ -927,12 +919,11 @@ record_reg_saved_in_reg (rtx dest, rtx src)
|
|||
reg_saved_in_data *elt;
|
||||
size_t i;
|
||||
|
||||
FOR_EACH_VEC_ELT (reg_saved_in_data, cur_trace->regs_saved_in_regs, i, elt)
|
||||
FOR_EACH_VEC_ELT (cur_trace->regs_saved_in_regs, i, elt)
|
||||
if (compare_reg_or_pc (elt->orig_reg, src))
|
||||
{
|
||||
if (dest == NULL)
|
||||
VEC_unordered_remove (reg_saved_in_data,
|
||||
cur_trace->regs_saved_in_regs, i);
|
||||
cur_trace->regs_saved_in_regs.unordered_remove (i);
|
||||
else
|
||||
elt->saved_in_reg = dest;
|
||||
return;
|
||||
|
@ -942,7 +933,7 @@ record_reg_saved_in_reg (rtx dest, rtx src)
|
|||
return;
|
||||
|
||||
reg_saved_in_data e = {src, dest};
|
||||
VEC_safe_push (reg_saved_in_data, heap, cur_trace->regs_saved_in_regs, e);
|
||||
cur_trace->regs_saved_in_regs.safe_push (e);
|
||||
}
|
||||
|
||||
/* Add an entry to QUEUED_REG_SAVES saying that REG is now saved at
|
||||
|
@ -957,14 +948,14 @@ queue_reg_save (rtx reg, rtx sreg, HOST_WIDE_INT offset)
|
|||
|
||||
/* Duplicates waste space, but it's also necessary to remove them
|
||||
for correctness, since the queue gets output in reverse order. */
|
||||
FOR_EACH_VEC_ELT (queued_reg_save, queued_reg_saves, i, q)
|
||||
FOR_EACH_VEC_ELT (queued_reg_saves, i, q)
|
||||
if (compare_reg_or_pc (q->reg, reg))
|
||||
{
|
||||
*q = e;
|
||||
return;
|
||||
}
|
||||
|
||||
VEC_safe_push (queued_reg_save, heap, queued_reg_saves, e);
|
||||
queued_reg_saves.safe_push (e);
|
||||
}
|
||||
|
||||
/* Output all the entries in QUEUED_REG_SAVES. */
|
||||
|
@ -975,7 +966,7 @@ dwarf2out_flush_queued_reg_saves (void)
|
|||
queued_reg_save *q;
|
||||
size_t i;
|
||||
|
||||
FOR_EACH_VEC_ELT (queued_reg_save, queued_reg_saves, i, q)
|
||||
FOR_EACH_VEC_ELT (queued_reg_saves, i, q)
|
||||
{
|
||||
unsigned int reg, sreg;
|
||||
|
||||
|
@ -992,7 +983,7 @@ dwarf2out_flush_queued_reg_saves (void)
|
|||
reg_save (reg, sreg, q->cfa_offset);
|
||||
}
|
||||
|
||||
VEC_truncate (queued_reg_save, queued_reg_saves, 0);
|
||||
queued_reg_saves.truncate (0);
|
||||
}
|
||||
|
||||
/* Does INSN clobber any register which QUEUED_REG_SAVES lists a saved
|
||||
|
@ -1006,7 +997,7 @@ clobbers_queued_reg_save (const_rtx insn)
|
|||
queued_reg_save *q;
|
||||
size_t iq;
|
||||
|
||||
FOR_EACH_VEC_ELT (queued_reg_save, queued_reg_saves, iq, q)
|
||||
FOR_EACH_VEC_ELT (queued_reg_saves, iq, q)
|
||||
{
|
||||
size_t ir;
|
||||
reg_saved_in_data *rir;
|
||||
|
@ -1014,8 +1005,7 @@ clobbers_queued_reg_save (const_rtx insn)
|
|||
if (modified_in_p (q->reg, insn))
|
||||
return true;
|
||||
|
||||
FOR_EACH_VEC_ELT (reg_saved_in_data,
|
||||
cur_trace->regs_saved_in_regs, ir, rir)
|
||||
FOR_EACH_VEC_ELT (cur_trace->regs_saved_in_regs, ir, rir)
|
||||
if (compare_reg_or_pc (q->reg, rir->orig_reg)
|
||||
&& modified_in_p (rir->saved_in_reg, insn))
|
||||
return true;
|
||||
|
@ -1034,11 +1024,11 @@ reg_saved_in (rtx reg)
|
|||
reg_saved_in_data *rir;
|
||||
size_t i;
|
||||
|
||||
FOR_EACH_VEC_ELT (queued_reg_save, queued_reg_saves, i, q)
|
||||
FOR_EACH_VEC_ELT (queued_reg_saves, i, q)
|
||||
if (q->saved_reg && regn == REGNO (q->saved_reg))
|
||||
return q->reg;
|
||||
|
||||
FOR_EACH_VEC_ELT (reg_saved_in_data, cur_trace->regs_saved_in_regs, i, rir)
|
||||
FOR_EACH_VEC_ELT (cur_trace->regs_saved_in_regs, i, rir)
|
||||
if (regn == REGNO (rir->saved_in_reg))
|
||||
return rir->orig_reg;
|
||||
|
||||
|
@ -2049,8 +2039,8 @@ change_cfi_row (dw_cfi_row *old_row, dw_cfi_row *new_row)
|
|||
add_cfi (cfi);
|
||||
}
|
||||
|
||||
n_old = VEC_length (dw_cfi_ref, old_row->reg_save);
|
||||
n_new = VEC_length (dw_cfi_ref, new_row->reg_save);
|
||||
n_old = vec_safe_length (old_row->reg_save);
|
||||
n_new = vec_safe_length (new_row->reg_save);
|
||||
n_max = MAX (n_old, n_new);
|
||||
|
||||
for (i = 0; i < n_max; ++i)
|
||||
|
@ -2058,9 +2048,9 @@ change_cfi_row (dw_cfi_row *old_row, dw_cfi_row *new_row)
|
|||
dw_cfi_ref r_old = NULL, r_new = NULL;
|
||||
|
||||
if (i < n_old)
|
||||
r_old = VEC_index (dw_cfi_ref, old_row->reg_save, i);
|
||||
r_old = (*old_row->reg_save)[i];
|
||||
if (i < n_new)
|
||||
r_new = VEC_index (dw_cfi_ref, new_row->reg_save, i);
|
||||
r_new = (*new_row->reg_save)[i];
|
||||
|
||||
if (r_old == r_new)
|
||||
;
|
||||
|
@ -2124,8 +2114,7 @@ add_cfis_to_fde (void)
|
|||
|
||||
if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_SWITCH_TEXT_SECTIONS)
|
||||
{
|
||||
fde->dw_fde_switch_cfi_index
|
||||
= VEC_length (dw_cfi_ref, fde->dw_fde_cfi);
|
||||
fde->dw_fde_switch_cfi_index = vec_safe_length (fde->dw_fde_cfi);
|
||||
/* Don't attempt to advance_loc4 between labels
|
||||
in different sections. */
|
||||
first = true;
|
||||
|
@ -2158,7 +2147,7 @@ add_cfis_to_fde (void)
|
|||
xcfi->dw_cfi_opc = (first ? DW_CFA_set_loc
|
||||
: DW_CFA_advance_loc4);
|
||||
xcfi->dw_cfi_oprnd1.dw_cfi_addr = label;
|
||||
VEC_safe_push (dw_cfi_ref, gc, fde->dw_fde_cfi, xcfi);
|
||||
vec_safe_push (fde->dw_fde_cfi, xcfi);
|
||||
|
||||
tmp = emit_note_before (NOTE_INSN_CFI_LABEL, insn);
|
||||
NOTE_LABEL_NUMBER (tmp) = num;
|
||||
|
@ -2167,8 +2156,7 @@ add_cfis_to_fde (void)
|
|||
do
|
||||
{
|
||||
if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_CFI)
|
||||
VEC_safe_push (dw_cfi_ref, gc, fde->dw_fde_cfi,
|
||||
NOTE_CFI (insn));
|
||||
vec_safe_push (fde->dw_fde_cfi, NOTE_CFI (insn));
|
||||
insn = NEXT_INSN (insn);
|
||||
}
|
||||
while (insn != next);
|
||||
|
@ -2207,10 +2195,9 @@ maybe_record_trace_start (rtx start, rtx origin)
|
|||
|
||||
ti->cfa_store = cur_trace->cfa_store;
|
||||
ti->cfa_temp = cur_trace->cfa_temp;
|
||||
ti->regs_saved_in_regs = VEC_copy (reg_saved_in_data, heap,
|
||||
cur_trace->regs_saved_in_regs);
|
||||
ti->regs_saved_in_regs = cur_trace->regs_saved_in_regs.copy ();
|
||||
|
||||
VEC_safe_push (dw_trace_info_ref, heap, trace_work_list, ti);
|
||||
trace_work_list.safe_push (ti);
|
||||
|
||||
if (dump_file)
|
||||
fprintf (dump_file, "\tpush trace %u to worklist\n", ti->id);
|
||||
|
@ -2391,7 +2378,7 @@ scan_trace (dw_trace_info *trace)
|
|||
if (BARRIER_P (insn))
|
||||
{
|
||||
/* Don't bother saving the unneeded queued registers at all. */
|
||||
VEC_truncate (queued_reg_save, queued_reg_saves, 0);
|
||||
queued_reg_saves.truncate (0);
|
||||
break;
|
||||
}
|
||||
if (save_point_p (insn))
|
||||
|
@ -2438,13 +2425,12 @@ scan_trace (dw_trace_info *trace)
|
|||
add_cfi_insn = NULL;
|
||||
restore_args_size = cur_trace->end_true_args_size;
|
||||
cur_cfa = &cur_row->cfa;
|
||||
save_row_reg_save
|
||||
= VEC_copy (dw_cfi_ref, gc, cur_row->reg_save);
|
||||
save_row_reg_save = vec_safe_copy (cur_row->reg_save);
|
||||
|
||||
scan_insn_after (elt);
|
||||
|
||||
/* ??? Should we instead save the entire row state? */
|
||||
gcc_assert (!VEC_length (queued_reg_save, queued_reg_saves));
|
||||
gcc_assert (!queued_reg_saves.length ());
|
||||
|
||||
create_trace_edges (control);
|
||||
|
||||
|
@ -2543,21 +2529,21 @@ create_cfi_notes (void)
|
|||
{
|
||||
dw_trace_info *ti;
|
||||
|
||||
gcc_checking_assert (queued_reg_saves == NULL);
|
||||
gcc_checking_assert (trace_work_list == NULL);
|
||||
gcc_checking_assert (!queued_reg_saves.exists ());
|
||||
gcc_checking_assert (!trace_work_list.exists ());
|
||||
|
||||
/* Always begin at the entry trace. */
|
||||
ti = &VEC_index (dw_trace_info, trace_info, 0);
|
||||
ti = &trace_info[0];
|
||||
scan_trace (ti);
|
||||
|
||||
while (!VEC_empty (dw_trace_info_ref, trace_work_list))
|
||||
while (!trace_work_list.is_empty ())
|
||||
{
|
||||
ti = VEC_pop (dw_trace_info_ref, trace_work_list);
|
||||
ti = trace_work_list.pop ();
|
||||
scan_trace (ti);
|
||||
}
|
||||
|
||||
VEC_free (queued_reg_save, heap, queued_reg_saves);
|
||||
VEC_free (dw_trace_info_ref, heap, trace_work_list);
|
||||
queued_reg_saves.release ();
|
||||
trace_work_list.release ();
|
||||
}
|
||||
|
||||
/* Return the insn before the first NOTE_INSN_CFI after START. */
|
||||
|
@ -2581,7 +2567,7 @@ before_next_cfi_note (rtx start)
|
|||
static void
|
||||
connect_traces (void)
|
||||
{
|
||||
unsigned i, n = VEC_length (dw_trace_info, trace_info);
|
||||
unsigned i, n = trace_info.length ();
|
||||
dw_trace_info *prev_ti, *ti;
|
||||
|
||||
/* ??? Ideally, we should have both queued and processed every trace.
|
||||
|
@ -2594,10 +2580,10 @@ connect_traces (void)
|
|||
/* Remove all unprocessed traces from the list. */
|
||||
for (i = n - 1; i > 0; --i)
|
||||
{
|
||||
ti = &VEC_index (dw_trace_info, trace_info, i);
|
||||
ti = &trace_info[i];
|
||||
if (ti->beg_row == NULL)
|
||||
{
|
||||
VEC_ordered_remove (dw_trace_info, trace_info, i);
|
||||
trace_info.ordered_remove (i);
|
||||
n -= 1;
|
||||
}
|
||||
else
|
||||
|
@ -2606,13 +2592,13 @@ connect_traces (void)
|
|||
|
||||
/* Work from the end back to the beginning. This lets us easily insert
|
||||
remember/restore_state notes in the correct order wrt other notes. */
|
||||
prev_ti = &VEC_index (dw_trace_info, trace_info, n - 1);
|
||||
prev_ti = &trace_info[n - 1];
|
||||
for (i = n - 1; i > 0; --i)
|
||||
{
|
||||
dw_cfi_row *old_row;
|
||||
|
||||
ti = prev_ti;
|
||||
prev_ti = &VEC_index (dw_trace_info, trace_info, i - 1);
|
||||
prev_ti = &trace_info[i - 1];
|
||||
|
||||
add_cfi_insn = ti->head;
|
||||
|
||||
|
@ -2677,13 +2663,13 @@ connect_traces (void)
|
|||
}
|
||||
|
||||
/* Connect args_size between traces that have can_throw_internal insns. */
|
||||
if (cfun->eh->lp_array != NULL)
|
||||
if (cfun->eh->lp_array)
|
||||
{
|
||||
HOST_WIDE_INT prev_args_size = 0;
|
||||
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
ti = &VEC_index (dw_trace_info, trace_info, i);
|
||||
ti = &trace_info[i];
|
||||
|
||||
if (ti->switch_sections)
|
||||
prev_args_size = 0;
|
||||
|
@ -2716,17 +2702,16 @@ create_pseudo_cfg (void)
|
|||
|
||||
/* The first trace begins at the start of the function,
|
||||
and begins with the CIE row state. */
|
||||
trace_info = VEC_alloc (dw_trace_info, heap, 16);
|
||||
trace_info.create (16);
|
||||
memset (&ti, 0, sizeof (ti));
|
||||
ti.head = get_insns ();
|
||||
ti.beg_row = cie_cfi_row;
|
||||
ti.cfa_store = cie_cfi_row->cfa;
|
||||
ti.cfa_temp.reg = INVALID_REGNUM;
|
||||
VEC_quick_push (dw_trace_info, trace_info, ti);
|
||||
trace_info.quick_push (ti);
|
||||
|
||||
if (cie_return_save)
|
||||
VEC_safe_push (reg_saved_in_data, heap,
|
||||
ti.regs_saved_in_regs, *cie_return_save);
|
||||
ti.regs_saved_in_regs.safe_push (*cie_return_save);
|
||||
|
||||
/* Walk all the insns, collecting start of trace locations. */
|
||||
saw_barrier = false;
|
||||
|
@ -2751,8 +2736,8 @@ create_pseudo_cfg (void)
|
|||
memset (&ti, 0, sizeof (ti));
|
||||
ti.head = insn;
|
||||
ti.switch_sections = switch_sections;
|
||||
ti.id = VEC_length (dw_trace_info, trace_info) - 1;
|
||||
VEC_safe_push (dw_trace_info, heap, trace_info, ti);
|
||||
ti.id = trace_info.length () - 1;
|
||||
trace_info.safe_push (ti);
|
||||
|
||||
saw_barrier = false;
|
||||
switch_sections = false;
|
||||
|
@ -2761,10 +2746,10 @@ create_pseudo_cfg (void)
|
|||
|
||||
/* Create the trace index after we've finished building trace_info,
|
||||
avoiding stale pointer problems due to reallocation. */
|
||||
trace_index = htab_create (VEC_length (dw_trace_info, trace_info),
|
||||
trace_index = htab_create (trace_info.length (),
|
||||
dw_trace_info_hash, dw_trace_info_eq, NULL);
|
||||
dw_trace_info *tp;
|
||||
FOR_EACH_VEC_ELT (dw_trace_info, trace_info, i, tp)
|
||||
FOR_EACH_VEC_ELT (trace_info, i, tp)
|
||||
{
|
||||
void **slot;
|
||||
|
||||
|
@ -2876,15 +2861,14 @@ create_cie_data (void)
|
|||
the DW_CFA_offset against the return column, not the intermediate
|
||||
save register. Save the contents of regs_saved_in_regs so that
|
||||
we can re-initialize it at the start of each function. */
|
||||
switch (VEC_length (reg_saved_in_data, cie_trace.regs_saved_in_regs))
|
||||
switch (cie_trace.regs_saved_in_regs.length ())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
cie_return_save = ggc_alloc_reg_saved_in_data ();
|
||||
*cie_return_save = VEC_index (reg_saved_in_data,
|
||||
cie_trace.regs_saved_in_regs, 0);
|
||||
VEC_free (reg_saved_in_data, heap, cie_trace.regs_saved_in_regs);
|
||||
*cie_return_save = cie_trace.regs_saved_in_regs[0];
|
||||
cie_trace.regs_saved_in_regs.release ();
|
||||
break;
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
|
@ -2921,10 +2905,10 @@ execute_dwarf2_frame (void)
|
|||
size_t i;
|
||||
dw_trace_info *ti;
|
||||
|
||||
FOR_EACH_VEC_ELT (dw_trace_info, trace_info, i, ti)
|
||||
VEC_free (reg_saved_in_data, heap, ti->regs_saved_in_regs);
|
||||
FOR_EACH_VEC_ELT (trace_info, i, ti)
|
||||
ti->regs_saved_in_regs.release ();
|
||||
}
|
||||
VEC_free (dw_trace_info, heap, trace_info);
|
||||
trace_info.release ();
|
||||
|
||||
htab_delete (trace_index);
|
||||
trace_index = NULL;
|
||||
|
@ -3286,7 +3270,7 @@ dump_cfi_row (FILE *f, dw_cfi_row *row)
|
|||
}
|
||||
output_cfi_directive (f, cfi);
|
||||
|
||||
FOR_EACH_VEC_ELT (dw_cfi_ref, row->reg_save, i, cfi)
|
||||
FOR_EACH_VEC_SAFE_ELT (row->reg_save, i, cfi)
|
||||
if (cfi)
|
||||
output_cfi_directive (f, cfi);
|
||||
}
|
||||
|
|
377
gcc/dwarf2out.c
377
gcc/dwarf2out.c
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue