| 1535 | } |
| 1536 | |
| 1537 | DbgType* 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 | |
| 1576 | DbgType* DbgType::GetRootBaseType() |
| 1577 | { |
no test coverage detected