This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
ObjC vs function-at-a-time
- To: mark at codesourcery dot com, gcc at gcc dot gnu dot org
- Subject: ObjC vs function-at-a-time
- From: Stan Shebs <shebs at apple dot com>
- Date: Thu, 26 Apr 2001 19:05:05 -0700
I've been digging into the longstanding problem that the mainline
has with compiling ObjC protocols, and think I'm starting to understand
what is going on. For obscure reasons, the ObjC frontend likes to
synthesize all sorts of decls when it's finished compiling a file,
and it does so by calling start_decl and finish_decl multiple times.
However, in the current finish_decl, if a decl has a DECL_CONTEXT,
then it will want to add_decl_stmt, but this will blow up for ObjC,
because there is no statement tree for the decl stmt to hang from.
It looks like I could arrange to call begin_stmt_tree at some point
between each start_decl and finish_decl pair, but I'm not yet clear
on the rules for using it. Right now it seems to only be called
for functions, but in the ObjC case it would need to be called from
subroutines of finish_objc, which is outside of any function contexts.
Should I expect to be able to use begin_stmt_tree/finish_stmt_tree?
Are there any other invariants I should be aware of?
Stan