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

Fixed non-composites 'in' parameters

This commit is contained in:
Brian Fiete 2022-06-14 06:57:24 -07:00
parent 309e3cb02a
commit 0cf9135b8a
5 changed files with 51 additions and 8 deletions

View file

@ -12583,11 +12583,9 @@ BfTypedValue BfModule::LoadValue(BfTypedValue typedValue, BfAstNode* refNode, bo
{
return BfTypedValue(loadedVal, typedValue.mType, false);
}
/*if (isVolatile)
mBfIRBuilder->CreateFence(BfIRFenceType_AcquireRelease);*/
PopulateType(typedValue.mType, BfPopulateType_Data);
loadedVal = mBfIRBuilder->CreateAlignedLoad(loadedVal, std::max(1, (int)typedValue.mType->mAlign), isVolatile);
loadedVal = mBfIRBuilder->CreateAlignedLoad(loadedVal, std::max(1, (int)typedValue.mType->mAlign), isVolatile || typedValue.IsVolatile());
}
return BfTypedValue(loadedVal, typedValue.mType, false);
}
@ -14739,6 +14737,8 @@ BfTypedValue BfModule::ReferenceStaticField(BfFieldInstance* fieldInstance)
if (type->IsValuelessType())
return BfTypedValue(globalValue, type);
if (fieldDef->mIsVolatile)
return BfTypedValue(globalValue, type, BfTypedValueKind_VolatileAddr);
return BfTypedValue(globalValue, type, !fieldDef->mIsConst);
}