This is the mail archive of the gcc@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: Some (small) c++ compilation profiling data (oprofile)


> Note that the new parser has not been tuned for speed *at all*.  Heck,
> I didn't even do the usual operator precedence stuff; we do the full
> recursion for expressions in the naive way you would if you typed in
> the C++ grammar directly.

I don't think that's such a bad idea, procedure calls are pretty cheap,
and I doubt this is a source of any significant inefficiency. After all
big complex expressions with multiple precedence levels are not common
anyway statistically in most code. GNAT certainly does the same thing
and does not mess with operator precedence. It's really a cleaner
structure. Basic parsing (in the text book sense, no semantic analysis)
using recursive descent should be an order of magnitude faster than
lexical analysis anyway in practice.


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