Home / Function/ buildGraph() — react Function Reference

buildGraph() — react Function Reference

Architecture documentation for the buildGraph() function in Dominator.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  3785beb3_b04c_c433_176d_59b84fc0bbb7["buildGraph()"]
  b02a9daf_aca4_b66a_9b9b_0b739a8ca4aa["Dominator.ts"]
  3785beb3_b04c_c433_176d_59b84fc0bbb7 -->|defined in| b02a9daf_aca4_b66a_9b9b_0b739a8ca4aa
  e28bcdab_2c48_d52f_7a36_ef26ead72639["computeDominatorTree()"]
  e28bcdab_2c48_d52f_7a36_ef26ead72639 -->|calls| 3785beb3_b04c_c433_176d_59b84fc0bbb7
  d737cb4c_53f4_75b4_2d58_268e2f73fde4["eachTerminalSuccessor()"]
  3785beb3_b04c_c433_176d_59b84fc0bbb7 -->|calls| d737cb4c_53f4_75b4_2d58_268e2f73fde4
  style 3785beb3_b04c_c433_176d_59b84fc0bbb7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/Dominator.ts lines 213–225

function buildGraph(fn: HIRFunction): Graph<BlockId> {
  const graph: Graph<BlockId> = {entry: fn.body.entry, nodes: new Map()};
  let index = 0;
  for (const [id, block] of fn.body.blocks) {
    graph.nodes.set(id, {
      id,
      index: index++,
      preds: block.preds,
      succs: new Set(eachTerminalSuccessor(block.terminal)),
    });
  }
  return graph;
}

Subdomains

Frequently Asked Questions

What does buildGraph() do?
buildGraph() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/Dominator.ts.
Where is buildGraph() defined?
buildGraph() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/Dominator.ts at line 213.
What does buildGraph() call?
buildGraph() calls 1 function(s): eachTerminalSuccessor.
What calls buildGraph()?
buildGraph() is called by 1 function(s): computeDominatorTree.

Analyze Your Own Codebase

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

Try Supermodel Free