Home / Function/ findBlocksWithBackEdges() — react Function Reference

findBlocksWithBackEdges() — react Function Reference

Architecture documentation for the findBlocksWithBackEdges() function in DeadCodeElimination.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  4fa818eb_1b6b_0801_60ce_ac53ef820a96["findBlocksWithBackEdges()"]
  12a58551_b77c_3215_7e97_0c27aabd262e["DeadCodeElimination.ts"]
  4fa818eb_1b6b_0801_60ce_ac53ef820a96 -->|defined in| 12a58551_b77c_3215_7e97_0c27aabd262e
  4a0b4496_ef3b_6781_ecef_edfb88dec63e["hasBackEdge()"]
  4a0b4496_ef3b_6781_ecef_edfb88dec63e -->|calls| 4fa818eb_1b6b_0801_60ce_ac53ef820a96
  style 4fa818eb_1b6b_0801_60ce_ac53ef820a96 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Optimization/DeadCodeElimination.ts lines 414–426

export function findBlocksWithBackEdges(fn: HIRFunction): Set<BlockId> {
  const visited = new Set<BlockId>();
  const blocks = new Set<BlockId>();
  for (const [blockId, block] of fn.body.blocks) {
    for (const predId of block.preds) {
      if (!visited.has(predId)) {
        blocks.add(blockId);
      }
    }
    visited.add(blockId);
  }
  return blocks;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does findBlocksWithBackEdges() do?
findBlocksWithBackEdges() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Optimization/DeadCodeElimination.ts.
Where is findBlocksWithBackEdges() defined?
findBlocksWithBackEdges() is defined in compiler/packages/babel-plugin-react-compiler/src/Optimization/DeadCodeElimination.ts at line 414.
What calls findBlocksWithBackEdges()?
findBlocksWithBackEdges() is called by 1 function(s): hasBackEdge.

Analyze Your Own Codebase

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

Try Supermodel Free