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
| 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 |
| 27333 | void 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 | |
| 27385 | void BfModule::DisownMethods() |
| 27386 | { |
no test coverage detected