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

More support for bitcasts with consts

This commit is contained in:
Brian Fiete 2021-12-16 11:00:56 -05:00
parent 0ee161c314
commit def7990dbe
4 changed files with 47 additions and 24 deletions

View file

@ -11811,7 +11811,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
if (allowCast)
{
if (ignoreWrites)
if ((ignoreWrites) && (!typedVal.mValue.IsConst()))
return mBfIRBuilder->GetFakeVal();
return mBfIRBuilder->CreateBitCast(typedVal.mValue, mBfIRBuilder->MapType(toType));
}