top | up | prev | next

LoadInstruction Abstract Class

Definition at line 245 of Instruction.hpp

Constructors

LoadInstruction(Value* ptr_)

Member Functions

Type* GetType(Context& context) override
void Write(CodeFormatter& formatter, Function& function, Context& context)

Member Variables

Value* ptr

Constructor Details

LoadInstruction Constructor

cmsxi::LoadInstruction::LoadInstruction(Value * ptr_)

Definition at line 383 of Instruction.cpp :
383 : Instruction()ptr(ptr_)
384 {
385 }


Declaration at line 248 of Instruction.hpp


Member Function Details

GetType Member Function

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

Definition at line 387 of Instruction.cpp :
388 {
389     Assert(ptr->GetType(context)->IsPtrType()"pointer type expected");
390     PtrType* ptrType = static_cast<PtrType*>(ptr->GetType(context));
391     return ptrType->BaseType();
392 }


Declaration at line 249 of Instruction.hpp

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

Calls: cmsxi::PtrType::BaseType , cmsxi::Type::IsPtrType , cmsxi::Value::GetType


Write Member Function

void cmsxi::LoadInstruction::Write(CodeFormatter& formatter, Function & function, Context & context)

Definition at line 394 of Instruction.cpp :
395 {
396     WriteResult(formatterfunctioncontext);
397     formatter.Write(" = load ");
398     formatter.Write(ptr->GetType(context)->Name());
399     formatter.Write(" ");
400     formatter.Write(ptr->Name(context));
401     WriteMetadataRef(formatter);
402 }


Calls: cmsxi::Instruction::WriteMetadataRef , cmsxi::Instruction::WriteResult , cmsxi::Type::Name , cmsxi::Value::GetType , cmsxi::Value::Name


top | up | prev | next