| 6168 | } |
| 6169 | |
| 6170 | void 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 | |
| 6184 | BfIRValue BfModule::GetTypeTypeData(BfType* type, BfCreateTypeDataContext& ctx, bool needsTypeData, bool wantsTypeDecl, bool needsTypeNames, int& typeFlags, int& typeCode) |
| 6185 | { |
no test coverage detected