Joos1W Compiler Framework
All Classes Functions Typedefs Pages
tir::BasicBlock Class Referencefinal
Inheritance diagram for tir::BasicBlock:

Public Types

using iterator = iterator_impl< BasicBlock * >
 The iterator class for instructions in a basic block allows us to express points before the first instruction and after the last instruction. Otherwise, a pointer to the current instruction would be sufficient. More...
 
using const_iterator = iterator_impl< const BasicBlock * >
 

Public Member Functions

auto * parent () const
 
auto begin ()
 
auto end ()
 
auto begin () const
 
auto end () const
 
void appendAfterEnd (Instruction *instr)
 
void insertBeforeBegin (Instruction *instr)
 
std::ostream & print (std::ostream &os) const override
 
auto * terminator () const
 
void erase (Instruction *instr)
 
void eraseFromParent ()
 
int printDotNode (utils::DotPrinter &) const
 
utils::Generator< BasicBlock * > successors () const
 
utils::Generator< BasicBlock * > predecessors () const
 
- Public Member Functions inherited from tir::Value
 Value (Context &ctx, Type *type)
 
tir::Contextctx ()
 
auto users ()
 
auto users () const
 
Typetype () const
 
void addUser (User *user)
 
void removeUser (User *user)
 
std::string_view name () const
 
auto nameOpt () const
 
void replaceAllUsesWith (Value *newValue)
 
void setName (std::string_view name)
 
std::ostream & printName (std::ostream &os) const
 
void dump () const
 

Static Public Member Functions

static BasicBlockCreate (Context &ctx, Function *parent)
 

Friends

class Instruction
 

Detailed Description

Definition at line 12 of file BasicBlock.h.

Member Typedef Documentation

◆ iterator

using tir::BasicBlock::iterator = iterator_impl<BasicBlock*>

The iterator class for instructions in a basic block allows us to express points before the first instruction and after the last instruction. Otherwise, a pointer to the current instruction would be sufficient.

Two iterators are equal iff they express the same point in the BB, which means they must also be necessarily in the same BB.

The increment and decrement moves to the previous and next iterators. The minimum iterator is therefore the one before the first instruction, and the maximum iterator is the one after the last instruction.

Definition at line 91 of file BasicBlock.h.


The documentation for this class was generated from the following files: