|
From: Philipp K. K. <pk...@sp...> - 2017-11-02 13:04:36
|
Am 26.10.2017 um 23:52 schrieb Åke Rehnman:
> Hello All!
>
> If some kind soul could donate some time to explain. Looking at
> generated AST i wonder what levels and blocks are. Specifically why "ni"
> symbol has L2 B3 in (block???) L2 B4 ?
>
> /Ake
Looking at function_declarator2 in src/SDCC.y it seems, function
parameters go into an extra block? However, I do not know why for your
int dummy(int x)
{
int n = 0;
{
int ni = 10;
for (;x>=0;x--)
ni = ni - 2;
}
return n;
}
x is in some "hidden" block B3 (by number "in between" the two blocks
B2, B4 for the function body), while for
int dummy2(int j)
{
for(int i = 0; i < 3; i++)
{
j--;
}
return(j);
}
j is in some "hidden" block B1 (by number "above" the two blocks B2, B3
for the function body);
Philipp
|