MCPcopy Create free account
hub / github.com/beefytech/Beef / CreateSlotOfs

Method CreateSlotOfs

IDEHelper/Compiler/BfModule.cpp:6170–6182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6168}
6169
6170void BfModule::CreateSlotOfs(BfTypeInstance* typeInstance)
6171{
6172 int virtSlotIdx = -1;
6173 if ((typeInstance != NULL) && (typeInstance->mSlotNum >= 0))
6174 virtSlotIdx = typeInstance->mSlotNum + mCompiler->GetVDataPrefixDataCount() + mCompiler->GetDynCastVDataCount();
6175
6176 // For interfaces we ONLY emit the slot num
6177 StringT<512> slotVarName;
6178 BfMangler::MangleStaticFieldName(slotVarName, mCompiler->GetMangleKind(), typeInstance, "sBfSlotOfs");
6179 auto intType = GetPrimitiveType(BfTypeCode_Int32);
6180 auto slotNumVar = mBfIRBuilder->CreateGlobalVariable(mBfIRBuilder->MapType(intType), true, BfIRLinkageType_External,
6181 GetConstValue32(virtSlotIdx), slotVarName);
6182}
6183
6184BfIRValue BfModule::GetTypeTypeData(BfType* type, BfCreateTypeDataContext& ctx, bool needsTypeData, bool wantsTypeDecl, bool needsTypeNames, int& typeFlags, int& typeCode)
6185{

Callers 1

CreateVDataMethod · 0.80

Calls 5

GetDynCastVDataCountMethod · 0.80
GetMangleKindMethod · 0.80
CreateGlobalVariableMethod · 0.80
MapTypeMethod · 0.80

Tested by

no test coverage detected