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

Method GetParamName

IDEHelper/Compiler/BfResolvedTypeUtils.cpp:1164–1207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1162}
1163
1164void BfMethodInstance::GetParamName(int paramIdx, StringImpl& name, int& namePrefixCount)
1165{
1166 if (paramIdx == -1)
1167 {
1168 BF_ASSERT(!mMethodDef->mIsStatic);
1169 name = "this";
1170 return;
1171 }
1172
1173 if ((mMethodInfoEx != NULL) && (mMethodInfoEx->mClosureInstanceInfo != NULL) && (mMethodDef->mIsLocalMethod))
1174 {
1175 if (paramIdx < (int)mMethodInfoEx->mClosureInstanceInfo->mCaptureEntries.size())
1176 {
1177 name = mMethodInfoEx->mClosureInstanceInfo->mCaptureEntries[paramIdx].mName;
1178 return;
1179 }
1180 }
1181
1182 BfMethodParam* methodParam = &mParams[paramIdx];
1183 BfParameterDef* paramDef = mMethodDef->mParams[methodParam->mParamDefIdx];
1184 if (methodParam->mDelegateParamIdx != -1)
1185 {
1186 if (methodParam->mResolvedType->IsTuple())
1187 {
1188 auto tupleType = (BfTupleType*)methodParam->mResolvedType;
1189 auto& fieldInstance = tupleType->mFieldInstances[methodParam->mDelegateParamIdx];
1190 if (methodParam->mDelegateParamNameCombine)
1191 name = paramDef->mName + "__" + fieldInstance.GetFieldDef()->mName;
1192 else
1193 name = fieldInstance.GetFieldDef()->mName;
1194
1195 return;
1196 }
1197
1198 BfMethodInstance* invokeMethodInstance = methodParam->GetDelegateParamInvoke();
1199 if (methodParam->mDelegateParamNameCombine)
1200 name = paramDef->mName + "__" + invokeMethodInstance->GetParamName(methodParam->mDelegateParamIdx);
1201 else
1202 invokeMethodInstance->GetParamName(methodParam->mDelegateParamIdx, name, namePrefixCount);
1203 return;
1204 }
1205 name.Reference(paramDef->mName);
1206 namePrefixCount = paramDef->mNamePrefixCount;
1207}
1208
1209String BfMethodInstance::GetParamName(int paramIdx)
1210{

Callers 15

AddDeferredCallEntryMethod · 0.45
CreateTypeDataMethod · 0.45
MethodToStringMethod · 0.45
TryConstCalcAppendMethod · 0.45
SetupIRMethodMethod · 0.45
ProcessMethodMethod · 0.45
GetLocalMethodDefMethod · 0.45
DoMethodDeclarationMethod · 0.45
FixitAddConstructorMethod · 0.45
CastMethod · 0.45

Calls 5

GetFieldDefMethod · 0.80
sizeMethod · 0.45
IsTupleMethod · 0.45
ReferenceMethod · 0.45

Tested by

no test coverage detected