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

Method Init

IDEHelper/Compiler/BfModule.cpp:51–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49//////////////////////////////////////////////////////////////////////////
50
51void BfLocalVariable::Init()
52{
53 if (mResolvedType->IsValuelessType())
54 {
55 mAssignedKind = BfLocalVarAssignKind_Unconditional;
56 return;
57 }
58
59 if (mAssignedKind != BfLocalVarAssignKind_None)
60 return;
61
62 bool isStruct = mResolvedType->IsStruct();
63 if (mResolvedType->IsRef())
64 isStruct = mResolvedType->GetUnderlyingType()->IsStruct();
65
66 if ((isStruct) || ((mIsThis) && (mResolvedType->IsStructOrStructPtr())))
67 {
68 auto resolvedTypeRef = mResolvedType;
69 if ((resolvedTypeRef->IsPointer()) || (resolvedTypeRef->IsRef()))
70 resolvedTypeRef = resolvedTypeRef->GetUnderlyingType();
71 auto typeInstance = resolvedTypeRef->ToTypeInstance();
72 mUnassignedFieldFlags = (1 << typeInstance->mMergedFieldDataCount) - 1;
73 if ((mIsThis) && (typeInstance->mBaseType != NULL))
74 {
75 // Base ctor is responsible for initializing its own fields
76 mUnassignedFieldFlags &= ~(((int64)1 << typeInstance->mBaseType->mMergedFieldDataCount) - 1);
77 }
78 if (mUnassignedFieldFlags == 0)
79 mAssignedKind = BfLocalVarAssignKind_Unconditional;
80 }
81 else
82 {
83 mUnassignedFieldFlags = 1;
84 }
85}
86
87BfLocalMethod::~BfLocalMethod()
88{

Callers 15

AppendedObjectInitMethod · 0.45
AllocBytesMethod · 0.45
AllocFromTypeMethod · 0.45
GetCustomAttributesMethod · 0.45
GetMethodInstanceMethod · 0.45
CreateOutVariableMethod · 0.45
CallBaseCtorCalcMethod · 0.45
EmitCtorBodyMethod · 0.45

Calls 10

ContainsReferenceMethod · 0.80
IsValuelessTypeMethod · 0.45
IsStructMethod · 0.45
IsRefMethod · 0.45
GetUnderlyingTypeMethod · 0.45
IsStructOrStructPtrMethod · 0.45
IsPointerMethod · 0.45
ToTypeInstanceMethod · 0.45
RemoveMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected