1 /// These iterators only exit normally when the loop cursor is NULL, so there
2 /// is no point to call of_node_put on the final value.
5 // Copyright: (C) 2010-2012 Nicolas Palix. GPLv2.
6 // Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6. GPLv2.
7 // Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6. GPLv2.
8 // URL: http://coccinelle.lip6.fr/
10 // Options: --no-includes --include-headers
18 iterator name for_each_node_by_name;
23 for_each_node_by_name(np,...) {
31 iterator name for_each_node_by_type;
36 for_each_node_by_type(np,...) {
44 iterator name for_each_compatible_node;
49 for_each_compatible_node(np,...) {
57 iterator name for_each_matching_node;
62 for_each_matching_node(np,...) {
69 // ----------------------------------------------------------------------
71 @r depends on !patch forall@
72 //iterator name for_each_node_by_name;
73 //iterator name for_each_node_by_type;
74 //iterator name for_each_compatible_node;
75 //iterator name for_each_matching_node;
82 *for_each_node_by_name@p1(np,...)
88 *for_each_node_by_type@p1(np,...)
94 *for_each_compatible_node@p1(np,...)
100 *for_each_matching_node@p1(np,...)
107 * of_node_put@p2(np);
109 @script:python depends on org@
114 cocci.print_main("unneeded of_node_put",p2)
115 cocci.print_secs("iterator",p1)
117 @script:python depends on report@
122 msg = "ERROR: of_node_put not needed after iterator on line %s" % (p1[0].line)
123 coccilib.report.print_report(p2[0], msg)