mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Fixed rebuild on comptime file content changes
This commit is contained in:
parent
05ef084a53
commit
b98503fab7
3 changed files with 16 additions and 11 deletions
|
@ -2238,7 +2238,8 @@ void BfContext::UpdateRevisedTypes()
|
|||
|
||||
if (changed)
|
||||
{
|
||||
RebuildType(typeInst);
|
||||
TypeDataChanged(typeInst, true);
|
||||
TypeMethodSignaturesChanged(typeInst);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2312,7 +2313,7 @@ void BfContext::UpdateRevisedTypes()
|
|||
if (isSignatureChange)
|
||||
{
|
||||
TypeDataChanged(typeInst, true);
|
||||
TypeMethodSignaturesChanged(typeInst);
|
||||
TypeMethodSignaturesChanged(typeInst);
|
||||
}
|
||||
|
||||
/*if (!mCompiler->mIsResolveOnly)
|
||||
|
|
|
@ -2712,6 +2712,11 @@ public:
|
|||
|
||||
void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine)
|
||||
{
|
||||
auto populateModule = mModule->mContext->mUnreifiedModule;
|
||||
auto typeInstance = type->ToTypeInstance();
|
||||
if (typeInstance != NULL)
|
||||
populateModule = typeInstance->mModule;
|
||||
|
||||
bool wantDIData = DbgHasInfo() && (!type->IsUnspecializedType());
|
||||
|
||||
// Types that don't have a proper 'defining module' need to be defined in every module they are used
|
||||
|
@ -2736,7 +2741,7 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine)
|
|||
bool isPrimEnum = (type->IsEnum()) && (type->IsTypedPrimitive());
|
||||
|
||||
if (!type->IsDeclared())
|
||||
mModule->PopulateType(type, BfPopulateType_Declaration);
|
||||
populateModule->PopulateType(type, BfPopulateType_Declaration);
|
||||
|
||||
BF_ASSERT(type->IsDeclared());
|
||||
|
||||
|
@ -2747,8 +2752,7 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine)
|
|||
BfIRType irType;
|
||||
BfIRMDNode diType;
|
||||
bool trackDIType = false;
|
||||
|
||||
BfTypeInstance* typeInstance = type->ToTypeInstance();
|
||||
|
||||
BfType* underlyingArrayType = NULL;
|
||||
int underlyingArraySize = -1;
|
||||
bool underlyingArrayIsVector = false;
|
||||
|
@ -2758,7 +2762,7 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine)
|
|||
if (type->IsPointer())
|
||||
{
|
||||
BfPointerType* pointerType = (BfPointerType*)type;
|
||||
mModule->PopulateType(pointerType->mElementType, BfPopulateType_Data);
|
||||
populateModule->PopulateType(pointerType->mElementType, BfPopulateType_Data);
|
||||
if (pointerType->mElementType->IsValuelessType())
|
||||
{
|
||||
irType = GetPrimitiveType(BfTypeCode_NullPtr);
|
||||
|
@ -3069,7 +3073,7 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine)
|
|||
}
|
||||
else if (type->IsTypedPrimitive())
|
||||
{
|
||||
mModule->PopulateType(type);
|
||||
populateModule->PopulateType(type);
|
||||
auto underlyingType = type->GetUnderlyingType();
|
||||
irType = MapType(underlyingType);
|
||||
SetType(type, irType);
|
||||
|
|
|
@ -3553,13 +3553,13 @@ bool CeContext::AddRebuild(const CeRebuildKey& key, const CeRebuildValue& value)
|
|||
{
|
||||
if (mCurModule == NULL)
|
||||
return false;
|
||||
if (mCurModule->mCurTypeInstance == NULL)
|
||||
if (mCallerTypeInstance == NULL)
|
||||
return false;
|
||||
if ((mCurEvalFlags & CeEvalFlags_NoRebuild) != 0)
|
||||
return false;
|
||||
if (mCurModule->mCurTypeInstance->mCeTypeInfo == NULL)
|
||||
mCurModule->mCurTypeInstance->mCeTypeInfo = new BfCeTypeInfo();
|
||||
mCurModule->mCurTypeInstance->mCeTypeInfo->mRebuildMap[key] = value;
|
||||
if (mCallerTypeInstance->mCeTypeInfo == NULL)
|
||||
mCallerTypeInstance->mCeTypeInfo = new BfCeTypeInfo();
|
||||
mCallerTypeInstance->mCeTypeInfo->mRebuildMap[key] = value;
|
||||
mCurModule->mCompiler->mHasComptimeRebuilds = true;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue