| 2831 | } |
| 2832 | |
| 2833 | void DbgModule::MapTypes(int startingTypeIdx) |
| 2834 | { |
| 2835 | BP_ZONE("DbgModule_MapTypes"); |
| 2836 | |
| 2837 | bool needsInnerFixups = false; |
| 2838 | for (int typeIdx = startingTypeIdx; typeIdx < (int)mTypes.size(); typeIdx++) |
| 2839 | { |
| 2840 | DbgType* dbgType = mTypes[typeIdx]; |
| 2841 | BF_ASSERT(dbgType->mTypeCode != DbgType_Null); |
| 2842 | |
| 2843 | if ((dbgType->mTypeCode == DbgType_Namespace) && (dbgType->mPriority < DbgTypePriority_Primary_Implicit)) |
| 2844 | continue; |
| 2845 | |
| 2846 | //TODO: Always valid? |
| 2847 | if (dbgType->mIsDeclaration) |
| 2848 | continue; |
| 2849 | |
| 2850 | // We were avoiding adding '<' names before, but that made it impossible to look up auto-named primary types , |
| 2851 | // like in-place unions like '<unnamed-type-u>' |
| 2852 | if ((dbgType->mTypeName == NULL) || (dbgType->mName == NULL) /*|| (dbgType->mTypeName[0] == '<')*/) |
| 2853 | continue; |
| 2854 | |
| 2855 | if (dbgType->mTypeCode > DbgType_DefinitionEnd) |
| 2856 | { |
| 2857 | // Only add "definition types" |
| 2858 | continue; |
| 2859 | } |
| 2860 | |
| 2861 | if (dbgType->mTypeCode == DbgType_Namespace) |
| 2862 | { |
| 2863 | bool isQualifiedNamespace = false; |
| 2864 | for (const char* cPtr = dbgType->mTypeName; *cPtr != '\0'; cPtr++) |
| 2865 | if (*cPtr == '.') |
| 2866 | isQualifiedNamespace = true; |
| 2867 | if (isQualifiedNamespace) |
| 2868 | continue; // Don't add fully qualified namespaces (they come from the 'using' implementation)* |
| 2869 | } |
| 2870 | |
| 2871 | if (dbgType->mHasStaticMembers) |
| 2872 | { |
| 2873 | for (auto member : dbgType->mMemberList) |
| 2874 | if ((member->mIsStatic) && (member->mLocationData != NULL)) |
| 2875 | dbgType->mDefinedMembersSize++; |
| 2876 | } |
| 2877 | |
| 2878 | if ((dbgType->mTypeName != NULL) && (strcmp(dbgType->mTypeName, "@") == 0)) |
| 2879 | { |
| 2880 | // Globals type. |
| 2881 | continue; |
| 2882 | } |
| 2883 | |
| 2884 | auto prevTypeEntry = FindType(dbgType->mName, dbgType->mLanguage); |
| 2885 | |
| 2886 | // Only replace previous instance if its a declaration |
| 2887 | if (prevTypeEntry != NULL) |
| 2888 | { |
| 2889 | auto prevType = prevTypeEntry->mValue; |
| 2890 | |