mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Reflection fixes
This commit is contained in:
parent
5f010456be
commit
501e1028ee
1 changed files with 7 additions and 2 deletions
|
@ -1278,6 +1278,7 @@ void BfCompiler::CreateVData(BfVDataModule* bfModule)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool needsTypeData = (needsTypeList) || ((type->IsObject()) && (needsObjectTypeData));
|
bool needsTypeData = (needsTypeList) || ((type->IsObject()) && (needsObjectTypeData));
|
||||||
|
bool needsVData = (type->IsObject()) && (typeInst->mHasBeenInstantiated);
|
||||||
|
|
||||||
bool forceReflectFields = false;
|
bool forceReflectFields = false;
|
||||||
|
|
||||||
|
@ -1288,7 +1289,6 @@ void BfCompiler::CreateVData(BfVDataModule* bfModule)
|
||||||
forceReflectFields = true;
|
forceReflectFields = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool needsVData = (type->IsObject()) && (typeInst->mHasBeenInstantiated);
|
|
||||||
BfIRValue typeVariable;
|
BfIRValue typeVariable;
|
||||||
|
|
||||||
if ((needsTypeData) || (needsVData))
|
if ((needsTypeData) || (needsVData))
|
||||||
|
@ -1330,6 +1330,11 @@ void BfCompiler::CreateVData(BfVDataModule* bfModule)
|
||||||
auto typeDataConst = bfModule->mBfIRBuilder->CreateConstArray(arrayType, typeDataVector);
|
auto typeDataConst = bfModule->mBfIRBuilder->CreateConstArray(arrayType, typeDataVector);
|
||||||
BfIRValue typeDataArray = bfModule->mBfIRBuilder->CreateGlobalVariable(arrayType, true, BfIRLinkageType_External,
|
BfIRValue typeDataArray = bfModule->mBfIRBuilder->CreateGlobalVariable(arrayType, true, BfIRLinkageType_External,
|
||||||
typeDataConst, typesVariableName);
|
typeDataConst, typesVariableName);
|
||||||
|
|
||||||
|
StringT<128> typeCountVariableName;
|
||||||
|
BfMangler::MangleStaticFieldName(typeCountVariableName, GetMangleKind(), typeDefType->ToTypeInstance(), "sTypeCount", bfModule->GetPrimitiveType(BfTypeCode_Int32));
|
||||||
|
bfModule->mBfIRBuilder->CreateGlobalVariable(bfModule->mBfIRBuilder->MapType(bfModule->GetPrimitiveType(BfTypeCode_Int32)), true, BfIRLinkageType_External,
|
||||||
|
bfModule->mBfIRBuilder->CreateConst(BfTypeCode_Int32, (int)typeDataVector.size()), typeCountVariableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
HashSet<int> foundStringIds;
|
HashSet<int> foundStringIds;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue