This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libiberty] add obstack macros (was Re: PR #53525 - track-macro-expansion performance regression)


On Sat, 4 Aug 2012, Ian Lance Taylor wrote:

On Fri, 3 Aug 2012, Ian Lance Taylor wrote:

I'm not sure where you are looking. I only see one call to _obstack_begin in the gcc directory, and it could easily be replaced with a call to obstack_specify_allocation instead.

In libcpp/ mostly, but only 4 cases so that's not too many, I can change those with obstack_init/begin.


+#define XOBFINISH(O, PT) ((PT) obstack_finish ((O)))


For XOBNEW, etc., we use (T *) rather than (PT).  Using (PT) seems
error-probe--it's the only use of the obstack with a different type
parameter.  Why not use T rather than PT here, and return (T *)?


I'd have to change many (about 60) occurences of XOBFINISH if I change that.
I'd go for it if I was sure it's what we want, it can be a separate patch
later on.

I'm sorry to ask you to change a lot of code, but it simply doesn't make sense to me to have all but one macro take the type as an argument, and have one macro take a pointer to the type. They really have to be consistent.

No problem, if anyone else doesn't object I'll change those (in a second patch, right?).



Thanks, Dimitris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]