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]

ObjC vs function-at-a-time


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


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