Joos1W Compiler Framework
All Classes Functions Typedefs Pages
tir::BranchInst Class Referencefinal

Conditional branch instruction. This instruction is a terminator and branches to one of two basic blocks based on the condition. The condition value must be an i1 type. More...

#include <Instructions.h>

Inheritance diagram for tir::BranchInst:

Public Member Functions

bool isTerminator () const override
 
BasicBlockgetSuccessor (unsigned idx) const
 
std::ostream & print (std::ostream &os) const override
 
void replaceSuccessor (unsigned idx, BasicBlock *newBB)
 
- Public Member Functions inherited from tir::Instruction
 Instruction (Context &ctx, tir::Type *resultTy)
 
 Instruction (Context &ctx, tir::Type *resultTy, DataType data)
 
 Instruction (const Instruction &)=delete
 
 Instruction (Instruction &&)=delete
 
Instructionoperator= (const Instruction &)=delete
 
Instructionoperator= (Instruction &&)=delete
 
void insertBefore (Instruction *inst)
 
void insertAfter (Instruction *inst)
 
auto * parent () const
 
Instructionnext () const
 
Instructionprev () const
 
auto nextIter ()
 
auto prevIter ()
 
auto iter ()
 
void eraseFromParent (bool keep=false)
 Removes this instruction from its parent BB if it exists. Also will unlink this instruction from the list, re-linking the previous and next instructions.
 
void setParent (BasicBlock *parent)
 
- Public Member Functions inherited from tir::User
 User (Context &ctx, Type *type)
 
auto children () const
 
auto numChildren () const
 
ValuegetChild (unsigned idx) 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 BranchInstCreate (Context &ctx, Value *cond, BasicBlock *trueBB, BasicBlock *falseBB)
 

Additional Inherited Members

- Protected Types inherited from tir::Instruction
using DataType = std::variant< BinOp, Predicate, CastOp, Type *, StructType * >
 
- Protected Member Functions inherited from tir::Instruction
template<typename T >
constexpr T const & get () const
 
- Protected Member Functions inherited from tir::User
void addChild (Value *operand)
 
void replaceChild (unsigned idx, Value *operand)
 
void destroy ()
 
bool isDestroyed () const
 

Detailed Description

Conditional branch instruction. This instruction is a terminator and branches to one of two basic blocks based on the condition. The condition value must be an i1 type.

Definition at line 185 of file Instructions.h.


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