top | up | prev | next

PointerDefaultCtor Class

Definition at line 29 of OperationRepository.cpp

Constructors

PointerDefaultCtor(TypeSymbol* type_, const Span& span, const boost::uuids::uuid& moduleId)

Member Functions

const char* ClassName() const override
SymbolAccess DeclaredAccess() const override
void GenerateCall(Emitter& emitter, std::vector<GenObject*>& genObjects, OperationFlags flags, const Span& span, const boost::uuids::uuid& moduleId) override
bool IsBasicTypeOperation() const override

Member Variables

void* nullValue
TypeSymbol* type

Constructor Details

PointerDefaultCtor Constructor

cmajor::binder::PointerDefaultCtor::PointerDefaultCtor(TypeSymbol* type_, const Span& span, const boost::uuids::uuid& moduleId)

Definition at line 42 of OperationRepository.cpp :
  42 : FunctionSymbol(spanmoduleIdU"@constructor")type(type_)nullValue(nullptr)
  43 {
  44     SetGroupName(U"@constructor");
  45     SetAccess(SymbolAccess::public_);
  46     ParameterSymbol* thisParam = new ParameterSymbol(spanmoduleIdU"this");
  47     thisParam->SetType(type->AddPointer(spanmoduleId));
  48     AddMember(thisParam);
  49     ComputeName();
  50 }


Declaration at line 32 of OperationRepository.cpp


Member Function Details

ClassName Member Function

const char * cmajor::binder::PointerDefaultCtor::ClassName() const override

Definition at line 36 of OperationRepository.cpp :
  36 { return "PointerDefaultCtor"; }


DeclaredAccess Member Function

SymbolAccess cmajor::binder::PointerDefaultCtor::DeclaredAccess() const override

Definition at line 33 of OperationRepository.cpp :
  33 { return SymbolAccess::public_; }


GenerateCall Member Function

void cmajor::binder::PointerDefaultCtor::GenerateCall(Emitter& emitter, std::vector<GenObject*>& genObjects, OperationFlags flags, const Span& span, const boost::uuids::uuid& moduleId) override

Definition at line 52 of OperationRepository.cpp :
  53 {
  54     Assert(genObjects.size() == 1"default constructor needs one object");
  55     if (!nullValue)
  56     {
  57         nullValue = emitter.CreateDefaultIrValueForPtrType(type->IrType(emitter));
  58     }
  59     emitter.Stack().Push(nullValue);
  60     genObjects[0]->Store(emitterOperationFlags::none);
  61 }


Declaration at line 34 of OperationRepository.cpp


IsBasicTypeOperation Member Function

bool cmajor::binder::PointerDefaultCtor::IsBasicTypeOperation() const override

Definition at line 35 of OperationRepository.cpp :
  35 { return true; }


top | up | prev | next