MCPcopy Create free account
hub / github.com/beefytech/Beef / UpdateRevisedTypes

Method UpdateRevisedTypes

IDEHelper/Compiler/BfCompiler.cpp:3120–3877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3118}
3119
3120void BfCompiler::UpdateRevisedTypes()
3121{
3122 BfLogSysM("BfCompiler::UpdateRevisedTypes\n");
3123 BP_ZONE("BfCompiler::UpdateRevisedTypes");
3124
3125 // See if we have any name conflicts and remove those
3126 auto typeDefItr = mSystem->mTypeDefs.begin();
3127 while (typeDefItr != mSystem->mTypeDefs.end())
3128 {
3129 auto typeDef = *typeDefItr;
3130 auto origTypeDef = typeDef;
3131 if (typeDef->mNextRevision != NULL)
3132 typeDef = typeDef->mNextRevision;
3133 if (typeDef->mDupDetectedRevision == mRevision)
3134 {
3135 ++typeDefItr;
3136 continue;
3137 }
3138 typeDef->mDupDetectedRevision = -1;
3139
3140 if ((typeDef->mIsCombinedPartial) || (typeDef->mDefState == BfTypeDef::DefState_Deleted) || (typeDef->mTypeCode == BfTypeCode_Extension))
3141 {
3142 ++typeDefItr;
3143 continue;
3144 }
3145
3146 if ((!typeDef->IsGlobalsContainer()) && (mSystem->ContainsNamespace(typeDef->mFullName, typeDef->mProject)))
3147 {
3148 mPassInstance->Fail(StrFormat("The name '%s' is already defined to be a namespace name", typeDef->mFullName.ToString().c_str()), typeDef->mTypeDeclaration->mNameNode);
3149 }
3150
3151 bool removedElement = false;
3152 auto nextTypeDefItr = typeDefItr;
3153 nextTypeDefItr.MoveToNextHashMatch();
3154
3155 while (nextTypeDefItr)
3156 {
3157 auto nextTypeDef = *nextTypeDefItr;
3158 if (nextTypeDef->mNextRevision != NULL)
3159 nextTypeDef = nextTypeDef->mNextRevision;
3160 if ((nextTypeDef->mIsCombinedPartial) || (nextTypeDef->mDefState == BfTypeDef::DefState_Deleted) || (nextTypeDef->mTypeCode == BfTypeCode_Extension) ||
3161 (typeDef->mFullNameEx != nextTypeDef->mFullNameEx) || (typeDef->mGenericParamDefs.size() != nextTypeDef->mGenericParamDefs.size()))
3162 {
3163 nextTypeDefItr.MoveToNextHashMatch();
3164 continue;
3165 }
3166
3167 if ((typeDef->mIsPartial) && (nextTypeDef->mIsPartial) &&
3168 (!typeDef->IsGlobalsContainer()) &&
3169 (typeDef->mProject != nextTypeDef->mProject))
3170 {
3171 BfTypeDef* typeA = NULL;
3172 BfTypeDef* typeB = NULL;
3173 BfError* error = NULL;
3174
3175 if (typeDef->mProject->ReferencesOrReferencedBy(nextTypeDef->mProject))
3176 {
3177 typeA = typeDef;

Callers

nothing calls this directly

Calls 15

TypeToStringFunction · 0.85
ContainsNamespaceMethod · 0.80
MoreInfoMethod · 0.80
PreUpdateRevisedTypesMethod · 0.80
ParseAtomCompositeMethod · 0.80
GetLatestMethod · 0.80
NameEqualsMethod · 0.80
ContainsReferenceMethod · 0.80
TrackNameMethod · 0.80
RefMethod · 0.80
InjectNewRevisionMethod · 0.80

Tested by

no test coverage detected