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

Method GetDiscriminatorType

IDEHelper/Compiler/BfResolvedTypeUtils.cpp:2049–2067  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2047}
2048
2049BfPrimitiveType* BfTypeInstance::GetDiscriminatorType(int* outDataIdx)
2050{
2051 BF_ASSERT(IsPayloadEnum());
2052 auto& fieldInstance = mFieldInstances.back();
2053 BF_ASSERT(fieldInstance.GetFieldDef() == NULL);
2054
2055 if (fieldInstance.mResolvedType == NULL)
2056 {
2057 BF_ASSERT(IsIncomplete());
2058 // Use Int64 as a placeholder until we determine the correct type...
2059 return mModule->GetPrimitiveType(BfTypeCode_Int64);
2060 }
2061
2062 BF_ASSERT(fieldInstance.mResolvedType != NULL);
2063 BF_ASSERT(fieldInstance.mResolvedType->IsPrimitiveType());
2064 if (outDataIdx != NULL)
2065 *outDataIdx = fieldInstance.mDataIdx;
2066 return (BfPrimitiveType*)fieldInstance.mResolvedType;
2067}
2068
2069void BfTypeInstance::GetUnderlyingArray(BfType*& type, int& size, bool& isVector)
2070{

Callers 15

TryCaseEnumMatchMethod · 0.80
VisitMethod · 0.80
CreateTypeDataMethod · 0.80
AggregateSplatMethod · 0.80
ExtractValueMethod · 0.80
EmitEnumToStringBodyMethod · 0.80
ProcessMethodMethod · 0.80
SplatIterateMethod · 0.80
DoCaseExpressionMethod · 0.80

Calls 4

GetFieldDefMethod · 0.80
backMethod · 0.45
GetPrimitiveTypeMethod · 0.45
IsPrimitiveTypeMethod · 0.45

Tested by

no test coverage detected