Re: Re-implement VEC_* to be member functions of vec_t

2012-09-04 Thread Diego Novillo
On Fri, Aug 24, 2012 at 2:32 PM, Diego Novillo wrote: > On 2012-08-23 23:08 , Diego Novillo wrote: > >> I've tested this patch on x86_64 and ppc64 with all languages plus >> ada, go and obj-c++. I am going to be offline for several days >> starting on Saturday, so I will not commit it until I ret

Re: Re-implement VEC_* to be member functions of vec_t

2012-09-03 Thread Richard Guenther
On Fri, 24 Aug 2012, Diego Novillo wrote: > On 2012-08-24 12:03 , Gabriel Dos Reis wrote: > > > I would just use C++ standard function `at()' (e.g. as found in vector) > > for this. > > Sure. For regular functions, using default-valued arguments would be fine. > But I think the mechanism would

Re: Re-implement VEC_* to be member functions of vec_t

2012-09-03 Thread Richard Guenther
On Thu, 23 Aug 2012, Diego Novillo wrote: > This patch is the first step towards making the API for VEC use > member functions. > > There are no user code modifications in this patch. Everything > is still using the VEC_* macros, but this time they expand into > member function calls. > > Becau

Re: Re-implement VEC_* to be member functions of vec_t

2012-08-24 Thread Diego Novillo
On 2012-08-23 23:08 , Diego Novillo wrote: I've tested this patch on x86_64 and ppc64 with all languages plus ada, go and obj-c++. I am going to be offline for several days starting on Saturday, so I will not commit it until I return. I've also done memory and time comparisons to make sure I

Re: Re-implement VEC_* to be member functions of vec_t

2012-08-24 Thread Gabriel Dos Reis
On Fri, Aug 24, 2012 at 11:08 AM, Diego Novillo wrote: > On 2012-08-24 12:03 , Gabriel Dos Reis wrote: > >> I would just use C++ standard function `at()' (e.g. as found in vector) >> for this. > > > Sure. For regular functions, using default-valued arguments would be fine. > But I think the mecha

Re: Re-implement VEC_* to be member functions of vec_t

2012-08-24 Thread Diego Novillo
On 2012-08-24 12:03 , Gabriel Dos Reis wrote: I would just use C++ standard function `at()' (e.g. as found in vector) for this. Sure. For regular functions, using default-valued arguments would be fine. But I think the mechanism would be much more transparent if the compiler did the heavy

Re: Re-implement VEC_* to be member functions of vec_t

2012-08-24 Thread Gabriel Dos Reis
On Fri, Aug 24, 2012 at 10:50 AM, Marc Glisse wrote: > On Thu, 23 Aug 2012, Diego Novillo wrote: > >> There is another issue that I need to address and I'm not quite >> sure how to go about it: with the macro-based API, we make use of >> pre-processor trickery to insert __FILE__, __LINE__ and >> _

Re: Re-implement VEC_* to be member functions of vec_t

2012-08-24 Thread Marc Glisse
On Thu, 23 Aug 2012, Diego Novillo wrote: There is another issue that I need to address and I'm not quite sure how to go about it: with the macro-based API, we make use of pre-processor trickery to insert __FILE__, __LINE__ and __FUNCTION__ into the argument list of functions. When I change VEC

Re: Re-implement VEC_* to be member functions of vec_t

2012-08-24 Thread Joseph S. Myers
On Thu, 23 Aug 2012, Diego Novillo wrote: > I think I would like to explore the idea of implement a stack > unwinder that's used by gcc_assert(). This way: (a) we do not > need to uglify all the APIs with these extra arguments, (b) we > can control how much of the call stack we show on an asserti