NoQ added a comment. The natural way to avoid both heavy artillery with `StmtNodes.inc` and low-performance if-chains is to use a //Visitor//.
(`Const`)`StmtVisitor` is implemented as a huge switch, contents of which are auto-generated from `StmtNodes.inc`. In fact, your approach with `StmtNodes.inc` essentially re-implements the plain `StmtVisitor`. The official visitor, of course, also allows you to fall back to the parent class if the child visit method is missing. So i believe it's worth a try to implement `StmtDataCollector` as an auxiliary `ConstStmtVisitor`. I thought the two visitors could be combined if a plain `ConstStmtVisitor` was used from the start, but even now it seems better to me to use an extra visitor than re-invent it(?) No other comments so far, looks good :) https://reviews.llvm.org/D22514 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits