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

Method MapMethod

IDEHelper/Compiler/BfIRBuilder.cpp:5475–5498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5473}
5474
5475BfIRFunctionType 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
5500BfIRFunctionType BfIRBuilder::CreateFunctionType(BfIRType resultType, const BfSizedArray<BfIRType>& paramTypes, bool isVarArg)
5501{

Callers 5

EmitDtorBodyMethod · 0.80
SetupIRFunctionMethod · 0.80
CreateCallMethod · 0.80
GetLambdaInstanceMethod · 0.80

Calls 3

TryGetValueMethod · 0.80
GetIRFunctionInfoMethod · 0.80
IsVarArgsMethod · 0.80

Tested by

no test coverage detected