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

Reflection fixes

This commit is contained in:
Brian Fiete 2020-05-01 09:11:13 -07:00
parent 501e1028ee
commit 191d0337d0
2 changed files with 20 additions and 11 deletions

View file

@ -5837,6 +5837,7 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
MethodFlags_FastCall = 0x2000, MethodFlags_FastCall = 0x2000,
MethodFlags_ThisCall = 0x3000, MethodFlags_ThisCall = 0x3000,
MethodFlags_Mutating = 0x4000, MethodFlags_Mutating = 0x4000,
MethodFlags_Constructor = 0x8000,
}; };
MethodFlags methodFlags = (MethodFlags)0; MethodFlags methodFlags = (MethodFlags)0;
@ -5853,6 +5854,8 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
methodFlags = (MethodFlags)(methodFlags | MethodFlags_FastCall); methodFlags = (MethodFlags)(methodFlags | MethodFlags_FastCall);
if (methodDef->mIsMutating) if (methodDef->mIsMutating)
methodFlags = (MethodFlags)(methodFlags | MethodFlags_Mutating); methodFlags = (MethodFlags)(methodFlags | MethodFlags_Mutating);
if (methodDef->mMethodType == BfMethodType_Ctor)
methodFlags = (MethodFlags)(methodFlags | MethodFlags_Constructor);
auto callingConvention = GetIRCallingConvention(defaultMethod); auto callingConvention = GetIRCallingConvention(defaultMethod);
if (callingConvention == BfIRCallingConv_ThisCall) if (callingConvention == BfIRCallingConv_ThisCall)
@ -6012,13 +6015,11 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
GetConstValue((int)methodTypes.size(), shortType), // mMethodDataCount GetConstValue((int)methodTypes.size(), shortType), // mMethodDataCount
GetConstValue(0, shortType), // mPropertyDataCount GetConstValue(0, shortType), // mPropertyDataCount
GetConstValue((int)fieldTypes.size(), shortType), // mFieldDataCount GetConstValue((int)fieldTypes.size(), shortType), // mFieldDataCount
GetConstValue(0, shortType), // mConstructorDataCount
voidPtrNull, // mInterfaceDataPtr voidPtrNull, // mInterfaceDataPtr
methodDataPtr, // mMethodDataPtr methodDataPtr, // mMethodDataPtr
voidPtrNull, // mPropertyDataPtr voidPtrNull, // mPropertyDataPtr
fieldDataPtr, // mFieldDataPtr fieldDataPtr, // mFieldDataPtr
voidPtrNull, // mConstructorDataPtr
customAttrDataPtr, // mCustomAttrDataPtr customAttrDataPtr, // mCustomAttrDataPtr
}; };
@ -10146,6 +10147,12 @@ void BfModule::ProcessTypeInstCustomAttributes(bool& isPacked, bool& isUnion, bo
if ((constant != NULL) && (constant->mBool)) if ((constant != NULL) && (constant->mBool))
mCurTypeInstance->mHasBeenInstantiated = true; mCurTypeInstance->mHasBeenInstantiated = true;
} }
else if (propertyDef->mName == "IncludeAllMethods")
{
auto constant = mCurTypeInstance->mConstHolder->GetConstant(setProp.mParam.mValue);
if ((constant != NULL) && (constant->mBool))
mCurTypeInstance->mIncludeAllMethods = true;
}
} }
} }
} }

View file

@ -1607,6 +1607,7 @@ public:
int16 mInheritDepth; int16 mInheritDepth;
int16 mSlotNum; int16 mSlotNum;
bool mHasBeenInstantiated; bool mHasBeenInstantiated;
bool mIncludeAllMethods;
bool mIsReified; bool mIsReified;
bool mIsTypedPrimitive; bool mIsTypedPrimitive;
bool mIsCRepr; bool mIsCRepr;
@ -1670,6 +1671,7 @@ public:
mResolvingConstField = false; mResolvingConstField = false;
mHasPackingHoles = false; mHasPackingHoles = false;
mHasBeenInstantiated = false; mHasBeenInstantiated = false;
mIncludeAllMethods = false;
mWantsGCMarking = false; mWantsGCMarking = false;
mHasParameterizedBase = false; mHasParameterizedBase = false;
mMergedFieldDataCount = 0; mMergedFieldDataCount = 0;