1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Merge pull request #1798 from MineGame159/type_static_abstract

Add IsStatic and IsAbstract to System.Type
This commit is contained in:
Brian Fiete 2023-02-17 11:07:20 -05:00 committed by GitHub
commit 0aedc37d42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 1 deletions

View file

@ -394,6 +394,22 @@ namespace System
} }
} }
public bool IsStatic
{
get
{
return (mTypeFlags & .Static) != 0;
}
}
public bool IsAbstract
{
get
{
return (mTypeFlags & .Abstract) != 0;
}
}
public virtual int32 GenericParamCount public virtual int32 GenericParamCount
{ {
get get
@ -1461,6 +1477,9 @@ namespace System.Reflection
Function = 0x40000, Function = 0x40000,
HasDestructor = 0x80000, HasDestructor = 0x80000,
GenericParam = 0x100000, GenericParam = 0x100000,
Static = 0x200000,
Abstract = 0x400000,
} }
public enum FieldFlags : uint16 public enum FieldFlags : uint16

View file

@ -5997,6 +5997,11 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
if ((type->mDefineState != BfTypeDefineState_CETypeInit) && (type->WantsGCMarking())) if ((type->mDefineState != BfTypeDefineState_CETypeInit) && (type->WantsGCMarking()))
typeFlags |= BfTypeFlags_WantsMarking; typeFlags |= BfTypeFlags_WantsMarking;
if ((typeInstance != NULL) && (typeInstance->mTypeDef->mIsStatic))
typeFlags |= BfTypeFlags_Static;
if ((typeInstance != NULL) && (typeInstance->mTypeDef->mIsAbstract))
typeFlags |= BfTypeFlags_Abstract;
int virtSlotIdx = -1; int virtSlotIdx = -1;
if ((typeInstance != NULL) && (typeInstance->mSlotNum >= 0)) if ((typeInstance != NULL) && (typeInstance->mSlotNum >= 0))
virtSlotIdx = typeInstance->mSlotNum + 1 + mCompiler->GetDynCastVDataCount(); virtSlotIdx = typeInstance->mSlotNum + 1 + mCompiler->GetDynCastVDataCount();

View file

@ -220,7 +220,10 @@ enum BfTypeFlags
BfTypeFlags_Delegate = 0x20000, BfTypeFlags_Delegate = 0x20000,
BfTypeFlags_Function = 0x40000, BfTypeFlags_Function = 0x40000,
BfTypeFlags_HasDestructor = 0x80000, BfTypeFlags_HasDestructor = 0x80000,
BfTypeFlags_GenericParam = 0x100000 BfTypeFlags_GenericParam = 0x100000,
BfTypeFlags_Static = 0x200000,
BfTypeFlags_Abstract = 0x400000,
}; };
enum BfMethodFlags enum BfMethodFlags