|
From: R0b0t1 <r0...@gm...> - 2017-10-26 23:39:01
|
On Thursday, October 26, 2017, Åke Rehnman <ake...@gm...> wrote:
> 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
>
> Example:
>
> FUNCTION (_dummy=0x6000f39b0) type (int fixed) args (int auto)
> tree (0x6000f3910) not decorated
> (null):0:{ L1 B2
> (null):0: DECLARE SYMBOL (L1 B2 n=0x6000eda30) type (int auto)
> (null):0: { L2 B4
> (null):0: DECLARE SYMBOL (L2 B3 ni=0x6000ee1e0) type (int auto)
> (null):0: LABEL (0x6000f2f80)
> test6.c:0: SYMBOL (L3 B4 _forcond_0=0x6000f2ee0 @ 0x6000ef250)
> test6.c:0: IF (0x6000f2920)
> test6.c:6: LT(<) (0x6000efa20) type (_Bool fixed)
> test6.c:6: SYMBOL (L1 B1 x=0x6000ed8e0 @ 0x6000ed0d0) type (int
auto)
> test6.c:6: CONSTANT (0x6000ef980) value = 0, 0x0, 0.000000 type
(const-unsigned-char literal)
> test6.c:0: NE(!=) 0 goto _forbreak_0
> test6.c:0: EQ(==) 0 goto _forbody_0
> (null):0: LABEL (0x6000f2c50)
> test6.c:0: SYMBOL (L3 B4 _forbody_0=0x6000f2bb0 @ 0x6000ef000)
> test6.c:7: ASSIGN(=) (0x6000f0a00) type (int auto)
> test6.c:7: SYMBOL (L2 B3 ni=0x6000f02a0 @ 0x6000ee1e0) type (int
auto)
> test6.c:7: SUB (0x6000f0960) type (int register)
> test6.c:7: SYMBOL (L2 B3 ni=0x6000f0690 @ 0x6000ee1e0) type (int
auto)
> test6.c:7: CONSTANT (0x6000f1cb0) value = 2, 0x2, 2.000000 type
(int literal)
> (null):0: LABEL (0x6000f3590)
> test6.c:0: SYMBOL (L3 B4 _forcontinue_0=0x6000f34f0 @ 0x6000eeb60)
> test6.c:6: post-DEC_OP (0x6000efeb0) type (int auto)
> test6.c:6: SYMBOL (L1 B1 x=0x6000efe10 @ 0x6000ed0d0) type (int auto)
> test6.c:0: GOTO (0x6000f31c0)
> test6.c:0: SYMBOL (L3 B4 _forcond_0=0x6000f3120 @ 0x6000ef250)
> (null):0: LABEL (0x6000f0dd0)
> test6.c:0: SYMBOL (L3 B4 _forbreak_0=0x6000f0d30 @ 0x6000eedb0)
> (null):0: }
> test6.c:9: RETURN (0x6000f13a0) type (int auto)
> test6.c:9: SYMBOL (L1 B2 n=0x6000f1300 @ 0x6000eda30) type (int auto)
> (null):0:}
>
> int dummy(int x)
> {
> int n = 0;
> {
> int ni = 10;
> for (;x>=0;x--)
> ni = ni - 2;
> }
> return n;
> }
>
Hello - not to add noise to the list, but an answer to OP's question would
help me as well.
Cheers,
R0b0t1.
|