| 2067 | } |
| 2068 | |
| 2069 | void 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 | |
| 2092 | bool BfTypeInstance::GetLoweredType(BfTypeUsage typeUsage, BfTypeCode* outTypeCode, BfTypeCode* outTypeCode2) |
| 2093 | { |
no test coverage detected