|
@@ -545,7 +545,7 @@ bool BfCompiler::IsTypeAccessible(BfType* checkType, BfProject* curProject)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-bool BfCompiler::IsTypeUsed(BfType* checkType, BfProject* curProject)
|
|
|
+bool BfCompiler::IsTypeUsed(BfType* checkType, BfProject* curProject, bool conservativeCheck)
|
|
|
{
|
|
|
if (mOptions.mCompileOnDemandKind == BfCompileOnDemandKind_AlwaysInclude)
|
|
|
return IsTypeAccessible(checkType, curProject);
|
|
@@ -561,17 +561,17 @@ bool BfCompiler::IsTypeUsed(BfType* checkType, BfProject* curProject)
|
|
|
// }
|
|
|
|
|
|
if (checkType->IsInterface())
|
|
|
- return typeInst->mIsReified;
|
|
|
+ return typeInst->mIsReified || conservativeCheck;
|
|
|
|
|
|
//TODO: We could check to see if this project has any reified specialized instances...
|
|
|
if (checkType->IsUnspecializedType())
|
|
|
- return typeInst->mIsReified;
|
|
|
+ return typeInst->mIsReified || conservativeCheck;
|
|
|
|
|
|
if (checkType->IsTuple())
|
|
|
{
|
|
|
for (auto&& fieldInst : typeInst->mFieldInstances)
|
|
|
{
|
|
|
- if (!IsTypeUsed(fieldInst.mResolvedType, curProject))
|
|
|
+ if (!IsTypeUsed(fieldInst.mResolvedType, curProject, true))
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -580,7 +580,7 @@ bool BfCompiler::IsTypeUsed(BfType* checkType, BfProject* curProject)
|
|
|
if (genericTypeInst != NULL)
|
|
|
{
|
|
|
for (auto genericArg : genericTypeInst->mGenericTypeInfo->mTypeGenericArguments)
|
|
|
- if (!IsTypeUsed(genericArg, curProject))
|
|
|
+ if (!IsTypeUsed(genericArg, curProject, true))
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -1264,8 +1264,9 @@ void BfCompiler::CreateVData(BfVDataModule* bfModule)
|
|
|
continue;
|
|
|
|
|
|
auto typeInst = type->ToTypeInstance();
|
|
|
+
|
|
|
if ((typeInst != NULL) && (!typeInst->IsReified()) && (!typeInst->IsUnspecializedType()))
|
|
|
- continue;
|
|
|
+ continue;
|
|
|
|
|
|
if (!IsTypeUsed(type, project))
|
|
|
continue;
|
|
@@ -1279,7 +1280,7 @@ void BfCompiler::CreateVData(BfVDataModule* bfModule)
|
|
|
{
|
|
|
auto module = typeInst->mModule;
|
|
|
if (module == NULL)
|
|
|
- continue;
|
|
|
+ continue;
|
|
|
|
|
|
if (type->IsEnum())
|
|
|
{
|