public static void CollectLabels <T>(this IList <T> nodes, HashSet <ILLabel> labels) where T : ILNode { foreach (var n in nodes) { ILExpression e = n as ILExpression; if (e != null) { e.CollectLabels(labels); continue; } ILLabel label = n as ILLabel; if (label != null) { labels.Add(label); continue; } } }