mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed issues with global var addresses in const arrays
This commit is contained in:
parent
52af512b4f
commit
b30a72719c
13 changed files with 376 additions and 36 deletions
|
@ -5388,6 +5388,10 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
|
|||
baseTypeId = typeInstance->mBaseType->mTypeId;
|
||||
}
|
||||
|
||||
BfTypeOptions* typeOptions = NULL;
|
||||
if (typeInstance->mTypeOptionsIdx >= 0)
|
||||
typeOptions = mSystem->GetTypeOptions(typeInstance->mTypeOptionsIdx);
|
||||
|
||||
SizedArray<BfIRValue, 16> customAttrs;
|
||||
|
||||
BfTypeInstance* attributeType = mContext->mUnreifiedModule->ResolveTypeDef(mCompiler->mAttributeTypeDef)->ToTypeInstance();
|
||||
|
@ -5716,7 +5720,13 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
|
|||
if ((!fieldDef->mIsStatic) && ((fieldReflectKind & ReflectKind_NonStaticFields) != 0))
|
||||
includeField = true;
|
||||
if ((fieldDef->mIsStatic) && ((fieldReflectKind & ReflectKind_StaticFields) != 0))
|
||||
includeField = true;
|
||||
includeField = true;
|
||||
|
||||
if ((!fieldDef->mIsStatic) && (typeOptions != NULL))
|
||||
includeField = typeOptions->Apply(includeField, BfOptionFlags_ReflectNonStaticFields);
|
||||
if ((fieldDef->mIsStatic) && (typeOptions != NULL))
|
||||
includeField = typeOptions->Apply(includeField, BfOptionFlags_ReflectStaticFields);
|
||||
|
||||
includeField |= forceReflectFields;
|
||||
|
||||
if (!includeField)
|
||||
|
@ -6031,7 +6041,20 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
|
|||
includeMethod = true;
|
||||
if ((methodDef->mIsStatic) && ((methodReflectKind & ReflectKind_StaticMethods) != 0))
|
||||
includeMethod = true;
|
||||
|
||||
|
||||
if (methodDef->mMethodType == BfMethodType_Ctor)
|
||||
{
|
||||
if (typeOptions != NULL)
|
||||
includeMethod = typeOptions->Apply(includeMethod, BfOptionFlags_ReflectConstructors);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((!methodDef->mIsStatic) && (typeOptions != NULL))
|
||||
includeMethod = typeOptions->Apply(includeMethod, BfOptionFlags_ReflectNonStaticMethods);
|
||||
if ((methodDef->mIsStatic) && (typeOptions != NULL))
|
||||
includeMethod = typeOptions->Apply(includeMethod, BfOptionFlags_ReflectStaticMethods);
|
||||
}
|
||||
|
||||
if (!includeMethod)
|
||||
continue;
|
||||
|
||||
|
@ -9820,6 +9843,11 @@ void BfModule::CurrentAddToConstHolder(BfIRValue& irVal)
|
|||
return;
|
||||
}
|
||||
|
||||
if (constant->mConstType == BfConstType_GlobalVar)
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
auto origConst = irVal;
|
||||
if ((constant->mConstType == BfConstType_BitCast) || (constant->mConstType == BfConstType_BitCastNull))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue