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

Add Mixin methog flag

This commit is contained in:
zkw 2024-04-27 13:52:00 +02:00
parent 1625d511be
commit 0d680ca5c2
4 changed files with 7 additions and 0 deletions

View file

@ -56,6 +56,9 @@ namespace System.Reflection
public bool CanReflect => Compiler.IsComptime ?
Type.[Friend]Comptime_Method_GetInfo(mData.mComptimeMethodInstance).mComptimeMethodFlags.HasFlag(.NoReflect) :
mData.mMethodData.[Friend]mFlags.HasFlag(.SpecialName);
public bool IsMixin => Compiler.IsComptime ?
Type.[Friend]Comptime_Method_GetInfo(mData.mComptimeMethodInstance).mMethodFlags.HasFlag(.Mixin) :
mData.mMethodData.[Friend]mFlags.HasFlag(.Mixin);
public StringView Name => Compiler.IsComptime ?
Type.[Friend]Comptime_Method_GetName(mData.mComptimeMethodInstance) :

View file

@ -1533,6 +1533,7 @@ namespace System.Reflection
Virtual = 0x0040, // Method virtual.
HideBySig = 0x0080, // Method hides by name+sig, else just by name.
ReadOnly = 0x0100,
Mixin = 0x0200,
Abstract = 0x0400, // Method does not provide an implementation.
SpecialName = 0x0800, // Method is special. Name describes how.
StdCall = 0x1000,

View file

@ -830,6 +830,8 @@ BfMethodFlags BfMethodInstance::GetMethodFlags()
methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Constructor);
if (mMethodDef->mIsReadOnly)
methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_ReadOnly);
if (mMethodDef->mMethodType == BfMethodType_Mixin)
methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Mixin);
auto callingConvention = GetOwner()->mModule->GetIRCallingConvention(this);
if (callingConvention == BfIRCallingConv_ThisCall)

View file

@ -240,6 +240,7 @@ enum BfMethodFlags
BfMethodFlags_Static = 0x10,
BfMethodFlags_Virtual = 0x40,
BfMethodFlags_ReadOnly = 0x100,
BfMethodFlags_Mixin = 0x200,
BfMethodFlags_StdCall = 0x1000,
BfMethodFlags_FastCall = 0x2000,
BfMethodFlags_ThisCall = 0x3000,