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

Method EmitIteratorBlock

IDEHelper/Compiler/BfModule.cpp:19735–19764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19733}
19734
19735void BfModule::EmitIteratorBlock(bool& skipBody)
19736{
19737 auto methodInstance = mCurMethodInstance;
19738 auto methodDef = methodInstance->mMethodDef;
19739 auto methodDeclaration = methodDef->GetMethodDeclaration();
19740 auto typeDef = mCurTypeInstance->mTypeDef;
19741
19742 BfType* innerRetType = NULL;
19743 BfTypeInstance* usingInterface = NULL;
19744
19745 auto retTypeInst = mCurMethodInstance->mReturnType->ToGenericTypeInstance();
19746 if (retTypeInst != NULL)
19747 {
19748 if ((retTypeInst->IsInstanceOf(mCompiler->mGenericIEnumerableTypeDef)) ||
19749 (retTypeInst->IsInstanceOf(mCompiler->mGenericIEnumeratorTypeDef)))
19750 {
19751 innerRetType = retTypeInst->mGenericTypeInfo->mTypeGenericArguments[0];
19752 }
19753 }
19754
19755 if (innerRetType == NULL)
19756 {
19757 Fail("Methods with yields must return either System.IEnumerable<T> or System.IEnumerator<T>", methodDeclaration->mReturnType);
19758 return;
19759 }
19760
19761 auto blockBody = BfNodeDynCast<BfBlock>(methodDeclaration->mBody);
19762 if (blockBody == NULL)
19763 return;
19764}
19765
19766void BfModule::EmitGCMarkAppended(BfTypedValue markVal)
19767{

Callers

nothing calls this directly

Calls 4

FailFunction · 0.85
GetMethodDeclarationMethod · 0.80
ToGenericTypeInstanceMethod · 0.45
IsInstanceOfMethod · 0.45

Tested by

no test coverage detected