mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Tightened std type lookup requirements, fixed reified redecl issue
This commit is contained in:
parent
fbe9a906e4
commit
85b4afcd94
3 changed files with 26 additions and 12 deletions
|
@ -6231,10 +6231,10 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
||||||
return typeDef;
|
return typeDef;
|
||||||
};
|
};
|
||||||
|
|
||||||
mArray1TypeDef = _GetRequiredType("System.Array1");
|
mArray1TypeDef = _GetRequiredType("System.Array1", 1);
|
||||||
mArray2TypeDef = _GetRequiredType("System.Array2");
|
mArray2TypeDef = _GetRequiredType("System.Array2", 1);
|
||||||
mArray3TypeDef = _GetRequiredType("System.Array3");
|
mArray3TypeDef = _GetRequiredType("System.Array3", 1);
|
||||||
mArray4TypeDef = _GetRequiredType("System.Array4");
|
mArray4TypeDef = _GetRequiredType("System.Array4", 1);
|
||||||
mSpanTypeDef = _GetRequiredType("System.Span", 1);
|
mSpanTypeDef = _GetRequiredType("System.Span", 1);
|
||||||
mAttributeTypeDef = _GetRequiredType("System.Attribute");
|
mAttributeTypeDef = _GetRequiredType("System.Attribute");
|
||||||
mAttributeUsageAttributeTypeDef = _GetRequiredType("System.AttributeUsageAttribute");
|
mAttributeUsageAttributeTypeDef = _GetRequiredType("System.AttributeUsageAttribute");
|
||||||
|
@ -6270,7 +6270,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
||||||
mLinkNameAttributeTypeDef = _GetRequiredType("System.LinkNameAttribute");
|
mLinkNameAttributeTypeDef = _GetRequiredType("System.LinkNameAttribute");
|
||||||
mCallingConventionAttributeTypeDef = _GetRequiredType("System.CallingConventionAttribute");
|
mCallingConventionAttributeTypeDef = _GetRequiredType("System.CallingConventionAttribute");
|
||||||
mMethodRefTypeDef = _GetRequiredType("System.MethodReference", 1);
|
mMethodRefTypeDef = _GetRequiredType("System.MethodReference", 1);
|
||||||
mNullableTypeDef = _GetRequiredType("System.Nullable");
|
mNullableTypeDef = _GetRequiredType("System.Nullable", 1);
|
||||||
mOrderedAttributeTypeDef = _GetRequiredType("System.OrderedAttribute");
|
mOrderedAttributeTypeDef = _GetRequiredType("System.OrderedAttribute");
|
||||||
mPointerTTypeDef = _GetRequiredType("System.Pointer", 1);
|
mPointerTTypeDef = _GetRequiredType("System.Pointer", 1);
|
||||||
mPointerTypeDef = _GetRequiredType("System.Pointer", 0);
|
mPointerTypeDef = _GetRequiredType("System.Pointer", 0);
|
||||||
|
|
|
@ -2188,12 +2188,13 @@ void BfContext::GenerateModuleName_TypeInst(BfTypeInstance* typeInst, String& na
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int genericIdx = startGenericIdx; genericIdx < (int)typeInst->mTypeDef->mGenericParamDefs.size(); genericIdx++)
|
if (typeInst->mGenericTypeInfo != NULL)
|
||||||
{
|
{
|
||||||
auto genericType = (BfTypeInstance*)typeInst;
|
for (int genericIdx = startGenericIdx; genericIdx < (int)typeInst->mGenericTypeInfo->mTypeGenericArguments.size(); genericIdx++)
|
||||||
|
{
|
||||||
auto type = genericType->mGenericTypeInfo->mTypeGenericArguments[genericIdx];
|
auto type = typeInst->mGenericTypeInfo->mTypeGenericArguments[genericIdx];
|
||||||
GenerateModuleName_Type(type, name);
|
GenerateModuleName_Type(type, name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2363,6 +2364,11 @@ void BfContext::QueueMethodSpecializations(BfTypeInstance* typeInst, bool checkS
|
||||||
|
|
||||||
BP_ZONE("BfContext::QueueMethodSpecializations");
|
BP_ZONE("BfContext::QueueMethodSpecializations");
|
||||||
|
|
||||||
|
if (typeInst->mTypeId == 578)
|
||||||
|
{
|
||||||
|
NOP;
|
||||||
|
}
|
||||||
|
|
||||||
auto module = typeInst->mModule;
|
auto module = typeInst->mModule;
|
||||||
if (module == NULL)
|
if (module == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -2408,6 +2414,11 @@ void BfContext::QueueMethodSpecializations(BfTypeInstance* typeInst, bool checkS
|
||||||
|
|
||||||
auto methodDef = methodRef.mTypeInstance->mTypeDef->mMethods[methodRef.mMethodNum];
|
auto methodDef = methodRef.mTypeInstance->mTypeDef->mMethods[methodRef.mMethodNum];
|
||||||
|
|
||||||
|
if (methodDef->mName == "set__Capacity")
|
||||||
|
{
|
||||||
|
NOP;
|
||||||
|
}
|
||||||
|
|
||||||
auto targetContext = methodRef.mTypeInstance->mContext;
|
auto targetContext = methodRef.mTypeInstance->mContext;
|
||||||
BfMethodSpecializationRequest* specializationRequest = targetContext->mMethodSpecializationWorkList.Alloc();
|
BfMethodSpecializationRequest* specializationRequest = targetContext->mMethodSpecializationWorkList.Alloc();
|
||||||
if (specializedMethodRefInfo.mHasReifiedRef)
|
if (specializedMethodRefInfo.mHasReifiedRef)
|
||||||
|
|
|
@ -11448,8 +11448,9 @@ bool BfModule::IsCompatibleInterfaceMethod(BfMethodInstance* iMethodInst, BfMeth
|
||||||
}
|
}
|
||||||
|
|
||||||
void BfModule::AddMethodReference(const BfMethodRef& methodRef, BfGetMethodInstanceFlags flags)
|
void BfModule::AddMethodReference(const BfMethodRef& methodRef, BfGetMethodInstanceFlags flags)
|
||||||
{
|
{
|
||||||
BfMethodInstance* methodInstance = methodRef;
|
BfMethodInstance* methodInstance = methodRef;
|
||||||
|
|
||||||
if ((mCurTypeInstance != NULL) && (!mCompiler->IsAutocomplete()))
|
if ((mCurTypeInstance != NULL) && (!mCompiler->IsAutocomplete()))
|
||||||
{
|
{
|
||||||
auto methodInstanceGroup = methodInstance->mMethodInstanceGroup;
|
auto methodInstanceGroup = methodInstance->mMethodInstanceGroup;
|
||||||
|
@ -11665,7 +11666,7 @@ BfModule* BfModule::GetOrCreateMethodModule(BfMethodInstance* methodInstance)
|
||||||
}
|
}
|
||||||
|
|
||||||
BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfMethodDef* methodDef, const BfTypeVector& methodGenericArguments, BfGetMethodInstanceFlags flags, BfTypeInstance* foreignType)
|
BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfMethodDef* methodDef, const BfTypeVector& methodGenericArguments, BfGetMethodInstanceFlags flags, BfTypeInstance* foreignType)
|
||||||
{
|
{
|
||||||
if (((flags & BfGetMethodInstanceFlag_ForceInline) != 0) && (mCompiler->mIsResolveOnly))
|
if (((flags & BfGetMethodInstanceFlag_ForceInline) != 0) && (mCompiler->mIsResolveOnly))
|
||||||
{
|
{
|
||||||
// Don't bother inlining for resolve-only
|
// Don't bother inlining for resolve-only
|
||||||
|
@ -12300,6 +12301,8 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM
|
||||||
}
|
}
|
||||||
|
|
||||||
BfModule* declareModule = GetOrCreateMethodModule(methodInstance);
|
BfModule* declareModule = GetOrCreateMethodModule(methodInstance);
|
||||||
|
if ((doingRedeclare) && (methodInstance->mDeclModule != mContext->mUnreifiedModule))
|
||||||
|
declareModule = methodInstance->mDeclModule;
|
||||||
|
|
||||||
BF_ASSERT(typeInst == methodInstance->GetOwner());
|
BF_ASSERT(typeInst == methodInstance->GetOwner());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue