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

Method ClearModuleData

IDEHelper/Compiler/BfModule.cpp:27333–27383  ·  view source on GitHub ↗

ClearModuleData is called immediately after the module is compiled, so don't clear out any data that needs to be transient through the next compile

Source from the content-addressed store, hash-verified

27331// ClearModuleData is called immediately after the module is compiled, so don't clear out any data that needs to
27332// be transient through the next compile
27333void BfModule::ClearModuleData(bool clearTransientData)
27334{
27335 BfLogSysM("ClearModuleData %p\n", this);
27336
27337 if (mAddedToCount)
27338 {
27339 mCompiler->mStats.mModulesFinished++;
27340 mAddedToCount = false;
27341 }
27342
27343 mDICompileUnit = BfIRMDNode();
27344 if (clearTransientData)
27345 mIncompleteMethodCount = 0;
27346 mHasGenericMethods = false;
27347
27348 // We don't want to clear these because we want it to persist through module extensions-
27349 // otherwise we may think an extension succeeds even though the base module failed
27350 //mHadBuildError = false;
27351 //mHadBuildWarning = false;
27352
27353 mClassVDataRefs.Clear();
27354 mClassVDataExtRefs.Clear();
27355 for (auto& kv : mTypeDataRefs)
27356 kv.mValue = BfIRValue();
27357 mStringCharPtrPool.Clear();
27358 mStringObjectPool.Clear();
27359 mStaticFieldRefs.Clear();
27360 BF_ASSERT(!mIgnoreErrors);
27361
27362 for (auto prevIRBuilder : mPrevIRBuilders)
27363 delete prevIRBuilder;
27364 mPrevIRBuilders.Clear();
27365
27366 for (auto& specPair : mSpecializedMethodModules)
27367 {
27368 auto specModule = specPair.mValue;
27369 specModule->ClearModuleData();
27370 }
27371
27372 for (int i = 0; i < BfBuiltInFuncType_Count; i++)
27373 mBuiltInFuncs[i] = BfIRFunction();
27374
27375 if (mNextAltModule != NULL)
27376 mNextAltModule->ClearModuleData();
27377
27378 BfLogSysM("ClearModuleData. Deleting IRBuilder: %p\n", mBfIRBuilder);
27379 mIsModuleMutable = false;
27380 delete mBfIRBuilder;
27381 mBfIRBuilder = NULL;
27382 mWantsIRIgnoreWrites = false;
27383}
27384
27385void BfModule::DisownMethods()
27386{

Callers 2

ProcessWorkListMethod · 0.80
DoCompileMethod · 0.80

Calls 4

BfIRMDNodeClass · 0.85
BfIRValueClass · 0.85
BfIRFunctionClass · 0.85
ClearMethod · 0.45

Tested by

no test coverage detected