| 5473 | } |
| 5474 | |
| 5475 | BfIRFunctionType BfIRBuilder::MapMethod(BfMethodInstance* methodInstance) |
| 5476 | { |
| 5477 | if (mIgnoreWrites) |
| 5478 | return GetFakeFunctionType(); |
| 5479 | |
| 5480 | bool useCache = (!mModule->mIsSpecialModule) && (methodInstance->mMethodDef->mIdx >= 0); |
| 5481 | |
| 5482 | if (useCache) |
| 5483 | { |
| 5484 | BfIRFunctionType* funcType = NULL; |
| 5485 | if (mMethodTypeMap.TryGetValue(methodInstance, &funcType)) |
| 5486 | return *funcType; |
| 5487 | } |
| 5488 | |
| 5489 | BfIRType retType; |
| 5490 | SizedArray<BfIRType, 8> paramTypes; |
| 5491 | methodInstance->GetIRFunctionInfo(mModule, retType, paramTypes); |
| 5492 | |
| 5493 | auto funcType = CreateFunctionType(retType, paramTypes, methodInstance->IsVarArgs()); |
| 5494 | if (useCache) |
| 5495 | mMethodTypeMap[methodInstance] = funcType; |
| 5496 | |
| 5497 | return funcType; |
| 5498 | } |
| 5499 | |
| 5500 | BfIRFunctionType BfIRBuilder::CreateFunctionType(BfIRType resultType, const BfSizedArray<BfIRType>& paramTypes, bool isVarArg) |
| 5501 | { |
no test coverage detected