[cfe-dev] Which statements may have null child statements?

Artem Dergachev via cfe-dev cfe-dev at lists.llvm.org
Wed Oct 4 09:23:28 PDT 2017


How do we figure out if a particular statement kind may have null child 
statement pointers in a fully constructed AST, to avoid unnecessary 
defensive checks? Like, "for(;;) {}" has three null child statements, so 
ForStmt may have null children. At the same time, binary operators are 
unlikely to have null left-hand sides or right-hand sides... unless I 
missed something.

I guess it's better to ask late than never, and sorry for interrupting :)

More information about the cfe-dev mailing list