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

Method GetBaseType

IDEHelper/DbgModule.cpp:1537–1574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1535}
1536
1537DbgType* DbgType::GetBaseType()
1538{
1539 auto primaryType = GetPrimaryType();
1540 if (primaryType != this)
1541 return primaryType->GetBaseType();
1542
1543 PopulateType();
1544 if (mBaseTypes.mHead == NULL)
1545 return NULL;
1546 if (GetLanguage() != DbgLanguage_Beef)
1547 return NULL;
1548 auto baseType = mBaseTypes.mHead->mBaseType;
1549 BF_ASSERT(!baseType->IsInterface());
1550
1551 if ((baseType == NULL) || (baseType->mPriority > DbgTypePriority_Normal))
1552 return baseType;
1553 baseType = mCompileUnit->mDbgModule->GetPrimaryType(baseType);
1554 mBaseTypes.mHead->mBaseType = baseType;
1555
1556 if (baseType->mIsDeclaration)
1557 {
1558 // That's no good, try to fix it up
1559 if (baseType->GetLanguage() == DbgLanguage_Beef)
1560 {
1561 if (baseType->GetBaseType() == NULL)
1562 {
1563 if (baseType->ToString() == "System.Function")
1564 {
1565 DbgBaseTypeEntry* baseTypeEntry = mCompileUnit->mDbgModule->mAlloc.Alloc<DbgBaseTypeEntry>();
1566 baseTypeEntry->mBaseType = mCompileUnit->mDbgModule->GetPrimitiveType(DbgType_IntPtr_Alias, DbgLanguage_Beef);
1567 baseType->mBaseTypes.PushBack(baseTypeEntry);
1568 }
1569 }
1570 }
1571 }
1572
1573 return baseType;
1574}
1575
1576DbgType* DbgType::GetRootBaseType()
1577{

Callers 6

CastMethod · 0.45
VisitMethod · 0.45
LookupSplatMemberMethod · 0.45
CreateCallMethod · 0.45
DbgTypedValueToStringMethod · 0.45
GetCompilerSettingsMethod · 0.45

Calls 6

GetPrimaryTypeMethod · 0.80
IsInterfaceMethod · 0.45
GetLanguageMethod · 0.45
ToStringMethod · 0.45
GetPrimitiveTypeMethod · 0.45
PushBackMethod · 0.45

Tested by

no test coverage detected