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
On 3 Jul, 2004, at 1.11, Mark Mitchell wrote:
Ziemowit Laski wrote:
Now that the C++ front-end has been redone to rely on specialized
data structures such
as cp_declarator, cp_type_specifier_seq, etc., the various grok...()
functions (groktypename(),
grokdeclarator(), etc.) accept these new types as parameters. Thing
is, this broke my
ongoing ObjC++ work, where I call grok...() using the traditional
TREE-based parameters that
the C front-end still uses. While I do have an impedance-matching
layer (objcp/objcp-decl.c)
for situations such as these, I have no clue how to construct the
newfangled arguments from
the oldfangled ones. Are there routines that do this?
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.
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?
--Zem
--------------------------------------------------------------
Ziemowit Laski 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group Cupertino, CA USA 95014-2083
Apple Computer, Inc. +1.408.974.6229 Fax .5477