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

Method CheckMethod

IDEHelper/DbgExprEvaluator.cpp:305–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303}
304
305bool DwMethodMatcher::CheckMethod(DbgType* typeInstance, DbgSubprogram* checkMethod)
306{
307 bool hadMatch = false;
308
309 checkMethod->PopulateSubprogram();
310
311 // Never consider overrides - they only get found at original method declaration
312 /*if ((checkMethod->mVirtual) && (checkMethod->mVTableLoc == -1))
313 return true;*/
314
315 //BfMethodInstance* methodInstance = mModule->GetRawMethodInstanceAtIdx(typeInstance, checkMethod->mIdx);
316 DbgSubprogram* methodInstance = checkMethod;
317
318 DwAutoComplete* autoComplete = mExprEvaluator->mAutoComplete;
319 if ((autoComplete != NULL) && (autoComplete->mIsCapturingMethodMatchInfo))
320 {
321 DwAutoComplete::MethodMatchEntry methodMatchEntry;
322 methodMatchEntry.mDwSubprogram = methodInstance;
323 autoComplete->mMethodMatchInfo->mInstanceList.push_back(methodMatchEntry);
324 }
325
326 /*if ((mHadExplicitGenericArguments) && (checkMethod->mGenericParams.size() != mBestMethodGenericArguments.size()))
327 goto NoMatch;*/
328
329 for (auto& checkGenericArgRef : mCheckMethodGenericArguments)
330 checkGenericArgRef = NULL;
331
332 /*mCheckMethodGenericArguments.resize(checkMethod->mGenericParams.size());
333 for (auto& genericArgRef : mCheckMethodGenericArguments)
334 genericArgRef = NULL;*/
335
336 int argIdx = 0;
337 int paramIdx = 0;
338 DbgType* paramsElementType = NULL;
339
340 //bool needInferGenericParams = (checkMethod->mGenericParams.size() != 0) && (!mHadExplicitGenericArguments);
341
342 DwTypeVector* genericArgumentsSubstitute = NULL;
343 /*if (mHadExplicitGenericArguments)
344 genericArgumentsSubstitute = &mBestMethodGenericArguments;
345 else if (needInferGenericParams)
346 genericArgumentsSubstitute = &mCheckMethodGenericArguments;
347
348 if (needInferGenericParams)
349 {
350 for (int argIdx = 0; argIdx < (int)mArguments.size(); argIdx++)
351 {
352 if (argIdx >= (int)checkMethod->mParams.size())
353 break;
354 auto wantType = methodInstance->mParamTypes[argIdx];
355 if (wantType->IsUnspecializedType())
356 {
357 if (!InferGenericArgument(mArguments[argIdx].mType, wantType))
358 goto NoMatch;
359 }
360 }
361
362 for (int checkArgIdx = 0; checkArgIdx < (int) checkMethod->mGenericParams.size(); checkArgIdx++)

Callers

nothing calls this directly

Calls 9

PopulateSubprogramMethod · 0.45
push_backMethod · 0.45
SizeMethod · 0.45
sizeMethod · 0.45
CanCastMethod · 0.45
EqualsMethod · 0.45
FailMethod · 0.45
c_strMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected