AST for For loop

Monalisa Rout via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 6 08:11:31 PDT 2019


Hello,
While dumping the AST for For loop, Why do I get  <<<NULL>>> ??

Source code:
void func()
{
for (int i = 0; i < 5; i++)
break;
}

AST

FunctionDecl 0x4a4ac10
<D:\Data\Rout\ASTJSONProject\ASTJSONProject\typeof.c:2:1, line:6:1>
line:2:6 func 'void ()'
`-CompoundStmt 0x4a4ae1c <line:3:1, line:6:1>
  `-ForStmt 0x4a4adf8 <line:4:2, line:5:3>
    |-DeclStmt 0x4a4ad38 <line:4:7, col:16>
    | `-VarDecl 0x4a4acd0 <col:7, col:15> col:11 used i 'int' cinit
    |   `-IntegerLiteral 0x4a4ad10 <col:15> 'int' 0
    |-<<<NULL>>>
    |-BinaryOperator 0x4a4ada8 <col:18, col:22> 'int' '<'
    | |-ImplicitCastExpr 0x4a4ad98 <col:18> 'int' <LValueToRValue>
    | | `-DeclRefExpr 0x4a4ad50 <col:18> 'int' lvalue Var 0x4a4acd0 'i'
'int'
    | `-IntegerLiteral 0x4a4ad70 <col:22> 'int' 5
    |-UnaryOperator 0x4a4ade0 <col:25, col:26> 'int' postfix '++'
    | `-DeclRefExpr 0x4a4adc0 <col:25> 'int' lvalue Var 0x4a4acd0 'i' 'int'
    `-BreakStmt 0x4a4adf0 <line:5:3>

Regards,
Mona
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190806/781983eb/attachment.html>


More information about the cfe-commits mailing list