mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Extension inner type visibility fix
This commit is contained in:
parent
fb3cd1ac83
commit
69fab22a39
6 changed files with 43 additions and 8 deletions
|
@ -7027,6 +7027,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
String toolsetErrors;
|
||||
for (auto project : mSystem->mProjects)
|
||||
{
|
||||
project->mDependencySet.Clear();
|
||||
if (project->mDisabled)
|
||||
continue;
|
||||
if (project->mCodeGenOptions.mLTOType != BfLTOType_None)
|
||||
|
|
|
@ -2629,6 +2629,23 @@ BfProjectSet* BfModule::GetVisibleProjectSet()
|
|||
return &mCurMethodState->mVisibleProjectSet;
|
||||
}
|
||||
|
||||
bool BfModule::IsProjectVisible(BfProject* project)
|
||||
{
|
||||
auto visibleProjectSet = GetVisibleProjectSet();
|
||||
if (visibleProjectSet != NULL)
|
||||
return visibleProjectSet->Contains(project);
|
||||
|
||||
auto activeTypeDef = GetActiveTypeDef();
|
||||
if (activeTypeDef != NULL)
|
||||
{
|
||||
if (activeTypeDef->mProject == project)
|
||||
return true;
|
||||
return activeTypeDef->mProject->HasDependency(project);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
BfFileInstance* BfModule::GetFileFromNode(BfAstNode* astNode)
|
||||
{
|
||||
auto bfParser = astNode->GetSourceData()->ToParserData();
|
||||
|
|
|
@ -1698,6 +1698,7 @@ public:
|
|||
BfIRValue ValueScopeStart();
|
||||
void ValueScopeEnd(BfIRValue valueScopeStart);
|
||||
BfProjectSet* GetVisibleProjectSet();
|
||||
bool IsProjectVisible(BfProject* project);
|
||||
|
||||
void AddBasicBlock(BfIRBlock bb, bool activate = true);
|
||||
void VisitEmbeddedStatement(BfAstNode* stmt, BfExprEvaluator* exprEvaluator = NULL, BfEmbeddedStatementFlags flags = BfEmbeddedStatementFlags_None);
|
||||
|
|
|
@ -8548,12 +8548,8 @@ BfType* BfModule::ResolveInnerType(BfType* outerType, BfAstNode* typeRef, BfPopu
|
|||
(!CheckProtection(latestCheckType->mProtection, latestCheckType, allowProtected, allowPrivate)))
|
||||
continue;
|
||||
|
||||
if (checkType->mProject != checkOuterType->mTypeDef->mProject)
|
||||
{
|
||||
auto visibleProjectSet = GetVisibleProjectSet();
|
||||
if ((visibleProjectSet == NULL) || (!visibleProjectSet->Contains(checkType->mProject)))
|
||||
continue;
|
||||
}
|
||||
if ((checkType->mProject != checkOuterType->mTypeDef->mProject) && (!IsProjectVisible(checkType->mProject)))
|
||||
continue;
|
||||
|
||||
if ((checkType->mName->mString == findName) && (checkType->GetSelfGenericParamCount() == numGenericArgs))
|
||||
{
|
||||
|
|
|
@ -1113,6 +1113,24 @@ bool BfProject::IsTestProject()
|
|||
return mTargetType == BfTargetType_BeefTest;
|
||||
}
|
||||
|
||||
bool BfProject::HasDependency(BfProject* project)
|
||||
{
|
||||
if (mDependencySet.IsEmpty())
|
||||
{
|
||||
auto _AddProject = [&](BfProject* addProject)
|
||||
{
|
||||
if (mDependencySet.Add(addProject))
|
||||
{
|
||||
for (auto dep : addProject->mDependencies)
|
||||
mDependencySet.Add(dep);
|
||||
}
|
||||
};
|
||||
_AddProject(this);
|
||||
|
||||
}
|
||||
return mDependencySet.Contains(project);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BfErrorBase::~BfErrorBase()
|
||||
|
|
|
@ -1422,6 +1422,7 @@ public:
|
|||
|
||||
HashSet<BfModule*> mUsedModules;
|
||||
HashSet<BfType*> mReferencedTypeData;
|
||||
HashSet<BfProject*> mDependencySet;
|
||||
|
||||
Val128 mBuildConfigHash;
|
||||
Val128 mVDataConfigHash;
|
||||
|
@ -1435,6 +1436,7 @@ public:
|
|||
bool ContainsReference(BfProject* refProject);
|
||||
bool ReferencesOrReferencedBy(BfProject* refProject);
|
||||
bool IsTestProject();
|
||||
bool HasDependency(BfProject* project);
|
||||
};
|
||||
|
||||
//CDH TODO move these out to separate header if list gets big/unwieldy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue