diff options
author | Diego Novillo <dnovillo@google.com> | 2012-11-17 21:54:30 -0500 |
---|---|---|
committer | Diego Novillo <dnovillo@gcc.gnu.org> | 2012-11-17 21:54:30 -0500 |
commit | 9771b26396c39dfaecd5a76dd359fb65d3be4cb6 (patch) | |
tree | 1b9f930d315fa3e0a5ed7fa6e27ec5bd0a3436a4 /gcc/fortran | |
parent | 0f4119158064e271e48a14ce3f88a67e7baf14e0 (diff) | |
download | gcc-9771b26396c39dfaecd5a76dd359fb65d3be4cb6.zip gcc-9771b26396c39dfaecd5a76dd359fb65d3be4cb6.tar.gz gcc-9771b26396c39dfaecd5a76dd359fb65d3be4cb6.tar.bz2 |
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
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/fortran/frontend-passes.c | 10 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-common.c | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 28 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 71 | ||||
-rw-r--r-- | gcc/fortran/trans-intrinsic.c | 36 | ||||
-rw-r--r-- | gcc/fortran/trans-openmp.c | 10 | ||||
-rw-r--r-- | gcc/fortran/trans-stmt.c | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-types.c | 17 | ||||
-rw-r--r-- | gcc/fortran/trans.h | 2 |
11 files changed, 112 insertions, 97 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index bb3e708..c704838 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,18 @@ +2012-11-17 Diego Novillo <dnovillo@google.com> + + Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) + + * frontend-passes.c: Use new vec API in vec.h. + * trans-array.c: Likewise. + * trans-common.c: Likewise. + * trans-decl.c: Likewise. + * trans-expr.c: Likewise. + * trans-intrinsic.c: Likewise. + * trans-openmp.c: Likewise. + * trans-stmt.c: Likewise. + * trans-types.c: Likewise. + * trans.h: Likewise. + 2012-11-17 Jakub Jelinek <jakub@redhat.com> PR fortran/55341 @@ -12,6 +27,7 @@ * resolve.c (resolve_typebound_intrinsic_op): Only add typebound operators to the operator list in the namespace of the derived type. + 2012-11-12 Jan Hubicka <jh@suse.cz> * f95-lang.c (ATTR_NOTHROW_LEAF_MALLOC_LIST): New macro. diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index 0cba911..287807e 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -38,7 +38,7 @@ static bool optimize_comparison (gfc_expr *, gfc_intrinsic_op); static bool optimize_trim (gfc_expr *); static bool optimize_lexical_comparison (gfc_expr *); static void optimize_minmaxloc (gfc_expr **); -static bool empty_string (gfc_expr *e); +static bool is_empty_string (gfc_expr *e); /* How deep we are inside an argument list. */ @@ -742,7 +742,7 @@ optimize_assignment (gfc_code * c) remove_trim (rhs); /* Replace a = ' ' by a = '' to optimize away a memcpy. */ - if (empty_string(rhs)) + if (is_empty_string(rhs)) rhs->value.character.length = 0; } @@ -865,7 +865,7 @@ optimize_op (gfc_expr *e) /* Return true if a constant string contains only blanks. */ static bool -empty_string (gfc_expr *e) +is_empty_string (gfc_expr *e) { int i; @@ -967,8 +967,8 @@ optimize_comparison (gfc_expr *e, gfc_intrinsic_op op) && (op == INTRINSIC_EQ || op == INTRINSIC_NE)) { bool empty_op1, empty_op2; - empty_op1 = empty_string (op1); - empty_op2 = empty_string (op2); + empty_op1 = is_empty_string (op1); + empty_op2 = is_empty_string (op2); if (empty_op1 || empty_op2) { diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index fc628ca..24adfde 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -1626,7 +1626,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type, else { /* Collect multiple scalar constants into a constructor. */ - VEC(constructor_elt,gc) *v = NULL; + vec<constructor_elt, va_gc> *v = NULL; tree init; tree bound; tree tmptype; @@ -1985,7 +1985,7 @@ gfc_build_constant_array_constructor (gfc_expr * expr, tree type) gfc_array_spec as; gfc_se se; int i; - VEC(constructor_elt,gc) *v = NULL; + vec<constructor_elt, va_gc> *v = NULL; /* First traverse the constructor list, converting the constants to tree to build an initializer. */ @@ -5317,7 +5317,7 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr) HOST_WIDE_INT hi; unsigned HOST_WIDE_INT lo; tree index, range; - VEC(constructor_elt,gc) *v = NULL; + vec<constructor_elt, va_gc> *v = NULL; if (expr->expr_type == EXPR_VARIABLE && expr->symtree->n.sym->attr.flavor == FL_PARAMETER diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 86cf007..474774f 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -487,7 +487,7 @@ get_init_field (segment_info *head, tree union_type, tree *field_init, tree tmp, field; tree init; unsigned char *data, *chk; - VEC(constructor_elt,gc) *v = NULL; + vec<constructor_elt, va_gc> *v = NULL; tree type = unsigned_char_type_node; int i; @@ -644,7 +644,7 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) if (is_init) { tree ctor, tmp; - VEC(constructor_elt,gc) *v = NULL; + vec<constructor_elt, va_gc> *v = NULL; if (field != NULL_TREE && field_init != NULL_TREE) CONSTRUCTOR_APPEND_ELT (v, field, field_init); @@ -664,7 +664,7 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) } } - gcc_assert (!VEC_empty (constructor_elt, v)); + gcc_assert (!v->is_empty ()); ctor = build_constructor (union_type, v); TREE_CONSTANT (ctor) = 1; TREE_STATIC (ctor) = 1; diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 7750217..c661fb3 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -2284,8 +2284,8 @@ build_entry_thunks (gfc_namespace * ns, bool global) gfc_save_backend_locus (&old_loc); for (el = ns->entries; el; el = el->next) { - VEC(tree,gc) *args = NULL; - VEC(tree,gc) *string_args = NULL; + vec<tree, va_gc> *args = NULL; + vec<tree, va_gc> *string_args = NULL; thunk_sym = el->sym; @@ -2300,16 +2300,16 @@ build_entry_thunks (gfc_namespace * ns, bool global) /* Pass extra parameter identifying this entry point. */ tmp = build_int_cst (gfc_array_index_type, el->id); - VEC_safe_push (tree, gc, args, tmp); + vec_safe_push (args, tmp); if (thunk_sym->attr.function) { if (gfc_return_by_reference (ns->proc_name)) { tree ref = DECL_ARGUMENTS (current_function_decl); - VEC_safe_push (tree, gc, args, ref); + vec_safe_push (args, ref); if (ns->proc_name->ts.type == BT_CHARACTER) - VEC_safe_push (tree, gc, args, DECL_CHAIN (ref)); + vec_safe_push (args, DECL_CHAIN (ref)); } } @@ -2333,27 +2333,27 @@ build_entry_thunks (gfc_namespace * ns, bool global) { /* Pass the argument. */ DECL_ARTIFICIAL (thunk_formal->sym->backend_decl) = 1; - VEC_safe_push (tree, gc, args, thunk_formal->sym->backend_decl); + vec_safe_push (args, thunk_formal->sym->backend_decl); if (formal->sym->ts.type == BT_CHARACTER) { tmp = thunk_formal->sym->ts.u.cl->backend_decl; - VEC_safe_push (tree, gc, string_args, tmp); + vec_safe_push (string_args, tmp); } } else { /* Pass NULL for a missing argument. */ - VEC_safe_push (tree, gc, args, null_pointer_node); + vec_safe_push (args, null_pointer_node); if (formal->sym->ts.type == BT_CHARACTER) { tmp = build_int_cst (gfc_charlen_type_node, 0); - VEC_safe_push (tree, gc, string_args, tmp); + vec_safe_push (string_args, tmp); } } } /* Call the master function. */ - VEC_safe_splice (tree, gc, args, string_args); + vec_safe_splice (args, string_args); tmp = ns->proc_name->backend_decl; tmp = build_call_expr_loc_vec (input_location, tmp, args); if (ns->proc_name->attr.mixed_entry_master) @@ -2616,7 +2616,7 @@ static tree build_library_function_decl_1 (tree name, const char *spec, tree rettype, int nargs, va_list p) { - VEC(tree,gc) *arglist; + vec<tree, va_gc> *arglist; tree fntype; tree fndecl; int n; @@ -2625,11 +2625,11 @@ build_library_function_decl_1 (tree name, const char *spec, gcc_assert (current_function_decl == NULL_TREE); /* Create a list of the argument types. */ - arglist = VEC_alloc (tree, gc, abs (nargs)); + vec_alloc (arglist, abs (nargs)); for (n = abs (nargs); n > 0; n--) { tree argtype = va_arg (p, tree); - VEC_quick_push (tree, arglist, argtype); + arglist->quick_push (argtype); } /* Build the function type and decl. */ @@ -5005,7 +5005,7 @@ create_main_function (tree fndecl) language standard parameters. */ { tree array_type, array, var; - VEC(constructor_elt,gc) *v = NULL; + vec<constructor_elt, va_gc> *v = NULL; /* Passing a new option to the library requires four modifications: + add it to the tree_cons list below diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index b0bd7f5..d6410d3 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -661,7 +661,7 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems) tree to_data; tree to_ref; tree from_ref; - VEC(tree,gc) *args; + vec<tree, va_gc> *args; tree tmp; tree index; stmtblock_t loopbody; @@ -696,13 +696,13 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems) if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (from_data))) { from_ref = gfc_get_class_array_ref (index, from); - VEC_safe_push (tree, gc, args, from_ref); + vec_safe_push (args, from_ref); } else - VEC_safe_push (tree, gc, args, from_data); + vec_safe_push (args, from_data); to_ref = gfc_get_class_array_ref (index, to); - VEC_safe_push (tree, gc, args, to_ref); + vec_safe_push (args, to_ref); tmp = build_call_vec (fcn_type, fcn, args); @@ -724,8 +724,8 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems) else { gcc_assert (!GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (from_data))); - VEC_safe_push (tree, gc, args, from_data); - VEC_safe_push (tree, gc, args, to_data); + vec_safe_push (args, from_data); + vec_safe_push (args, to_data); tmp = build_call_vec (fcn_type, fcn, args); } @@ -3822,11 +3822,11 @@ conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym, int gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, gfc_actual_arglist * args, gfc_expr * expr, - VEC(tree,gc) *append_args) + vec<tree, va_gc> *append_args) { gfc_interface_mapping mapping; - VEC(tree,gc) *arglist; - VEC(tree,gc) *retargs; + vec<tree, va_gc> *arglist; + vec<tree, va_gc> *retargs; tree tmp; tree fntype; gfc_se parmse; @@ -3837,7 +3837,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, tree var; tree len; tree base_object; - VEC(tree,gc) *stringargs; + vec<tree, va_gc> *stringargs; tree result = NULL; gfc_formal_arglist *formal; gfc_actual_arglist *arg; @@ -4608,7 +4608,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, /* Character strings are passed as two parameters, a length and a pointer - except for Bind(c) which only passes the pointer. */ if (parmse.string_length != NULL_TREE && !sym->attr.is_bind_c) - VEC_safe_push (tree, gc, stringargs, parmse.string_length); + vec_safe_push (stringargs, parmse.string_length); /* For descriptorless coarrays and assumed-shape coarray dummies, we pass the token and the offset as additional arguments. */ @@ -4618,9 +4618,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, && e == NULL) { /* Token and offset. */ - VEC_safe_push (tree, gc, stringargs, null_pointer_node); - VEC_safe_push (tree, gc, stringargs, - build_int_cst (gfc_array_index_type, 0)); + vec_safe_push (stringargs, null_pointer_node); + vec_safe_push (stringargs, build_int_cst (gfc_array_index_type, 0)); gcc_assert (fsym->attr.optional); } else if (fsym && fsym->attr.codimension @@ -4646,7 +4645,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, tmp = GFC_TYPE_ARRAY_CAF_TOKEN (caf_type); } - VEC_safe_push (tree, gc, stringargs, tmp); + vec_safe_push (stringargs, tmp); if (GFC_DESCRIPTOR_TYPE_P (caf_type) && GFC_TYPE_ARRAY_AKIND (caf_type) == GFC_ARRAY_ALLOCATABLE) @@ -4692,10 +4691,10 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, offset = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, offset, tmp); - VEC_safe_push (tree, gc, stringargs, offset); + vec_safe_push (stringargs, offset); } - VEC_safe_push (tree, gc, arglist, parmse.expr); + vec_safe_push (arglist, parmse.expr); } gfc_finish_interface_mapping (&mapping, &se->pre, &se->post); @@ -4719,7 +4718,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, if (ts.deferred) cl.backend_decl = gfc_create_var (gfc_charlen_type_node, "slen"); else if (!sym->attr.dummy) - cl.backend_decl = VEC_index (tree, stringargs, 0); + cl.backend_decl = (*stringargs)[0]; else { formal = sym->ns->proc_name->formal; @@ -4796,7 +4795,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, else result = build_fold_indirect_ref_loc (input_location, se->expr); - VEC_safe_push (tree, gc, retargs, se->expr); + vec_safe_push (retargs, se->expr); } else if (comp && comp->attr.dimension) { @@ -4832,7 +4831,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, /* Pass the temporary as the first argument. */ result = info->descriptor; tmp = gfc_build_addr_expr (NULL_TREE, result); - VEC_safe_push (tree, gc, retargs, tmp); + vec_safe_push (retargs, tmp); } else if (!comp && sym->result->attr.dimension) { @@ -4868,7 +4867,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, /* Pass the temporary as the first argument. */ result = info->descriptor; tmp = gfc_build_addr_expr (NULL_TREE, result); - VEC_safe_push (tree, gc, retargs, tmp); + vec_safe_push (retargs, tmp); } else if (ts.type == BT_CHARACTER) { @@ -4899,7 +4898,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, else var = gfc_conv_string_tmp (se, type, len); - VEC_safe_push (tree, gc, retargs, var); + vec_safe_push (retargs, var); } else { @@ -4907,7 +4906,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, type = gfc_get_complex_type (ts.kind); var = gfc_build_addr_expr (NULL_TREE, gfc_create_var (type, "cmplx")); - VEC_safe_push (tree, gc, retargs, var); + vec_safe_push (retargs, var); } /* Add the string length to the argument list. */ @@ -4917,28 +4916,28 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, if (TREE_CODE (tmp) != VAR_DECL) tmp = gfc_evaluate_now (len, &se->pre); tmp = gfc_build_addr_expr (NULL_TREE, tmp); - VEC_safe_push (tree, gc, retargs, tmp); + vec_safe_push (retargs, tmp); } else if (ts.type == BT_CHARACTER) - VEC_safe_push (tree, gc, retargs, len); + vec_safe_push (retargs, len); } gfc_free_interface_mapping (&mapping); /* We need to glom RETARGS + ARGLIST + STRINGARGS + APPEND_ARGS. */ - arglen = (VEC_length (tree, arglist) - + VEC_length (tree, stringargs) + VEC_length (tree, append_args)); - VEC_reserve_exact (tree, gc, retargs, arglen); + arglen = (vec_safe_length (arglist) + vec_safe_length (stringargs) + + vec_safe_length (append_args)); + vec_safe_reserve (retargs, arglen); /* Add the return arguments. */ - VEC_splice (tree, retargs, arglist); + retargs->splice (arglist); /* Add the hidden string length parameters to the arguments. */ - VEC_splice (tree, retargs, stringargs); + retargs->splice (stringargs); /* We may want to append extra arguments here. This is used e.g. for calls to libgfortran_matmul_??, which need extra information. */ - if (!VEC_empty (tree, append_args)) - VEC_splice (tree, retargs, append_args); + if (!vec_safe_is_empty (append_args)) + retargs->splice (append_args); arglist = retargs; /* Generate the actual call. */ @@ -5423,7 +5422,8 @@ gfc_conv_function_expr (gfc_se * se, gfc_expr * expr) if (!sym) sym = expr->symtree->n.sym; - gfc_conv_procedure_call (se, sym, expr->value.function.actual, expr, NULL); + gfc_conv_procedure_call (se, sym, expr->value.function.actual, expr, + NULL); } @@ -5965,7 +5965,7 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init) tree val; tree type; tree tmp; - VEC(constructor_elt,gc) *v = NULL; + vec<constructor_elt, va_gc> *v = NULL; gcc_assert (se->ss == NULL); gcc_assert (expr->expr_type == EXPR_STRUCTURE); @@ -7139,7 +7139,8 @@ gfc_trans_zero_assign (gfc_expr * expr) a = {} instead. */ if (!POINTER_TYPE_P (TREE_TYPE (dest))) return build2_loc (input_location, MODIFY_EXPR, void_type_node, - dest, build_constructor (TREE_TYPE (dest), NULL)); + dest, build_constructor (TREE_TYPE (dest), + NULL)); /* Convert arguments to the correct types. */ dest = fold_convert (pvoid_type_node, dest); diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index a31284e..5d9ce5c 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -724,7 +724,7 @@ static tree gfc_get_intrinsic_lib_fndecl (gfc_intrinsic_map_t * m, gfc_expr * expr) { tree type; - VEC(tree,gc) *argtypes; + vec<tree, va_gc> *argtypes; tree fndecl; gfc_actual_arglist *actual; tree *pdecl; @@ -809,7 +809,7 @@ gfc_get_intrinsic_lib_fndecl (gfc_intrinsic_map_t * m, gfc_expr * expr) for (actual = expr->value.function.actual; actual; actual = actual->next) { type = gfc_typenode_for_spec (&actual->expr->ts); - VEC_safe_push (tree, gc, argtypes, type); + vec_safe_push (argtypes, type); } type = build_function_type_vec (gfc_typenode_for_spec (ts), argtypes); fndecl = build_decl (input_location, @@ -2341,7 +2341,7 @@ static void gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr) { gfc_symbol *sym; - VEC(tree,gc) *append_args; + vec<tree, va_gc> *append_args; gcc_assert (!se->ss || se->ss->info->expr == expr); @@ -2381,19 +2381,19 @@ gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr) gemm_fndecl = gfor_fndecl_zgemm; } - append_args = VEC_alloc (tree, gc, 3); - VEC_quick_push (tree, append_args, build_int_cst (cint, 1)); - VEC_quick_push (tree, append_args, - build_int_cst (cint, gfc_option.blas_matmul_limit)); - VEC_quick_push (tree, append_args, - gfc_build_addr_expr (NULL_TREE, gemm_fndecl)); + vec_alloc (append_args, 3); + append_args->quick_push (build_int_cst (cint, 1)); + append_args->quick_push (build_int_cst (cint, + gfc_option.blas_matmul_limit)); + append_args->quick_push (gfc_build_addr_expr (NULL_TREE, + gemm_fndecl)); } else { - append_args = VEC_alloc (tree, gc, 3); - VEC_quick_push (tree, append_args, build_int_cst (cint, 0)); - VEC_quick_push (tree, append_args, build_int_cst (cint, 0)); - VEC_quick_push (tree, append_args, null_pointer_node); + vec_alloc (append_args, 3); + append_args->quick_push (build_int_cst (cint, 0)); + append_args->quick_push (build_int_cst (cint, 0)); + append_args->quick_push (null_pointer_node); } } @@ -4486,7 +4486,7 @@ conv_generic_with_optional_char_arg (gfc_se* se, gfc_expr* expr, unsigned cur_pos; gfc_actual_arglist* arg; gfc_symbol* sym; - VEC(tree,gc) *append_args; + vec<tree, va_gc> *append_args; /* Find the two arguments given as position. */ cur_pos = 0; @@ -4516,8 +4516,8 @@ conv_generic_with_optional_char_arg (gfc_se* se, gfc_expr* expr, tree dummy; dummy = build_int_cst (gfc_charlen_type_node, 0); - append_args = VEC_alloc (tree, gc, 1); - VEC_quick_push (tree, append_args, dummy); + vec_alloc (append_args, 1); + append_args->quick_push (dummy); } /* Build the call itself. */ @@ -5985,7 +5985,7 @@ gfc_conv_intrinsic_sr_kind (gfc_se *se, gfc_expr *expr) gfc_actual_arglist *actual; tree type; gfc_se argse; - VEC(tree,gc) *args = NULL; + vec<tree, va_gc> *args = NULL; for (actual = expr->value.function.actual; actual; actual = actual->next) { @@ -6011,7 +6011,7 @@ gfc_conv_intrinsic_sr_kind (gfc_se *se, gfc_expr *expr) gfc_add_block_to_block (&se->pre, &argse.pre); gfc_add_block_to_block (&se->post, &argse.post); - VEC_safe_push (tree, gc, args, argse.expr); + vec_safe_push (args, argse.expr); } /* Convert it to the required type. */ diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index e843692..a844b08 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -1293,8 +1293,6 @@ typedef struct dovar_init_d { tree init; } dovar_init; -DEF_VEC_O(dovar_init); -DEF_VEC_ALLOC_O(dovar_init,heap); static tree gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, @@ -1307,7 +1305,7 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, stmtblock_t body; gfc_omp_clauses *clauses = code->ext.omp_clauses; int i, collapse = clauses->collapse; - VEC(dovar_init,heap) *inits = NULL; + vec<dovar_init> inits = vec<dovar_init>(); dovar_init *di; unsigned ix; @@ -1435,7 +1433,7 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, tmp = fold_build2_loc (input_location, MULT_EXPR, type, count, step); tmp = fold_build2_loc (input_location, PLUS_EXPR, type, from, tmp); dovar_init e = {dovar, tmp}; - VEC_safe_push (dovar_init, heap, inits, e); + inits.safe_push (e); } if (!dovar_found) @@ -1506,9 +1504,9 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, gfc_start_block (&body); - FOR_EACH_VEC_ELT (dovar_init, inits, ix, di) + FOR_EACH_VEC_ELT (inits, ix, di) gfc_add_modify (&body, di->var, di->init); - VEC_free (dovar_init, heap, inits); + inits.release (); /* Cycle statement is implemented with a goto. Exit statement must not be present for this loop. */ diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index de22ce0..bdc559b 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -489,7 +489,8 @@ gfc_trans_call (gfc_code * code, bool dependency_check, /* Add the subroutine call to the block. */ gfc_conv_procedure_call (&loopse, code->resolved_sym, - code->ext.actual, code->expr1, NULL); + code->ext.actual, code->expr1, + NULL); if (mask && count1) { @@ -2094,7 +2095,7 @@ gfc_trans_character_select (gfc_code *code) gfc_code *c; gfc_se se, expr1se; int n, k; - VEC(constructor_elt,gc) *inits = NULL; + vec<constructor_elt, va_gc> *inits = NULL; tree pchartype = gfc_get_pchar_type (code->expr1->ts.kind); @@ -2322,7 +2323,7 @@ gfc_trans_character_select (gfc_code *code) /* Generate the structure describing the branches */ for (d = cp; d; d = d->right) { - VEC(constructor_elt,gc) *node = NULL; + vec<constructor_elt, va_gc> *node = NULL; gfc_init_se (&se, NULL); diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 81b7fa5..35a39c5 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -2690,7 +2690,7 @@ tree gfc_get_function_type (gfc_symbol * sym) { tree type; - VEC(tree,gc) *typelist; + vec<tree, va_gc> *typelist; gfc_formal_arglist *f; gfc_symbol *arg; int alternate_return; @@ -2713,7 +2713,7 @@ gfc_get_function_type (gfc_symbol * sym) if (sym->attr.entry_master) /* Additional parameter for selecting an entry point. */ - VEC_safe_push (tree, gc, typelist, gfc_array_index_type); + vec_safe_push (typelist, gfc_array_index_type); if (sym->result) arg = sym->result; @@ -2732,17 +2732,16 @@ gfc_get_function_type (gfc_symbol * sym) || arg->ts.type == BT_CHARACTER) type = build_reference_type (type); - VEC_safe_push (tree, gc, typelist, type); + vec_safe_push (typelist, type); if (arg->ts.type == BT_CHARACTER) { if (!arg->ts.deferred) /* Transfer by value. */ - VEC_safe_push (tree, gc, typelist, gfc_charlen_type_node); + vec_safe_push (typelist, gfc_charlen_type_node); else /* Deferred character lengths are transferred by reference so that the value can be returned. */ - VEC_safe_push (tree, gc, typelist, - build_pointer_type (gfc_charlen_type_node)); + vec_safe_push (typelist, build_pointer_type(gfc_charlen_type_node)); } } @@ -2780,7 +2779,7 @@ gfc_get_function_type (gfc_symbol * sym) used without an explicit interface, and cannot be passed as actual parameters for a dummy procedure. */ - VEC_safe_push (tree, gc, typelist, type); + vec_safe_push (typelist, type); } else { @@ -2803,11 +2802,11 @@ gfc_get_function_type (gfc_symbol * sym) so that the value can be returned. */ type = build_pointer_type (gfc_charlen_type_node); - VEC_safe_push (tree, gc, typelist, type); + vec_safe_push (typelist, type); } } - if (!VEC_empty (tree, typelist) + if (!vec_safe_is_empty (typelist) || sym->attr.is_main_program || sym->attr.if_source != IFSRC_UNKNOWN) is_varargs = false; diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 652893e..954dcd3 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -427,7 +427,7 @@ int gfc_is_intrinsic_libcall (gfc_expr *); /* Used to call ordinary functions/subroutines and procedure pointer components. */ int gfc_conv_procedure_call (gfc_se *, gfc_symbol *, gfc_actual_arglist *, - gfc_expr *, VEC(tree,gc) *); + gfc_expr *, vec<tree, va_gc> *); void gfc_conv_subref_array_arg (gfc_se *, gfc_expr *, int, sym_intent, bool); |