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

Member predicate BasicBlock::getImmediateDominator

Gets the basic block that immediately dominates this basic block, if any.

That is, all paths reaching this basic block from some entry point basic block must go through the result.


int M(string s) {
  if (s == null)
    throw new ArgumentNullException(nameof(s));
  return s.Length;

The basic block starting on line 2 is an immediate dominator of the basic block online 4 (all paths from the entry point of M to return s.Length; must go through the null check.

BasicBlock getImmediateDominator()