> I'd avoid the use of the LLVM trampoline intrinsics if possible: when > I > last looked at them they were a poorly supported hack to make GCC's > nested function extension work with the dragonegg plugin. They're not > particularly portable either: IIRC they require you to allocate an > undocumented and platform-specific sized array on the stack to > construct > the trampoline in. > > A common way to implement closures, nested functions, etc. in LLVM IR > is > to pass an extra argument which is a structure containing pointers to > or > copies of the parent's lexical environment. You can then use a chain > of > structures for arbitrary levels of function nesting.
GHDL uses that for most of the constructs (processes, subprograms within processes...). Contrary to nvc, GHDL doesn't expand the design (but that something on the TODO list, because I think it is required for more optimizations). Tristan. _______________________________________________ Ghdl-discuss mailing list [email protected] https://mail.gna.org/listinfo/ghdl-discuss
