[LLVMdev] Nested functions
Vikram Adve
vadve at cs.uiuc.edu
Mon Nov 22 13:08:52 PST 2004
This makes sense and sounds like it should work pretty well (assuming
that only a few non-local variables have to be passed). I think it
requires that all nested functions are available, which should usually
be true.
--Vikram
http://www.cs.uiuc.edu/~vadve
http://llvm.cs.uiuc.edu/
On Nov 22, 2004, at 2:21 PM, Vladimir Merzliakov wrote:
>>> I use this method with filtering unused in nested function args and
>>> local vars
>>> in my YAFL frontend (not finished :(( - at this moment generate LLVM
>>> bytecode but doesn't have all runtime suport code writed)
>>
>> So do you mean you pass static links for parent function stack frames
>> as arguments? How do you generate them?
>>
> Sorry, I must more careful read text.
> I use diff. method.
> All definitions in my YAFL parsed program AST have set of references
> to expressions where it used.
> All expressions know what function body contain it.
> All functions know what function contain it (if nested).
>
> I iterate by nested functions in deep and cache information about used
> declarations from parent function:
> args, locals, used grantparent declarations.
> Declaration used iff declaration used in code current processed nested
> function or in it nested function bodies
> or in it parent(grantparents) nested functions called from (it or it
> nested functions).
>
> Collect this information for non-nested function and all it nested
> functions
> i genereted LLVM code for function and all nested functions adding
> additional args to nested function for used declarations from parent
> function.
>
> Sorry for maybe not clear algorithm but it work for me.
>
> Vladimir
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20041122/c4c20c8d/attachment.bin>
More information about the llvm-dev
mailing list