MCPcopy Create free account
hub / github.com/WheretIB/nullc / GetReferenceType

Method GetReferenceType

NULLC/CodeInfo.cpp:7–24  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////// Function returns reference type for the type

Source from the content-addressed store, hash-verified

5//////////////////////////////////////////////////////////////////////////
6// Function returns reference type for the type
7TypeInfo* 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
27TypeInfo* CodeInfo::GetDereferenceType(TypeInfo* type)

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected