1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Improved string table usage tracking

This commit is contained in:
Brian Fiete 2021-02-09 10:40:37 -08:00
parent bb2fe56dc9
commit 9d79db063b
6 changed files with 94 additions and 55 deletions

View file

@ -6439,19 +6439,16 @@ void BfModule::FixIntUnknown(BfTypedValue& lhs, BfTypedValue& rhs)
FixIntUnknown(rhs);
}
void BfModule::FixValueActualization(BfTypedValue& typedVal)
void BfModule::FixValueActualization(BfTypedValue& typedVal, bool force)
{
if (!typedVal.mValue.IsConst())
return;
if (mBfIRBuilder->mIgnoreWrites)
if ((mBfIRBuilder->mIgnoreWrites) && (!force))
return;
auto constant = mBfIRBuilder->GetConstant(typedVal.mValue);
if (constant->mConstType == BfConstType_TypeOf)
{
auto constTypeOf = (BfTypeOf_Const*)constant;
AddDependency(constTypeOf->mType, mCurTypeInstance, BfDependencyMap::DependencyFlag_ExprTypeReference);
typedVal.mValue = CreateTypeDataRef(constTypeOf->mType);
}
if (!HasUnactializedConstant(constant, mBfIRBuilder))
return;
typedVal.mValue = ConstantToCurrent(constant, mBfIRBuilder, typedVal.mType, false);
}
BfTypeInstance* BfModule::GetPrimitiveStructType(BfTypeCode typeCode)