Use foreach_ir_nodeset() instead of reimplementing it.