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

Method MarkFieldInitialized

IDEHelper/Compiler/BfModule.cpp:4620–4644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4618}
4619
4620void BfModule::MarkFieldInitialized(BfFieldInstance* fieldInstance)
4621{
4622 BF_ASSERT(fieldInstance->mOwner == mCurTypeInstance);
4623
4624 auto fieldType = fieldInstance->GetResolvedType();
4625 if ((fieldInstance->mMergedDataIdx != -1) && (mCurMethodState != NULL))
4626 {
4627 int fieldIdx = 0;
4628 int fieldCount = 0;
4629 fieldInstance->GetDataRange(fieldIdx, fieldCount);
4630 fieldIdx--;
4631
4632 int count = fieldCount;
4633 if (fieldIdx == -1)
4634 count = 1;
4635
4636 //TODO: Under what circumstances could 'thisVariable' be NULL?
4637 auto thisVariable = GetThisVariable();
4638 if (thisVariable != NULL)
4639 {
4640 for (int i = 0; i < count; i++)
4641 mCurMethodState->LocalDefined(thisVariable, fieldIdx + i);
4642 }
4643 }
4644}
4645
4646bool BfModule::IsThreadLocal(BfFieldInstance * fieldInstance)
4647{

Callers

nothing calls this directly

Calls 3

GetResolvedTypeMethod · 0.80
GetDataRangeMethod · 0.80
LocalDefinedMethod · 0.80

Tested by

no test coverage detected