private bool IsYieldingHeader(GraphUtil.Graph<Block> graph, Block header) { foreach (Block backEdgeNode in graph.BackEdgeNodes(header)) { foreach (Block x in graph.NaturalLoops(header, backEdgeNode)) { foreach (Cmd cmd in x.Cmds) { if (cmd is YieldCmd) return true; if (cmd is ParCallCmd) return true; CallCmd callCmd = cmd as CallCmd; if (callCmd == null) continue; if (callCmd.IsAsync || QKeyValue.FindBoolAttribute(callCmd.Proc.Attributes, "yields")) return true; } } } return false; }