CodeQL library for Ruby
codeql/ruby-all 0.8.15-dev (changelog, source)
Search

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, which is an immediate basic block predecessor of this basic block.

Example:

def m b
  if b
    return 0
  end
  return 1
end

The basic block starting on line 2 is an immediate dominator of the basic block on line 5 (all paths from the entry point of m to return 1 must go through the if block, and the if block is an immediate predecessor of return 1).

BasicBlock getImmediateDominator()