|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Lowered IR for one function or top-level body. More...
#include <Compiler_IR_Model.H>
Public Member Functions | |
| bool | is_top_level () const noexcept |
| Returns whether this IR function represents the top-level body. | |
Public Attributes | |
| Compiler_IR_Function_Id | id = compiler_ir_invalid_id() |
| Stable function id within the module. | |
| std::string | name |
| Debug or source-level name. | |
| Source_Span | span |
| Source span of the function/body. | |
| Compiler_Type_Id | type_id = 0 |
| Full function type, when known. | |
| const Compiler_HIR_Function * | source_function = nullptr |
Originating HIR function, or nullptr for top-level. | |
| DynArray< Compiler_IR_Slot > | local_slots |
| Parameter/local slots in stable order. | |
| DynArray< Compiler_IR_Block > | blocks |
| Basic blocks in deterministic id order. | |
| Compiler_IR_Block_Id | entry_block = compiler_ir_invalid_id() |
| Canonical entry block. | |
| Compiler_IR_Block_Id | exit_block = compiler_ir_invalid_id() |
| Canonical exit block. | |
| Compiler_IR_Value_Id | next_value_id = 0 |
| Next value id to allocate while lowering. | |
Lowered IR for one function or top-level body.
Definition at line 226 of file Compiler_IR_Model.H.
|
inlinenoexcept |
Returns whether this IR function represents the top-level body.
Definition at line 241 of file Compiler_IR_Model.H.
References source_function.
Referenced by Aleph::Compiler_IR_Lowering::Module_Builder::lower_stmt().
| DynArray<Compiler_IR_Block> Aleph::Compiler_IR_Function::blocks |
Basic blocks in deterministic id order.
Definition at line 235 of file Compiler_IR_Model.H.
Referenced by Aleph::analyze_dataflow_function(), Aleph::Compiler_IR_Builder::block(), Aleph::Compiler_IR_Lowering::Module_Builder::block(), Aleph::compiler_dump_dataflow_analysis(), Aleph::compiler_dump_ir_function(), Aleph::Compiler_SSA_Detail::compute_dominance_info(), Aleph::Compiler_Dataflow_Detail::compute_predecessor_lists(), Aleph::Compiler_Dataflow_Detail::compute_reachability(), Aleph::Compiler_SSA_Detail::compute_reachable_blocks(), Aleph::Compiler_Dataflow_Detail::count_instructions(), Aleph::Compiler_IR_Builder::create_block(), Aleph::Compiler_IR_Lowering::Module_Builder::create_block(), Aleph::eliminate_dead_code(), Aleph::Compiler_C_Backend::Emitter::emit_function_body(), Aleph::Compiler_Bytecode_Lowering::lower_function(), Aleph::Compiler_SSA_Detail::normalize_ir_function(), Aleph::Compiler_Dataflow_Detail::rebuild_predecessors(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), Aleph::validate_dataflow_analysis(), Aleph::validate_dead_code_elimination(), and Aleph::validate_ir_function().
| Compiler_IR_Block_Id Aleph::Compiler_IR_Function::entry_block = compiler_ir_invalid_id() |
Canonical entry block.
Definition at line 236 of file Compiler_IR_Model.H.
Referenced by Aleph::analyze_dataflow_function(), Aleph::compiler_dump_ir_function(), Aleph::Compiler_SSA_Detail::compute_dominance_info(), Aleph::Compiler_Dataflow_Detail::compute_reachability(), Aleph::Compiler_SSA_Detail::compute_reachable_blocks(), Aleph::Compiler_C_Backend::Emitter::emit_function_body(), Aleph::Compiler_Bytecode_Lowering::lower_function(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_function_body(), Aleph::Compiler_SSA_Detail::normalize_ir_function(), Aleph::Compiler_IR_Builder::set_entry_block(), TEST(), Aleph::validate_dataflow_analysis(), and Aleph::validate_ir_function().
| Compiler_IR_Block_Id Aleph::Compiler_IR_Function::exit_block = compiler_ir_invalid_id() |
Canonical exit block.
Definition at line 237 of file Compiler_IR_Model.H.
Referenced by Aleph::compiler_dump_ir_function(), Aleph::Compiler_Bytecode_Lowering::lower_function(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_function_body(), Aleph::Compiler_SSA_Detail::normalize_ir_function(), Aleph::Compiler_IR_Builder::set_exit_block(), TEST(), Aleph::validate_dead_code_elimination(), and Aleph::validate_ir_function().
| Compiler_IR_Function_Id Aleph::Compiler_IR_Function::id = compiler_ir_invalid_id() |
Stable function id within the module.
Definition at line 228 of file Compiler_IR_Model.H.
Referenced by Aleph::Compiler_IR_Builder::append_function(), Aleph::Compiler_Bytecode_Lowering::lower_function(), Aleph::Compiler_SSA_Lowering::lower_function_internal(), Aleph::Compiler_IR_Lowering::lower_module(), Aleph::Compiler_SSA_Detail::normalize_ir_function(), Aleph::Compiler_IR_Lowering::Module_Builder::predeclare_function(), and Aleph::Compiler_IR_Builder::set_top_level().
| DynArray<Compiler_IR_Slot> Aleph::Compiler_IR_Function::local_slots |
Parameter/local slots in stable order.
Definition at line 234 of file Compiler_IR_Model.H.
Referenced by Aleph::Compiler_IR_Lowering::Module_Builder::add_local_slot(), Aleph::analyze_dataflow_function(), Aleph::compiler_dump_dataflow_analysis(), Aleph::compiler_dump_ir_function(), Aleph::Compiler_Dataflow_Detail::compute_block_use_def(), Aleph::Compiler_C_Backend::Emitter::emit_parameter_bindings(), Aleph::Compiler_C_Backend::Emitter::emit_slot_declarations(), Aleph::Compiler_Dataflow_Detail::format_slot_constants(), Aleph::Compiler_Dataflow_Detail::format_slot_set(), Aleph::Compiler_Dataflow_Detail::initial_assigned_state(), Aleph::Compiler_Dataflow_Detail::initial_constant_state(), Aleph::Compiler_Bytecode_Lowering::lower_function(), Aleph::Compiler_SSA_Lowering::lower_function_internal(), Aleph::Compiler_SSA_Detail::normalize_ir_function(), TEST(), Aleph::validate_dataflow_analysis(), Aleph::validate_dead_code_elimination(), and Aleph::validate_ir_function().
| std::string Aleph::Compiler_IR_Function::name |
Debug or source-level name.
Definition at line 229 of file Compiler_IR_Model.H.
Referenced by Aleph::compiler_dump_dataflow_analysis(), Aleph::compiler_dump_ir_function(), Aleph::Compiler_C_Backend::Emitter::emit_function_body(), Aleph::Compiler_C_Backend::Emitter::emit_parameter_bindings(), Aleph::Compiler_C_Backend::Emitter::emit_terminator(), Aleph::Compiler_Bytecode_Lowering::lower_function(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_function_body(), Aleph::Compiler_SSA_Lowering::lower_function_internal(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_stmt(), Aleph::Compiler_SSA_Detail::normalize_ir_function(), TEST(), Aleph::validate_dataflow_analysis(), Aleph::validate_dead_code_elimination(), and Aleph::validate_ir_function().
| Compiler_IR_Value_Id Aleph::Compiler_IR_Function::next_value_id = 0 |
Next value id to allocate while lowering.
Definition at line 238 of file Compiler_IR_Model.H.
Referenced by Aleph::Compiler_IR_Builder::allocate_value(), Aleph::Compiler_IR_Lowering::Module_Builder::emit_unit_constant(), Aleph::Compiler_C_Backend::Emitter::emit_value_declarations(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_expr(), Aleph::Compiler_Bytecode_Lowering::lower_function(), Aleph::Compiler_IR_Lowering::Module_Builder::next_value(), Aleph::Compiler_SSA_Detail::normalize_ir_function(), Aleph::Compiler_Dataflow_Detail::simulate_block(), TEST(), and Aleph::validate_dead_code_elimination().
| const Compiler_HIR_Function* Aleph::Compiler_IR_Function::source_function = nullptr |
Originating HIR function, or nullptr for top-level.
Definition at line 232 of file Compiler_IR_Model.H.
Referenced by is_top_level(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_function_body(), Aleph::Compiler_IR_Lowering::lower_module(), and Aleph::Compiler_SSA_Detail::normalize_ir_function().
| Source_Span Aleph::Compiler_IR_Function::span |
Source span of the function/body.
Definition at line 230 of file Compiler_IR_Model.H.
Referenced by Aleph::Compiler_IR_Builder::append_instruction(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_expr(), Aleph::Compiler_Bytecode_Lowering::lower_function(), Aleph::Compiler_SSA_Lowering::lower_function_internal(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_stmt(), and Aleph::Compiler_SSA_Detail::normalize_ir_function().
| Compiler_Type_Id Aleph::Compiler_IR_Function::type_id = 0 |
Full function type, when known.
Definition at line 231 of file Compiler_IR_Model.H.
Referenced by Aleph::compiler_dump_ir_function(), Aleph::Compiler_C_Backend::Emitter::emit_function_body(), Aleph::Compiler_Bytecode_Lowering::lower_function(), Aleph::Compiler_SSA_Lowering::lower_function_internal(), and Aleph::Compiler_SSA_Detail::normalize_ir_function().