This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bridging the new C/C++ grok....() impedance mismatch
Ziemowit Laski wrote:
No. You could do that, but it would be inefficient; better just to
create the data structures you want in the first place... (Or, if
you really want to be a hero, merge the C and C++ front ends, so that
you don't have to be trying to talk to two front ends...)
Hmm, that's tempting... by "merge the C and C++ front-ends", hopefully
you mean "tweak the C++ front-end to also accept C"? Most of that
work should be fairly trivial, me thinks; the tricky part will be in
handling areas where C++ and C99 differ.
Yes, exactly. And those parts are not terribly hard; for example, the
differing pointer conversion rules should just require loosening a few
tests in C++. Adding K&R support is one of the nastier bits. It's
months of work, but not years.
Having a unified front-end would definitely make my life _way_ easier,
but I'm wondering if this is doable in the 3.5 time frame. What do
you think?
Sadly, no, I don't think that's possible.
However, I'm actually opposed to trying to abstract away more bits from
the two front ends into c-common.c with more langhooks back into the
front ends; to me, that effort should instead go into adding C support
to cc1plus.
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com