Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ObjC vs function-at-a-time

0 views
Skip to first unread message

Mark Mitchell

unread,
Apr 26, 2001, 11:42:53 PM4/26/01
to

Are the decls you're synthesizing functions or variables? If they're
variables, then we shouldn't be trying to build statement-trees for
them, and the problem to solve is why start_decl/finish_decl are doing
that. If they're functions, then there's a different problem. You
might want to take a look at {start,finish}_cdtor in c-lang.c for
models of how to build little functions on the fly.

Let me know if that doesn't help.

--
Mark Mitchell ma...@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com

Mark Mitchell

unread,
Apr 27, 2001, 7:24:56 PM4/27/01
to
>>>>> "Stan" == Stan Shebs <sh...@apple.com> writes:

Stan> They're variables (usually, depends on runtime support
Stan> available), but start_decl wants to create a decl statement
Stan> because there's a synthetic function created for other
Stan> reasons, and so start_decl thinks it's declaring locals. I
Stan> don't yet know whether start_decl needs to get smarter, or
Stan> if the synthetic function should be tied off before it
Stan> starts in on protocol layout.

It sounds like the function should be tied off to me. (In the C++
front-end, we have push_to_top_level for this kind of thing; it says
"stop what you're doing here, and let's go back to declaring global
things for a while", but I don't the C front-end has that.)
start_decl fundamentally depends on its context to do its job, so I
think it's doing what it's supposed to do.

Stan> little constructor functions that it synthesizes. So
Stan> -fnext-runtime and -fgnu-runtime have a hand in deciding
Stan> whether there are functions hanging about.

Lovely.

Stan Shebs

unread,
Apr 27, 2001, 4:37:05 PM4/27/01
to
Mark Mitchell wrote:
>
> Are the decls you're synthesizing functions or variables? If they're
> variables, then we shouldn't be trying to build statement-trees for
> them, and the problem to solve is why start_decl/finish_decl are doing
> that.

They're variables (usually, depends on runtime support available),
but start_decl wants to create a decl statement because there's a
synthetic function created for other reasons, and so start_decl
thinks it's declaring locals. I don't yet know whether start_decl
needs to get smarter, or if the synthetic function should be tied
off before it starts in on protocol layout.

It's all especially entertaining because the NeXT runtime has a
bunch of machinery to interpret data structures, while the GNU
runtime expects the data structures to be set up by little
constructor functions that it synthesizes. So -fnext-runtime
and -fgnu-runtime have a hand in deciding whether there are
functions hanging about.

Stan

0 new messages