///////////////////////////////////////////////////////////////////// Function returns reference type for the type
| 5 | ////////////////////////////////////////////////////////////////////////// |
| 6 | // Function returns reference type for the type |
| 7 | TypeInfo* CodeInfo::GetReferenceType(TypeInfo* type) |
| 8 | { |
| 9 | // If type already has reference type, return it |
| 10 | if(type->refType) |
| 11 | return type->refType; |
| 12 | |
| 13 | // Create new type |
| 14 | TypeInfo* newInfo = new TypeInfo(typeInfo.size(), NULL, type->refLevel + 1, 0, 1, type, TypeInfo::NULLC_PTR_TYPE); |
| 15 | newInfo->size = NULLC_PTR_SIZE; |
| 16 | |
| 17 | // Save it for future use |
| 18 | type->refType = newInfo; |
| 19 | |
| 20 | newInfo->dependsOnGeneric = type->dependsOnGeneric; |
| 21 | |
| 22 | typeInfo.push_back(newInfo); |
| 23 | return newInfo; |
| 24 | } |
| 25 | |
| 26 | // Function returns type that reference points to |
| 27 | TypeInfo* CodeInfo::GetDereferenceType(TypeInfo* type) |