Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Compiler_CFG_Block Struct Reference

Represents a single basic block in a CFG. More...

#include <Compiler_CFG.H>

Collaboration diagram for Aleph::Compiler_CFG_Block:
[legend]

Public Member Functions

bool is_terminated () const noexcept
 Checks if the block has a valid terminator set.
 

Public Attributes

Compiler_CFG_Block_Id id = compiler_cfg_invalid_block_id()
 Unique identifier in the function.
 
std::string label
 Human-readable debug label (e.g., "entry", "loop.body").
 
Source_Span span
 Span covering all statements and the terminator.
 
DynArray< const Compiler_HIR_Stmt * > statements
 Ordered list of linear statements.
 
Compiler_CFG_Terminator terminator
 How the block ends.
 
DynArray< Compiler_CFG_Block_Id > predecessors
 List of block IDs that jump to this block.
 

Detailed Description

Represents a single basic block in a CFG.

A basic block is a maximal sequence of linear statements that are always executed together. It starts at an entry point and ends with a terminator.

Definition at line 142 of file Compiler_CFG.H.

Member Function Documentation

◆ is_terminated()

bool Aleph::Compiler_CFG_Block::is_terminated ( ) const
inlinenoexcept

Checks if the block has a valid terminator set.

Definition at line 152 of file Compiler_CFG.H.

References Aleph::Compiler_CFG_Terminator::kind, Aleph::None, and terminator.

Member Data Documentation

◆ id

Compiler_CFG_Block_Id Aleph::Compiler_CFG_Block::id = compiler_cfg_invalid_block_id()

Unique identifier in the function.

Definition at line 144 of file Compiler_CFG.H.

Referenced by Aleph::Compiler_CFG_Lowering::create_block(), and TEST().

◆ label

std::string Aleph::Compiler_CFG_Block::label

Human-readable debug label (e.g., "entry", "loop.body").

Definition at line 145 of file Compiler_CFG.H.

Referenced by Aleph::Compiler_CFG_Lowering::create_block(), and TEST().

◆ predecessors

DynArray<Compiler_CFG_Block_Id> Aleph::Compiler_CFG_Block::predecessors

List of block IDs that jump to this block.

Definition at line 149 of file Compiler_CFG.H.

◆ span

Source_Span Aleph::Compiler_CFG_Block::span

Span covering all statements and the terminator.

Definition at line 146 of file Compiler_CFG.H.

◆ statements

DynArray<const Compiler_HIR_Stmt *> Aleph::Compiler_CFG_Block::statements

Ordered list of linear statements.

Definition at line 147 of file Compiler_CFG.H.

◆ terminator

Compiler_CFG_Terminator Aleph::Compiler_CFG_Block::terminator

How the block ends.

Definition at line 148 of file Compiler_CFG.H.

Referenced by is_terminated(), and TEST().


The documentation for this struct was generated from the following file: