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

Method DbgCreateSubroutineType

IDEHelper/Compiler/BfIRBuilder.cpp:6164–6201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6162}
6163
6164BfIRMDNode BfIRBuilder::DbgCreateSubroutineType(BfMethodInstance* methodInstance)
6165{
6166 auto methodDef = methodInstance->mMethodDef;
6167 auto typeInstance = methodInstance->GetOwner();
6168
6169 SizedArray<BfIRMDNode, 32> diParams;
6170 diParams.push_back(DbgGetType(methodInstance->mReturnType));
6171
6172 BfType* thisType = NULL;
6173 if (!methodDef->mIsStatic)
6174 {
6175 BfType* thisType;
6176 thisType = typeInstance;
6177 if (!thisType->IsValuelessType())
6178 {
6179 BfType* thisPtrType = thisType;
6180 auto diType = DbgGetType(thisPtrType);
6181 if ((thisType->IsComposite()) && (!methodInstance->GetParamIsSplat(-1)))
6182 {
6183 diType = DbgCreatePointerType(diType);
6184 diType = DbgCreateArtificialType(diType);
6185 }
6186 diParams.push_back(diType);
6187 }
6188 }
6189
6190 for (int paramIdx = 0; paramIdx < methodInstance->GetParamCount(); paramIdx++)
6191 {
6192 bool isParamSkipped = methodInstance->IsParamSkipped(paramIdx);
6193 if (!isParamSkipped)
6194 {
6195 auto resolvedType = methodInstance->GetParamType(paramIdx);
6196 diParams.push_back(DbgGetType(resolvedType));
6197 }
6198 }
6199
6200 return DbgCreateSubroutineType(diParams);
6201}
6202
6203BfIRMDNode BfIRBuilder::DbgCreateSubroutineType(const BfSizedArray<BfIRMDNode>& elements)
6204{

Callers 4

EmitCtorBodyMethod · 0.80
ProcessMethodMethod · 0.80
DbgFinishMethod · 0.80
InjectMixinMethod · 0.80

Calls 8

GetParamIsSplatMethod · 0.80
IsParamSkippedMethod · 0.80
GetOwnerMethod · 0.45
push_backMethod · 0.45
IsValuelessTypeMethod · 0.45
IsCompositeMethod · 0.45
GetParamCountMethod · 0.45
GetParamTypeMethod · 0.45

Tested by

no test coverage detected