MCPcopy Create free account
hub / github.com/beefytech/Beef / GetMethodFlags

Method GetMethodFlags

IDEHelper/Compiler/BfResolvedTypeUtils.cpp:814–849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

812}
813
814BfMethodFlags BfMethodInstance::GetMethodFlags()
815{
816 BfMethodFlags methodFlags = (BfMethodFlags)0;
817
818 if (mMethodDef->mProtection == BfProtection_Protected)
819 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Protected);
820 if (mMethodDef->mProtection == BfProtection_Public)
821 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Public);
822 if (mMethodDef->mIsStatic)
823 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Static);
824 if ((mMethodDef->mIsVirtual) || (mVirtualTableIdx != -1))
825 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Virtual);
826 if (mMethodDef->mCallingConvention == BfCallingConvention_Fastcall)
827 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_FastCall);
828 if (mMethodDef->mIsMutating)
829 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Mutating);
830 if (mMethodDef->mMethodType == BfMethodType_Ctor)
831 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Constructor);
832 if (mMethodDef->mIsReadOnly)
833 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_ReadOnly);
834 if (mMethodDef->mMethodType == BfMethodType_Mixin)
835 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Mixin);
836
837 auto callingConvention = GetOwner()->mModule->GetIRCallingConvention(this);
838 if (callingConvention == BfIRCallingConv_ThisCall)
839 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_ThisCall);
840 else if (callingConvention == BfIRCallingConv_StdCall)
841 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_StdCall);
842 else if (callingConvention == BfIRCallingConv_FastCall)
843 methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_FastCall);
844
845 methodFlags = (BfMethodFlags)(methodFlags | (mMethodDef->mAppendKind * BfMethodFlags_AppendBit0));
846 methodFlags = (BfMethodFlags)(methodFlags | (mMethodDef->mCheckedKind * BfMethodFlags_CheckedBit0));
847
848 return methodFlags;
849}
850
851BfComptimeMethodFlags BfMethodInstance::GetComptimeMethodFlags()
852{

Callers 2

CreateTypeDataMethod · 0.80
ExecuteMethod · 0.80

Calls 1

Tested by

no test coverage detected