Hi,
On Wed, 13 Apr 2016, Sergey Korshunoff wrote:
> > I can see that for inlines there is a separate `InlineFunc` struct
> > that keeps function body until end of generation when in
> > `gen_inline_functions` only the referenced inlines are generated as
> > regular functions.
>
> Then we can search if a function to call is inline function and if so,
> parse this function body in the form of the {( )} block. A compiler
> switch can be used to keep old bejavior
You will find that this will not work very well. Parameter passing is one
problem, scoping another and recursive calls another. Parsing as ({})
block doesn't deactive the outer variables, so what should be a compile
error might turn into silently accepting wrong code, or into accessing a
local instead of a global variable. Functions can call themself
recursively, parsing them as ({}) block that's impossible to implement.
Also: for tcc inlining makes no sense whatsoever. There is no optimizer
that could benefit from inlining, the only thing saved would be a call and
return, which is a silly optimization.
Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel