12 m_inst(inst), m_primary_arg(arg)
17 m_inst(inst), m_primary_arg(primary_arg), m_secondary_arg(secondary_arg)
22 m_inst(inst), m_primary_arg(inst2), m_secondary_arg(inst3), m_tertiary_arg(inst4)
38 entity.m_label = value;
46 jump.m_label =
label.m_label;
55 jump.m_label =
label.m_label;
57 jump.m_primary_arg = primary_arg;
64 return Goto(
label, cond ? POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE);
An entity in the IR is a bundle of information.
static Entity Goto(const Entity &label, Instruction inst=Instruction::JUMP)
Create a new Goto IR Entity.
static Entity Label(label_t value)
Create a new Label IR Entity.
label_t label() const
Return the label of the IR Entity.
Entity(Kind kind)
Create a new IR Entity.
Instruction inst() const
Return the underlying instruction of the IR Entity.
void replaceLabel(label_t replacement)
static Entity GotoIf(const Entity &label, bool cond)
Create a new Goto IR Entity.
void setRelatedResourceId(std::optional< uint16_t > id)
static Entity GotoWithArg(const Entity &label, Instruction inst, uint16_t primary_arg)
Create a new Goto IR Entity.
void setSourceLocation(const std::string &filename, std::size_t line)
Set the source location for an IR Entity, which is used to generate the file loc table.
Word bytecode() const
Return the bytecode representation of the IR Entity if it's an Opcode.
const std::string & filename() const
void replaceInstruction(Instruction replacement)
struct Ark::internal::IR::Entity::@0 m_metadata
Instruction
The different bytecodes are stored here.