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

Method CheckInternalProtection

IDEHelper/Compiler/BfModule.cpp:4092–4121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4090}
4091
4092bool BfModule::CheckInternalProtection(BfTypeDef* usingTypeDef)
4093{
4094 if ((mCurTypeInstance != NULL) && (mCurTypeInstance->IsSpecializedType()))
4095 return true;
4096 if ((mCurMethodInstance != NULL) &&
4097 ((mCurMethodInstance->mIsUnspecializedVariation) || (mCurMethodInstance->IsSpecializedGenericMethod())))
4098 return true;
4099
4100 auto internalAccessSet = GetInternalAccessSet();
4101 if (internalAccessSet == NULL)
4102 return false;
4103
4104 for (auto& nameComposite : internalAccessSet->mNamespaces)
4105 {
4106 if (usingTypeDef->mNamespace.StartsWith(nameComposite))
4107 return true;
4108 }
4109
4110 for (auto internalType : internalAccessSet->mTypes)
4111 {
4112 auto checkTypeDef = usingTypeDef->GetDefinition();
4113 while (checkTypeDef != NULL)
4114 {
4115 if (checkTypeDef == internalType->mTypeDef->GetDefinition())
4116 return true;
4117 checkTypeDef = checkTypeDef->mOuterType;
4118 }
4119 }
4120 return false;
4121}
4122
4123void PrintUsers(llvm::MDNode* md);
4124

Callers

nothing calls this directly

Calls 4

GetDefinitionMethod · 0.80
IsSpecializedTypeMethod · 0.45
StartsWithMethod · 0.45

Tested by

no test coverage detected