Home / Function/ postDominatorsOf() — react Function Reference

postDominatorsOf() — react Function Reference

Architecture documentation for the postDominatorsOf() function in ControlDominators.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  8017034f_f43c_cd01_077d_41294bd5f874["postDominatorsOf()"]
  5d62162e_5fa5_1488_29bf_5150b4be53a0["ControlDominators.ts"]
  8017034f_f43c_cd01_077d_41294bd5f874 -->|defined in| 5d62162e_5fa5_1488_29bf_5150b4be53a0
  2ab5bf9c_e206_7c2b_7310_4c254855325b["postDominatorFrontier()"]
  2ab5bf9c_e206_7c2b_7310_4c254855325b -->|calls| 8017034f_f43c_cd01_077d_41294bd5f874
  a90edee2_35a1_577c_a329_5f6319fef1d4["get()"]
  8017034f_f43c_cd01_077d_41294bd5f874 -->|calls| a90edee2_35a1_577c_a329_5f6319fef1d4
  style 8017034f_f43c_cd01_077d_41294bd5f874 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Inference/ControlDominators.ts lines 90–114

function postDominatorsOf(
  fn: HIRFunction,
  postDominators: PostDominator<BlockId>,
  targetId: BlockId,
): Set<BlockId> {
  const result = new Set<BlockId>();
  const visited = new Set<BlockId>();
  const queue = [targetId];
  while (queue.length) {
    const currentId = queue.shift()!;
    if (visited.has(currentId)) {
      continue;
    }
    visited.add(currentId);
    const current = fn.body.blocks.get(currentId)!;
    for (const pred of current.preds) {
      const predPostDominator = postDominators.get(pred) ?? pred;
      if (predPostDominator === targetId || result.has(predPostDominator)) {
        result.add(pred);
      }
      queue.push(pred);
    }
  }
  return result;
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does postDominatorsOf() do?
postDominatorsOf() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Inference/ControlDominators.ts.
Where is postDominatorsOf() defined?
postDominatorsOf() is defined in compiler/packages/babel-plugin-react-compiler/src/Inference/ControlDominators.ts at line 90.
What does postDominatorsOf() call?
postDominatorsOf() calls 1 function(s): get.
What calls postDominatorsOf()?
postDominatorsOf() is called by 1 function(s): postDominatorFrontier.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free