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

Method GetStructRetIdx

IDEHelper/Compiler/BfResolvedTypeUtils.cpp:971–995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969}
970
971int BfMethodInstance::GetStructRetIdx(bool forceStatic)
972{
973 if ((mReturnType->IsComposite()) && (!mReturnType->IsValuelessType()) && (!GetLoweredReturnType(NULL, NULL, forceStatic)) && (!mIsIntrinsic))
974 {
975 auto returnTypeInst = mReturnType->ToTypeInstance();
976 if ((returnTypeInst != NULL) && (returnTypeInst->mHasUnderlyingArray))
977 return -1;
978
979 auto thisType = mMethodInstanceGroup->mOwner;
980 if (thisType->mModule->mCompiler->mOptions.mPlatformType != BfPlatformType_Windows)
981 return 0;
982 if ((mMethodInfoEx != NULL) && (mMethodInfoEx->mClosureInstanceInfo != NULL) && (mMethodInfoEx->mClosureInstanceInfo->mThisOverride != NULL))
983 thisType = mMethodInfoEx->mClosureInstanceInfo->mThisOverride;
984
985 if ((!HasThis()) || (forceStatic))
986 return 0;
987 if (!thisType->IsValueType())
988 return 1;
989 if ((mMethodDef->mIsMutating) || (!thisType->IsSplattable()) || ((!AllowsSplatting(-1)) && (!thisType->GetLoweredType(BfTypeUsage_Parameter))))
990 return 1;
991 return 0;
992 }
993
994 return -1;
995}
996
997bool BfMethodInstance::HasSelf()
998{

Callers

nothing calls this directly

Calls 6

IsCompositeMethod · 0.45
IsValuelessTypeMethod · 0.45
ToTypeInstanceMethod · 0.45
IsValueTypeMethod · 0.45
IsSplattableMethod · 0.45
GetLoweredTypeMethod · 0.45

Tested by

no test coverage detected