Question on function-at-a-time and GC
Zack Weinberg
zack@codesourcery.com
Wed Apr 21 22:29:00 GMT 2004
Richard Henderson <rth@redhat.com> writes:
> It's done. Generically for all languages. Using it for Ada
> is three easy steps:
>
> (1) Gimplify all functions in the nesting.
>
> Whether you do this by converting from Ada ASTs to GENERIC and
> then calling gimplify_function_tree or whatever is up to yall.
> At this point you don't worry about access to variables from an
> outer frame; all you have to do is set DECL_CONTEXT correctly.
>
> (2) Call lower_nested_functions on the outermost function.
>
> (3) Call cgraph_finalize_function on all functions in the nesting.
>
> Actually, this should be fixed, since you'll wind up with
> basically identical to c_finalize.
Mark functions that contain functions in some obvious fashion;
teach cgraph to call lower_nested_functions transparently; teach
lower_nested_functions to call back into cgraph to register the
results of conversion. Then all the language need do is properly mark
its nested functions and feed them to cgraph. How's that?
zw
More information about the Gcc
mailing list