CodeQL library for C#
codeql/csharp-all 1.0.0 (changelog, source)

Member predicate BasicBlock::inLoop

Holds if this basic block is in a loop in the control flow graph. This includes loops created by goto statements. This predicate may not hold even if this basic block is syntactically inside a while loop if the necessary back edges are unreachable.

predicate inLoop()