1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Reworked functions with explicit 'this'

This commit is contained in:
Brian Fiete 2020-09-11 10:33:16 -07:00
parent 9fde8a3c89
commit 3627f8c40f
15 changed files with 556 additions and 199 deletions

View file

@ -311,14 +311,9 @@ void BfGNUMangler::MangleTypeInst(MangleContext& mangleContext, StringImpl& name
else
name += "N8functionI";
SizedArray<BfType*, 8> typeVec;
typeVec.push_back(BfNodeDynCast<BfDirectTypeReference>(methodDef->mReturnTypeRef)->mType);
if (delegateInfo->mFunctionThisType != NULL)
{
name += "_";
name += "this";
typeVec.push_back(delegateInfo->mFunctionThisType);
}
typeVec.push_back(BfNodeDynCast<BfDirectTypeReference>(methodDef->mReturnTypeRef)->mType);
if (methodDef->mIsMutating)
name += "_mut_";
for (int paramIdx = 0; paramIdx < (int)methodDef->mParams.size(); paramIdx++)
{
name += "_";
@ -1175,18 +1170,11 @@ bool BfMSMangler::FindOrCreateNameSub(MangleContext& mangleContext, StringImpl&
name += "?$delegate";
else
name += "?$function";
if (methodDef->mIsMutating)
name += "_mut_";
SizedArray<BfType*, 8> typeVec;
typeVec.push_back(BfNodeDynCast<BfDirectTypeReference>(methodDef->mReturnTypeRef)->mType);
if (delegateInfo->mFunctionThisType != NULL)
{
name += "_";
name += "this";
typeVec.push_back(delegateInfo->mFunctionThisType);
if ((delegateInfo->mFunctionThisType->IsValueType()) && (methodDef->mIsMutating))
name += "_mut";
}
for (int paramIdx = 0; paramIdx < (int)methodDef->mParams.size(); paramIdx++)
{
name += "_";