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

Method GetUnderlyingArray

IDEHelper/Compiler/BfResolvedTypeUtils.cpp:2069–2090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2067}
2068
2069void BfTypeInstance::GetUnderlyingArray(BfType*& type, int& size, bool& isVector)
2070{
2071 if (mCustomAttributes == NULL)
2072 return;
2073 auto attributes = mCustomAttributes->Get(mModule->mCompiler->mUnderlyingArrayAttributeTypeDef);
2074 if (attributes == NULL)
2075 return;
2076 if (attributes->mCtorArgs.size() != 3)
2077 return;
2078
2079 auto typeConstant = mConstHolder->GetConstant(attributes->mCtorArgs[0]);
2080 auto sizeConstant = mConstHolder->GetConstant(attributes->mCtorArgs[1]);
2081 auto isVectorConstant = mConstHolder->GetConstant(attributes->mCtorArgs[2]);
2082 if ((typeConstant == NULL) || (sizeConstant == NULL) || (isVectorConstant == NULL))
2083 return;
2084 if (typeConstant->mConstType != BfConstType_TypeOf)
2085 return;
2086
2087 type = (BfType*)(intptr)typeConstant->mInt64;
2088 size = sizeConstant->mInt32;
2089 isVector = isVectorConstant->mBool;
2090}
2091
2092bool BfTypeInstance::GetLoweredType(BfTypeUsage typeUsage, BfTypeCode* outTypeCode, BfTypeCode* outTypeCode2)
2093{

Callers 3

CreateTypeDeclarationMethod · 0.80
CreateTypeDefinitionMethod · 0.80

Calls 3

GetMethod · 0.45
sizeMethod · 0.45
GetConstantMethod · 0.45

Tested by

no test coverage detected