| 9227 | } |
| 9228 | |
| 9229 | BfGenericParamType* BfModule::GetGenericParamType(BfGenericParamKind paramKind, int paramIdx) |
| 9230 | { |
| 9231 | if (paramIdx < (int)mContext->mGenericParamTypes[paramKind].size()) |
| 9232 | { |
| 9233 | auto genericParamType = mContext->mGenericParamTypes[paramKind][paramIdx]; |
| 9234 | return genericParamType; |
| 9235 | } |
| 9236 | |
| 9237 | auto genericParamType = new BfGenericParamType(); |
| 9238 | |
| 9239 | genericParamType->mContext = mContext; |
| 9240 | genericParamType->mGenericParamKind = paramKind; |
| 9241 | genericParamType->mGenericParamIdx = paramIdx; |
| 9242 | |
| 9243 | PopulateType(genericParamType); |
| 9244 | |
| 9245 | BF_ASSERT(paramIdx == (int)mContext->mGenericParamTypes[paramKind].size()); |
| 9246 | mContext->mGenericParamTypes[paramKind].push_back(genericParamType); |
| 9247 | |
| 9248 | BfResolvedTypeSet::LookupContext lookupCtx; |
| 9249 | lookupCtx.mModule = this; |
| 9250 | BfResolvedTypeSet::EntryRef typeEntry; |
| 9251 | auto inserted = mContext->mResolvedTypes.Insert(genericParamType, &lookupCtx, &typeEntry); |
| 9252 | BF_ASSERT(inserted); |
| 9253 | typeEntry->mValue = genericParamType; |
| 9254 | |
| 9255 | return genericParamType; |
| 9256 | } |
| 9257 | |
| 9258 | static int sValueFromExprIdx = 0; |
| 9259 |
no test coverage detected