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

Method RemoveMethod

IDEHelper/Compiler/CeMachine.cpp:9744–9790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9742}
9743
9744void CeMachine::RemoveMethod(BfMethodInstance* methodInstance)
9745{
9746 BfLogSys(methodInstance->GetOwner()->mModule->mSystem, "CeMachine::RemoveMethod %p\n", methodInstance);
9747
9748 mMethodBindRevision++;
9749
9750 auto itr = mFunctions.Find(methodInstance);
9751 auto ceFunctionInfo = itr->mValue;
9752 BF_ASSERT(itr != mFunctions.end());
9753 if (itr != mFunctions.end())
9754 {
9755 if (ceFunctionInfo->mMethodInstance == methodInstance)
9756 {
9757 auto ceFunction = ceFunctionInfo->mCeFunction;
9758 for (auto& callEntry : ceFunction->mCallTable)
9759 {
9760 if (callEntry.mFunctionInfo != NULL)
9761 DerefMethodInfo(callEntry.mFunctionInfo);
9762 }
9763 if (ceFunction->mId != -1)
9764 {
9765 RemoveFunc(ceFunction);
9766 for (auto innerFunction : ceFunction->mInnerFunctions)
9767 RemoveFunc(innerFunction);
9768 }
9769
9770 delete ceFunction;
9771 ceFunctionInfo->mCeFunction = NULL;
9772 ceFunctionInfo->mMethodInstance = NULL;
9773
9774 if (methodInstance->mMethodDef->mIsLocalMethod)
9775 {
9776 // We can't rebuild these anyway
9777 }
9778 else if (ceFunctionInfo->mRefCount > 1)
9779 {
9780 // Generate a methodref
9781 ceFunctionInfo->mMethodRef = methodInstance;
9782 }
9783
9784 DerefMethodInfo(ceFunctionInfo);
9785 }
9786
9787 mFunctions.Remove(itr);
9788 }
9789 methodInstance->mInCEMachine = false;
9790}
9791
9792CeErrorKind CeMachine::WriteConstant(CeConstStructData& data, BeConstant* constVal, CeContext* ceContext, CeBuilder* ceBuilder)
9793{

Callers 2

DeleteTypeMethod · 0.80
DisposeMethod · 0.80

Calls 4

GetOwnerMethod · 0.45
FindMethod · 0.45
endMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected