top | up | prev | next

Instruction Abstract Class

Definition at line 23 of Instruction.hpp

Constructors

Instruction()

Member Functions

Type* GetType(Context& context) override
bool IsNoOperation() const virtual
std::string Name(Context& context) override
void SetMetadataRef(MDStructRef* metadataRef_)
void Write(CodeFormatter& formatter, Function& function, Context& context) pure virtual
void WriteMetadataRef(CodeFormatter& formatter)
void WriteResult(CodeFormatter& formatter, Function& function, Context& context)

Member Variables

MDStructRef* metadataRef
int resultId

Constructor Details

Instruction Constructor

cmsxi::Instruction::Instruction()

Definition at line 15 of Instruction.cpp :
 15 : resultId(-1)metadataRef(nullptr)
 16 {
 17 }


Declaration at line 26 of Instruction.hpp


Member Function Details

GetType Member Function

Type * cmsxi::Instruction::GetType(Context & context) override

Definition at line 19 of Instruction.cpp :
 20 {
 21     return context.GetVoidType();
 22 }


Declaration at line 27 of Instruction.hpp

Base class overridden functions: cmsxi::Value::GetType

Derived class overrides: cmsxi::BinaryInstruction::GetType , cmsxi::CallInstruction::GetType , cmsxi::ElemAddrInstruction::GetType , cmsxi::EqualInstruction::GetType , cmsxi::LessInstruction::GetType , cmsxi::LoadInstruction::GetType , cmsxi::LocalInstruction::GetType , cmsxi::ParamInstruction::GetType , cmsxi::PtrDiffInstruction::GetType , cmsxi::PtrOffsetInstruction::GetType , cmsxi::TrapInstruction::GetType , cmsxi::UnaryInstruction::GetType , cmsxi::UnaryTypeInstruction::GetType

Calls: cmsxi::Context::GetVoidType

Called by: cmsxi::Instruction::WriteResult


IsNoOperation Member Function

bool cmsxi::Instruction::IsNoOperation() const virtual

Definition at line 33 of Instruction.hpp :
 33 { return false; }

Derived class overrides: cmsxi::NoOperationInstruction::IsNoOperation

Called by: cmsxi::Context::AddLineInfo


Name Member Function

std::string cmsxi::Instruction::Name(Context & context) override

Definition at line 24 of Instruction.cpp :
 25 {
 26     return "$" + std::to_string(resultId);
 27 }


Declaration at line 29 of Instruction.hpp

Base class overridden functions: cmsxi::Value::Name

Called by: cmsxi::Instruction::WriteResult


SetMetadataRef Member Function

void cmsxi::Instruction::SetMetadataRef(MDStructRef * metadataRef_)

Definition at line 31 of Instruction.hpp :
 31 { metadataRef = metadataRef_; }

Called by: cmsxi::Context::AddLineInfo , cmsxi::Context::SetMetadataRef


Write Member Function

void cmsxi::Instruction::Write(CodeFormatter & formatter, Function & function, Context & context) pure virtual

Definition at line 28 of Instruction.hpp


WriteMetadataRef Member Function

void cmsxi::Instruction::WriteMetadataRef(CodeFormatter& formatter)

Definition at line 36 of Instruction.cpp :
 37 {
 38     if (metadataRef)
 39     {
 40         formatter.Write(" ");
 41         metadataRef->Write(formatter);
 42     }
 43 }


Calls: cmsxi::MDStructRef::Write

Called by: cmsxi::AddInstruction::Write , cmsxi::AndInstruction::Write , cmsxi::ArgInstruction::Write , cmsxi::BitCastInstruction::Write , cmsxi::BranchInstruction::Write , cmsxi::CallInstruction::Write , cmsxi::DivInstruction::Write , cmsxi::ElemAddrInstruction::Write , cmsxi::EqualInstruction::Write , cmsxi::FloatToIntInstruction::Write , cmsxi::IntToFloatInstruction::Write , cmsxi::IntToPtrInstruction::Write , cmsxi::JumpInstruction::Write , cmsxi::LessInstruction::Write , cmsxi::LoadInstruction::Write , cmsxi::LocalInstruction::Write , cmsxi::ModInstruction::Write , cmsxi::MulInstruction::Write , cmsxi::NegInstruction::Write , cmsxi::NoOperationInstruction::Write , cmsxi::NotInstruction::Write , cmsxi::OrInstruction::Write , cmsxi::ParamInstruction::Write , cmsxi::PtrDiffInstruction::Write , cmsxi::PtrOffsetInstruction::Write , cmsxi::PtrToIntInstruction::Write , cmsxi::RetInstruction::Write , cmsxi::ShlInstruction::Write , cmsxi::ShrInstruction::Write , cmsxi::SignExtendInstruction::Write , cmsxi::StoreInstruction::Write , cmsxi::SubInstruction::Write , cmsxi::SwitchInstruction::Write , cmsxi::TrapInstruction::Write , cmsxi::TruncateInstruction::Write , cmsxi::XorInstruction::Write , cmsxi::ZeroExtendInstruction::Write


WriteResult Member Function

void cmsxi::Instruction::WriteResult(CodeFormatter& formatter, Function & function, Context & context)

Definition at line 29 of Instruction.cpp :
 30 {
 31     formatter.Write(Format(GetType(context)->Name()7FormatWidth::min));
 32     resultId = function.GetNextResultNumber();
 33     formatter.Write(" " + Name(context));
 34 }


Calls: cmsxi::Function::GetNextResultNumber , cmsxi::Instruction::GetType , cmsxi::Instruction::Name , cmsxi::Type::Name

Called by: cmsxi::AddInstruction::Write , cmsxi::AndInstruction::Write , cmsxi::BitCastInstruction::Write , cmsxi::CallInstruction::Write , cmsxi::DivInstruction::Write , cmsxi::ElemAddrInstruction::Write , cmsxi::EqualInstruction::Write , cmsxi::FloatToIntInstruction::Write , cmsxi::IntToFloatInstruction::Write , cmsxi::IntToPtrInstruction::Write , cmsxi::LessInstruction::Write , cmsxi::LoadInstruction::Write , cmsxi::LocalInstruction::Write , cmsxi::ModInstruction::Write , cmsxi::MulInstruction::Write , cmsxi::NegInstruction::Write , cmsxi::NotInstruction::Write , cmsxi::OrInstruction::Write , cmsxi::ParamInstruction::Write , cmsxi::PtrDiffInstruction::Write , cmsxi::PtrOffsetInstruction::Write , cmsxi::PtrToIntInstruction::Write , cmsxi::ShlInstruction::Write , cmsxi::ShrInstruction::Write , cmsxi::SignExtendInstruction::Write , cmsxi::SubInstruction::Write , cmsxi::TrapInstruction::Write , cmsxi::TruncateInstruction::Write , cmsxi::XorInstruction::Write , cmsxi::ZeroExtendInstruction::Write


top | up | prev | next