From 48e1416a24d50cacbb2a5e06a9ee61dd8cbee313 Mon Sep 17 00:00:00 2001 From: hjl Date: Wed, 25 Nov 2009 10:55:54 +0000 Subject: Remove trailing white spaces. 2009-11-25 H.J. Lu * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: 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-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: 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-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: 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-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.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.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154645 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/vec.h | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'gcc/vec.h') diff --git a/gcc/vec.h b/gcc/vec.h index d16fdaacbb4..e8bdde8851c 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -86,12 +86,12 @@ along with GCC; see the file COPYING3. If not see when the type is defined, and is therefore part of the type. If you need both gc'd and heap allocated versions, you still must have *exactly* one definition of the common non-memory managed base vector. - + If you need to directly manipulate a vector, then the 'address' accessor will return the address of the start of the vector. Also the 'space' predicate will tell you whether there is spare capacity in the vector. You will not normally need to use these two functions. - + Vector types are defined using a DEF_VEC_{O,P,I}(TYPEDEF) macro, to get the non-memory allocation version, and then a DEF_VEC_ALLOC_{O,P,I}(TYPEDEF,ALLOC) macro to get memory managed @@ -204,10 +204,10 @@ along with GCC; see the file COPYING3. If not see /* Use these to determine the required size and initialization of a vector embedded within another structure (as the final member). - + size_t VEC_T_embedded_size(int reserve); void VEC_T_embedded_init(VEC(T) *v, int reserve); - + These allow the caller to perform the memory allocation. */ #define VEC_embedded_size(T,N) (VEC_OP(T,base,embedded_size)(N)) @@ -222,7 +222,7 @@ along with GCC; see the file COPYING3. If not see #define VEC_copy(T,A,V) (VEC_OP(T,A,copy)(VEC_BASE(V) MEM_STAT_INFO)) /* Determine if a vector has additional capacity. - + int VEC_T_space (VEC(T) *v,int reserve) If V has space for RESERVE additional entries, return nonzero. You @@ -260,7 +260,7 @@ along with GCC; see the file COPYING3. If not see T *VEC_T_quick_push (VEC(T) *v, T obj); // Integer T *VEC_T_quick_push (VEC(T) *v, T obj); // Pointer T *VEC_T_quick_push (VEC(T) *v, T *obj); // Object - + Push a new element onto the end, returns a pointer to the slot filled in. For object vectors, the new value can be NULL, in which case NO initialization is performed. There must @@ -273,7 +273,7 @@ along with GCC; see the file COPYING3. If not see T *VEC_T_A_safe_push (VEC(T,A) *&v, T obj); // Integer T *VEC_T_A_safe_push (VEC(T,A) *&v, T obj); // Pointer T *VEC_T_A_safe_push (VEC(T,A) *&v, T *obj); // Object - + Push a new element onto the end, returns a pointer to the slot filled in. For object vectors, the new value can be NULL, in which case NO initialization is performed. Reallocates V, if needed. */ @@ -293,7 +293,7 @@ along with GCC; see the file COPYING3. If not see /* Truncate to specific length void VEC_T_truncate (VEC(T) *v, unsigned len); - + Set the length as specified. The new length must be less than or equal to the current length. This is an O(1) operation. */ @@ -324,7 +324,7 @@ along with GCC; see the file COPYING3. If not see T VEC_T_replace (VEC(T) *v, unsigned ix, T val); // Integer T VEC_T_replace (VEC(T) *v, unsigned ix, T val); // Pointer T *VEC_T_replace (VEC(T) *v, unsigned ix, T *val); // Object - + Replace the IXth element of V with a new value, VAL. For pointer vectors returns the original value. For object vectors returns a pointer to the new value. For object vectors the new value can be @@ -338,7 +338,7 @@ along with GCC; see the file COPYING3. If not see T *VEC_T_quick_insert (VEC(T) *v, unsigned ix, T val); // Integer T *VEC_T_quick_insert (VEC(T) *v, unsigned ix, T val); // Pointer T *VEC_T_quick_insert (VEC(T) *v, unsigned ix, T *val); // Object - + Insert an element, VAL, at the IXth position of V. Return a pointer to the slot created. For vectors of object, the new value can be NULL, in which case no initialization of the inserted slot takes @@ -351,7 +351,7 @@ along with GCC; see the file COPYING3. If not see T *VEC_T_A_safe_insert (VEC(T,A) *&v, unsigned ix, T val); // Integer T *VEC_T_A_safe_insert (VEC(T,A) *&v, unsigned ix, T val); // Pointer T *VEC_T_A_safe_insert (VEC(T,A) *&v, unsigned ix, T *val); // Object - + Insert an element, VAL, at the IXth position of V. Return a pointer to the slot created. For vectors of object, the new value can be NULL, in which case no initialization of the inserted slot takes @@ -359,12 +359,12 @@ along with GCC; see the file COPYING3. If not see #define VEC_safe_insert(T,A,V,I,O) \ (VEC_OP(T,A,safe_insert)(&(V),I,O VEC_CHECK_INFO MEM_STAT_INFO)) - + /* Remove element retaining order T VEC_T_ordered_remove (VEC(T) *v, unsigned ix); // Integer T VEC_T_ordered_remove (VEC(T) *v, unsigned ix); // Pointer void VEC_T_ordered_remove (VEC(T) *v, unsigned ix); // Object - + Remove an element from the IXth position of V. Ordering of remaining elements is preserved. For pointer vectors returns the removed object. This is an O(N) operation due to a memmove. */ @@ -376,7 +376,7 @@ along with GCC; see the file COPYING3. If not see T VEC_T_unordered_remove (VEC(T) *v, unsigned ix); // Integer T VEC_T_unordered_remove (VEC(T) *v, unsigned ix); // Pointer void VEC_T_unordered_remove (VEC(T) *v, unsigned ix); // Object - + Remove an element from the IXth position of V. Ordering of remaining elements is destroyed. For pointer vectors returns the removed object. This is an O(1) operation. */ @@ -386,7 +386,7 @@ along with GCC; see the file COPYING3. If not see /* Remove a block of elements void VEC_T_block_remove (VEC(T) *v, unsigned ix, unsigned len); - + Remove LEN elements starting at the IXth. Ordering is retained. This is an O(1) operation. */ @@ -402,17 +402,17 @@ along with GCC; see the file COPYING3. If not see #define VEC_address(T,V) (VEC_OP(T,base,address)(VEC_BASE(V))) /* Find the first index in the vector not less than the object. - unsigned VEC_T_lower_bound (VEC(T) *v, const T val, + unsigned VEC_T_lower_bound (VEC(T) *v, const T val, bool (*lessthan) (const T, const T)); // Integer - unsigned VEC_T_lower_bound (VEC(T) *v, const T val, + unsigned VEC_T_lower_bound (VEC(T) *v, const T val, bool (*lessthan) (const T, const T)); // Pointer unsigned VEC_T_lower_bound (VEC(T) *v, const T *val, bool (*lessthan) (const T*, const T*)); // Object - + Find the first position in which VAL could be inserted without changing the ordering of V. LESSTHAN is a function that returns true if the first argument is strictly less than the second. */ - + #define VEC_lower_bound(T,V,O,LT) \ (VEC_OP(T,base,lower_bound)(VEC_BASE(V),O,LT VEC_CHECK_INFO)) @@ -440,7 +440,7 @@ void vec_heap_free (void *); #define VEC_CHECK_INFO ,__FILE__,__LINE__,__FUNCTION__ #define VEC_CHECK_DECL ,const char *file_,unsigned line_,const char *function_ #define VEC_CHECK_PASS ,file_,line_,function_ - + #define VEC_ASSERT(EXPR,OP,T,A) \ (void)((EXPR) ? 0 : (VEC_ASSERT_FAIL(OP,VEC(T,A)), 0)) @@ -461,7 +461,7 @@ extern void vec_assert_fail (const char *, const char * VEC_CHECK_DECL) #define VEC(T,A) VEC_##T##_##A #define VEC_OP(T,A,OP) VEC_##T##_##A##_##OP -/* Base of vector type, not user visible. */ +/* Base of vector type, not user visible. */ #define VEC_T(T,B) \ typedef struct VEC(T,B) \ { \ -- cgit v1.2.1 From d3ab9b67ea650c4b3711fb8e6c2ebe16c8d12ebf Mon Sep 17 00:00:00 2001 From: aoliva Date: Sat, 9 Jan 2010 14:34:43 +0000 Subject: * vec.h (DEF_VEC_ALLOC_FUNC_O_STACK): Drop excess paren. (DEF_VEC_ALLOC_FUNC_I_STACK): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155760 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/vec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/vec.h') diff --git a/gcc/vec.h b/gcc/vec.h index e8bdde8851c..808503469cd 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -1262,7 +1262,7 @@ struct vec_swallow_trailing_semi static inline VEC(T,stack) *VEC_OP (T,stack,alloc1) \ (int alloc_, VEC(T,stack)* space) \ { \ - return ((VEC(T,stack) *) vec_stack_p_reserve_exact_1 (alloc_, space); \ + return (VEC(T,stack) *) vec_stack_p_reserve_exact_1 (alloc_, space); \ } #define DEF_VEC_ALLOC_I_STACK(T) \ @@ -1275,7 +1275,7 @@ struct vec_swallow_trailing_semi static inline VEC(T,stack) *VEC_OP (T,stack,alloc1) \ (int alloc_, VEC(T,stack)* space) \ { \ - return ((VEC(T,stack) *) vec_stack_p_reserve_exact_1 (alloc_, space); \ + return (VEC(T,stack) *) vec_stack_p_reserve_exact_1 (alloc_, space); \ } #endif /* GCC_VEC_H */ -- cgit v1.2.1 From 7368569212f3e0ab9a02ad46b5721b760ea5971d Mon Sep 17 00:00:00 2001 From: aoliva Date: Sat, 9 Jan 2010 14:46:25 +0000 Subject: Update copyright notices of my recent commits. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155766 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/vec.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/vec.h') diff --git a/gcc/vec.h b/gcc/vec.h index 808503469cd..8cb9c5871b6 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -1,5 +1,6 @@ /* Vector API for GNU compiler. - Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. Contributed by Nathan Sidwell This file is part of GCC. -- cgit v1.2.1 From ea269688eb364b8fae1926eb56bf4e3404f51873 Mon Sep 17 00:00:00 2001 From: steven Date: Sat, 29 May 2010 00:14:50 +0000 Subject: gcc/ChangeLog: * vec.h: Include statistics.h * Makefile.in: Introduce VEC_H. Replace all vec.h dependencies with VEC_H. lto/ChangeLog: * Make-lang.in: Replace vec.h dependency with VEC_H. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160010 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/vec.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/vec.h') diff --git a/gcc/vec.h b/gcc/vec.h index 8cb9c5871b6..c32bf8829e3 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_VEC_H #define GCC_VEC_H +#include "statistics.h" /* For MEM_STAT_DECL. */ + /* The macros here implement a set of templated vector types and associated interfaces. These templates are implemented with macros, as we're not in C++ land. The interface functions are -- cgit v1.2.1 From 5df674ea0861a65eecd855a93da4c64c226a4861 Mon Sep 17 00:00:00 2001 From: froydnj Date: Mon, 28 Jun 2010 12:04:54 +0000 Subject: gcc/ * vec.h (vec_heap_free): Add parentheses around free. gcc/fortran/ * trans-openmp.c (dovar_init): Define. Define VECs containing it. (gfc_trans_omp_do): Use a VEC to accumulate variables and their initializers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161486 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/vec.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/vec.h') diff --git a/gcc/vec.h b/gcc/vec.h index c32bf8829e3..93a432df839 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -436,7 +436,8 @@ extern void dump_vec_loc_statistics (void); #ifdef GATHER_STATISTICS void vec_heap_free (void *); #else -#define vec_heap_free(V) free (V) +/* Avoid problems with frontends that #define free(x). */ +#define vec_heap_free(V) (free) (V) #endif #if ENABLE_CHECKING -- cgit v1.2.1 From 008f96d836284b65ab4bc3ee81b62d2bd84ba452 Mon Sep 17 00:00:00 2001 From: froydnj Date: Mon, 5 Jul 2010 12:46:52 +0000 Subject: gcc/ * vec.h (VEC_splice, VEC_safe_splice): New macros. Add function implementations. gcc/fortran/ * trans.h (gfc_conv_procedure_call): Take a VEC instead of a tree. * trans-intrinsic.c (gfc_conv_intrinsic_funcall): Adjust for new type of gfc_conv_procedure_call. (conv_generic_with_optional_char_arg): Likewise. * trans-stmt.c (gfc_trans_call): Likewise. * trans-expr.c (gfc_conv_function_expr): Likewise. (gfc_conv_procedure_call): Use build_call_vec instead of build_call_list. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161834 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/vec.h | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'gcc/vec.h') diff --git a/gcc/vec.h b/gcc/vec.h index 93a432df839..e6c42bc0a60 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -259,6 +259,32 @@ along with GCC; see the file COPYING3. If not see #define VEC_reserve_exact(T,A,V,R) \ (VEC_OP(T,A,reserve_exact)(&(V),R VEC_CHECK_INFO MEM_STAT_INFO)) +/* Copy elements with no reallocation + void VEC_T_splice (VEC(T) *dst, VEC(T) *src); // Integer + void VEC_T_splice (VEC(T) *dst, VEC(T) *src); // Pointer + void VEC_T_splice (VEC(T) *dst, VEC(T) *src); // Object + + Copy the elements in SRC to the end of DST as if by memcpy. DST and + SRC need not be allocated with the same mechanism, although they most + often will be. DST is assumed to have sufficient headroom + available. */ + +#define VEC_splice(T,DST,SRC) \ + (VEC_OP(T,base,splice)(VEC_BASE(DST), VEC_BASE(SRC) VEC_CHECK_INFO)) + +/* Copy elements with reallocation + void VEC_T_safe_splice (VEC(T,A) *&dst, VEC(T) *src); // Integer + void VEC_T_safe_splice (VEC(T,A) *&dst, VEC(T) *src); // Pointer + void VEC_T_safe_splice (VEC(T,A) *&dst, VEC(T) *src); // Object + + Copy the elements in SRC to the end of DST as if by memcpy. DST and + SRC need not be allocated with the same mechanism, although they most + often will be. DST need not have sufficient headroom and will be + reallocated if needed. */ + +#define VEC_safe_splice(T,A,DST,SRC) \ + (VEC_OP(T,A,safe_splice)(&(DST), VEC_BASE(SRC) VEC_CHECK_INFO MEM_STAT_INFO)) + /* Push object with no reallocation T *VEC_T_quick_push (VEC(T) *v, T obj); // Integer T *VEC_T_quick_push (VEC(T) *v, T obj); // Pointer @@ -589,6 +615,19 @@ static inline int VEC_OP (T,base,space) \ return vec_ ? vec_->alloc - vec_->num >= (unsigned)alloc_ : !alloc_; \ } \ \ +static inline void VEC_OP(T,base,splice) \ + (VEC(T,base) *dst_, VEC(T,base) *src_ VEC_CHECK_DECL) \ +{ \ + if (src_) \ + { \ + unsigned len_ = src_->num; \ + VEC_ASSERT (dst_->num + len_ <= dst_->alloc, "splice", T, base); \ + \ + memcpy (&dst_->vec[dst_->num], &src_->vec[0], len_ * sizeof (T)); \ + dst_->num += len_; \ + } \ +} \ + \ static inline T *VEC_OP (T,base,quick_push) \ (VEC(T,base) *vec_, T obj_ VEC_CHECK_DECL) \ { \ @@ -796,6 +835,19 @@ static inline void VEC_OP (T,A,safe_grow_cleared) \ sizeof (T) * (size_ - oldsize)); \ } \ \ +static inline void VEC_OP(T,A,safe_splice) \ + (VEC(T,A) **dst_, VEC(T,base) *src_ VEC_CHECK_DECL MEM_STAT_DECL) \ +{ \ + if (src_) \ + { \ + VEC_OP (T,A,reserve_exact) (dst_, src_->num \ + VEC_CHECK_PASS MEM_STAT_INFO); \ + \ + VEC_OP (T,base,splice) (VEC_BASE (*dst_), src_ \ + VEC_CHECK_PASS); \ + } \ +} \ + \ static inline T *VEC_OP (T,A,safe_push) \ (VEC(T,A) **vec_, T obj_ VEC_CHECK_DECL MEM_STAT_DECL) \ { \ @@ -881,6 +933,19 @@ static inline int VEC_OP (T,base,space) \ return vec_ ? vec_->alloc - vec_->num >= (unsigned)alloc_ : !alloc_; \ } \ \ +static inline void VEC_OP(T,base,splice) \ + (VEC(T,base) *dst_, VEC(T,base) *src_ VEC_CHECK_DECL) \ +{ \ + if (src_) \ + { \ + unsigned len_ = src_->num; \ + VEC_ASSERT (dst_->num + len_ <= dst_->alloc, "splice", T, base); \ + \ + memcpy (&dst_->vec[dst_->num], &src_->vec[0], len_ * sizeof (T)); \ + dst_->num += len_; \ + } \ +} \ + \ static inline T *VEC_OP (T,base,quick_push) \ (VEC(T,base) *vec_, const T *obj_ VEC_CHECK_DECL) \ { \ @@ -1084,6 +1149,19 @@ static inline void VEC_OP (T,A,safe_grow_cleared) \ sizeof (T) * (size_ - oldsize)); \ } \ \ +static inline void VEC_OP(T,A,safe_splice) \ + (VEC(T,A) **dst_, VEC(T,base) *src_ VEC_CHECK_DECL MEM_STAT_DECL) \ +{ \ + if (src_) \ + { \ + VEC_OP (T,A,reserve_exact) (dst_, src_->num \ + VEC_CHECK_PASS MEM_STAT_INFO); \ + \ + VEC_OP (T,base,splice) (VEC_BASE (*dst_), src_ \ + VEC_CHECK_PASS); \ + } \ +} \ + \ static inline T *VEC_OP (T,A,safe_push) \ (VEC(T,A) **vec_, const T *obj_ VEC_CHECK_DECL MEM_STAT_DECL) \ { \ @@ -1188,6 +1266,19 @@ static inline void VEC_OP (T,A,safe_grow_cleared) \ sizeof (T) * (size_ - oldsize)); \ } \ \ +static inline void VEC_OP(T,A,safe_splice) \ + (VEC(T,A) **dst_, VEC(T,base) *src_ VEC_CHECK_DECL MEM_STAT_DECL) \ +{ \ + if (src_) \ + { \ + VEC_OP (T,A,reserve_exact) (dst_, src_->num \ + VEC_CHECK_PASS MEM_STAT_INFO); \ + \ + VEC_OP (T,base,splice) (VEC_BASE (*dst_), src_ \ + VEC_CHECK_PASS); \ + } \ +} \ + \ static inline T *VEC_OP (T,A,safe_push) \ (VEC(T,A) **vec_, const T obj_ VEC_CHECK_DECL MEM_STAT_DECL) \ { \ -- cgit v1.2.1 From 2ab2ce89368289e93c9022aae8689f109c132f5c Mon Sep 17 00:00:00 2001 From: froydnj Date: Tue, 6 Jul 2010 02:26:33 +0000 Subject: gcc/ * vec.h (FOR_EACH_VEC_ELT_REVERSE): New macro. * function.h (struct_function): Change type of local_decls field to a VEC. (add_local_decl): New function. (FOR_EACH_LOCAL_DECL): New macro. * cfgexpand.c (init_vars_expansion): Adjust for new type of cfun->local_decls. (estimated_stack_frame_size): Likewise. (expand_used_vars): Likewise. * cgraphbuild.c (build_cgraph_edges): Likewise. * function.c (instantiate_decls_1): Likewise. * ipa-struct-reorg.c (build_data_structure): Likewise. * ipa-type-escape.c (analyze_function): Likewise. * lto-streamer-in.c (input_function): Likewise. * lto-streamer-out.c (output_function): Likewise. * tree-ssa-live.c (remove_unused_locals): Likewise. * tree.c (free_lang_data_in_decl): Likewise. (find_decls_types_in_node): Likewise. * omp-low.c (remove_exit_barrier): Likewise. (expand_omp_taskreg): Likewise. (list2chain): Rename to... (vec2chain): ...this. Adjust. * cgraphunit.c (assemble_thunk): Call add_local_decl. * tree-cfg.c (replace_by_duplicate_decl): Likewise. * gimple-low.c (record_vars_into): Likewise. * tree-inline.c (remap_decls): Likewise. (declare_return_variable): Likewise. (declare_inline_vars): Likewise. (copy_forbidden): Adjust for new type of cfun->local_decls. (add_local_variables): New function. (expand_call_inline): Call it. (tree_function_versioning): Likewise. gcc/cp/ * decl.c (cp_finish_decl): Call add_local_decl. * optimize.c (clone_body): Adjust for new type of cfun->local_decls. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161862 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/vec.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/vec.h') diff --git a/gcc/vec.h b/gcc/vec.h index e6c42bc0a60..a652250112d 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -190,6 +190,13 @@ along with GCC; see the file COPYING3. If not see #define VEC_iterate(T,V,I,P) (VEC_OP(T,base,iterate)(VEC_BASE(V),I,&(P))) +/* Convenience macro for reverse iteration. */ + +#define FOR_EACH_VEC_ELT_REVERSE(T,V,I,P) \ + for (I = VEC_length (T, (V)) - 1; \ + VEC_iterate (T, (V), (I), (P)); \ + (I)--) + /* Allocate new vector. VEC(T,A) *VEC_T_A_alloc(int reserve); -- cgit v1.2.1 From 501bdd19602fbf922920551646c1e974a29f3dc1 Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 13 Jul 2010 06:59:56 +0000 Subject: PR debug/44901 * vec.h (VEC_block_remove): Fix comment. * tree-ssa-live.c (remove_unused_locals): Don't use VEC_unordered_remove on local_decls, instead replace a single vector element in each iteration if at least one element had to be removed and VEC_truncate at the end. * omp-low.c (expand_omp_taskreg): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162126 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/vec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/vec.h') diff --git a/gcc/vec.h b/gcc/vec.h index a652250112d..321b13fc2ce 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -424,7 +424,7 @@ along with GCC; see the file COPYING3. If not see void VEC_T_block_remove (VEC(T) *v, unsigned ix, unsigned len); Remove LEN elements starting at the IXth. Ordering is retained. - This is an O(1) operation. */ + This is an O(N) operation due to memmove. */ #define VEC_block_remove(T,V,I,L) \ (VEC_OP(T,base,block_remove)(VEC_BASE(V),I,L VEC_CHECK_INFO)) -- cgit v1.2.1