1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Made FileData.mData 64-bit

This commit is contained in:
Brian Fiete 2021-12-29 11:09:37 -05:00
parent 1883b7378a
commit 5e9a6031fb
3 changed files with 14 additions and 15 deletions

View file

@ -693,8 +693,8 @@ namespace System.Reflection
public struct FieldData public struct FieldData
{ {
public String mName; public String mName;
public int mData; public TypeId mFieldTypeId;
public TypeId mFieldTypeId; public int64 mData;
public FieldFlags mFlags; public FieldFlags mFlags;
public int32 mCustomAttributesIdx; public int32 mCustomAttributesIdx;
} }

View file

@ -654,8 +654,8 @@ namespace System.Reflection
public struct FieldData public struct FieldData
{ {
public String mName; public String mName;
public int mData; public TypeId mFieldTypeId;
public TypeId mFieldTypeId; public int64 mData;
public FieldFlags mFlags; public FieldFlags mFlags;
public int32 mCustomAttributesIdx; public int32 mCustomAttributesIdx;
} }

View file

@ -6382,8 +6382,8 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
{ {
emptyValueType, emptyValueType,
payloadNameConst, // mName payloadNameConst, // mName
GetConstValue(0, intPtrType), // mData GetConstValue(payloadType->mTypeId, typeIdType), // mFieldTypeId
GetConstValue(payloadType->mTypeId, typeIdType), // mFieldTypeId GetConstValue(0, longType), // mData
GetConstValue(FieldFlags_SpecialName | FieldFlags_EnumPayload, shortType), // mFlags GetConstValue(FieldFlags_SpecialName | FieldFlags_EnumPayload, shortType), // mFlags
GetConstValue(-1, intType), // mCustomAttributesIdx GetConstValue(-1, intType), // mCustomAttributesIdx
}; };
@ -6396,9 +6396,9 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
SizedArray<BfIRValue, 8> dscrFieldVals = SizedArray<BfIRValue, 8> dscrFieldVals =
{ {
emptyValueType, emptyValueType,
dscrNameConst, // mName dscrNameConst, // mName
GetConstValue(BF_ALIGN(payloadType->mSize, dscrType->mAlign), intPtrType), // mData GetConstValue(dscrType->mTypeId, typeIdType), // mFieldTypeId
GetConstValue(dscrType->mTypeId, typeIdType), // mFieldTypeId GetConstValue(BF_ALIGN(payloadType->mSize, dscrType->mAlign), longType), // mData
GetConstValue(FieldFlags_SpecialName | FieldFlags_EnumDiscriminator, shortType), // mFlags GetConstValue(FieldFlags_SpecialName | FieldFlags_EnumDiscriminator, shortType), // mFlags
GetConstValue(-1, intType), // mCustomAttributesIdx GetConstValue(-1, intType), // mCustomAttributesIdx
}; };
@ -6445,7 +6445,7 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
if (fieldInstance->mConstIdx != -1) if (fieldInstance->mConstIdx != -1)
{ {
auto constant = typeInstance->mConstHolder->GetConstantById(fieldInstance->mConstIdx); auto constant = typeInstance->mConstHolder->GetConstantById(fieldInstance->mConstIdx);
constValue = mBfIRBuilder->CreateConst(BfTypeCode_IntPtr, constant->mUInt64); constValue = mBfIRBuilder->CreateConst(BfTypeCode_Int64, constant->mUInt64);
} }
} }
else if (fieldInstance->GetFieldDef()->mIsStatic) else if (fieldInstance->GetFieldDef()->mIsStatic)
@ -6466,20 +6466,19 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
if (refVal.IsAddr()) if (refVal.IsAddr())
{ {
constValue = mBfIRBuilder->CreatePtrToInt(refVal.mValue, BfTypeCode_IntPtr); constValue = mBfIRBuilder->CreatePtrToInt(refVal.mValue, BfTypeCode_Int64);
} }
} }
if (!constValue) if (!constValue)
constValue = mBfIRBuilder->CreateConst(BfTypeCode_IntPtr, fieldInstance->mDataOffset); constValue = mBfIRBuilder->CreateConst(BfTypeCode_Int64, fieldInstance->mDataOffset);
SizedArray<BfIRValue, 8> fieldVals = SizedArray<BfIRValue, 8> fieldVals =
{ {
emptyValueType, emptyValueType,
fieldNameConst, // mName fieldNameConst, // mName
constValue, // mConstValue
GetConstValue(typeId, typeIdType), // mFieldTypeId GetConstValue(typeId, typeIdType), // mFieldTypeId
constValue, // mConstValue
GetConstValue(fieldFlags, shortType), // mFlags GetConstValue(fieldFlags, shortType), // mFlags
GetConstValue(customAttrIdx, intType), // mCustomAttributesIdx GetConstValue(customAttrIdx, intType), // mCustomAttributesIdx
}; };