mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Lost changes
This commit is contained in:
parent
e6c4a95ccd
commit
8e9d7ed4c4
56 changed files with 1579 additions and 794 deletions
|
@ -341,11 +341,10 @@ BfCompiler::HotResolveData::~HotResolveData()
|
|||
|
||||
BfCompiler::BfCompiler(BfSystem* bfSystem, bool isResolveOnly)
|
||||
{
|
||||
//llvm::DebugFlag = true;
|
||||
|
||||
memset(&mStats, 0, sizeof(mStats));
|
||||
mCompletionPct = 0;
|
||||
mCanceling = false;
|
||||
mHasRequiredTypes = false;
|
||||
mNeedsFullRefresh = false;
|
||||
mFastFinish = false;
|
||||
mHasQueuedTypeRebuilds = false;
|
||||
|
@ -399,6 +398,7 @@ BfCompiler::BfCompiler(BfSystem* bfSystem, bool isResolveOnly)
|
|||
mDbgRawAllocDataTypeDef = NULL;
|
||||
mDeferredCallTypeDef = NULL;
|
||||
mDelegateTypeDef = NULL;
|
||||
mFunctionTypeDef = NULL;
|
||||
mActionTypeDef = NULL;
|
||||
mEnumTypeDef = NULL;
|
||||
mFriendAttributeTypeDef = NULL;
|
||||
|
@ -406,8 +406,7 @@ BfCompiler::BfCompiler(BfSystem* bfSystem, bool isResolveOnly)
|
|||
mConstEvalAttributeTypeDef = NULL;
|
||||
mNoExtensionAttributeTypeDef = NULL;
|
||||
mCheckedAttributeTypeDef = NULL;
|
||||
mUncheckedAttributeTypeDef = NULL;
|
||||
mFunctionTypeDef = NULL;
|
||||
mUncheckedAttributeTypeDef = NULL;
|
||||
mGCTypeDef = NULL;
|
||||
mGenericIEnumerableTypeDef = NULL;
|
||||
mGenericIEnumeratorTypeDef = NULL;
|
||||
|
@ -2146,7 +2145,7 @@ void BfCompiler::UpdateDependencyMap(bool deleteUnusued, bool& didWork)
|
|||
madeFullPass = false;
|
||||
if ((mResolvePassData != NULL) && (mResolvePassData->mParser != NULL))
|
||||
madeFullPass = false;
|
||||
|
||||
|
||||
SetAndRestoreValue<bool> prevAssertOnPopulateType(mContext->mAssertOnPopulateType, deleteUnusued && madeFullPass);
|
||||
|
||||
if ((deleteUnusued) && (madeFullPass))
|
||||
|
@ -5107,6 +5106,18 @@ void BfCompiler::MarkStringPool(BfModule* module)
|
|||
stringPoolEntry.mLastUsedRevision = mRevision;
|
||||
}
|
||||
|
||||
for (int stringId : module->mUnreifiedStringPoolRefs)
|
||||
{
|
||||
BfStringPoolEntry& stringPoolEntry = module->mContext->mStringObjectIdMap[stringId];
|
||||
stringPoolEntry.mLastUsedRevision = mRevision;
|
||||
}
|
||||
|
||||
for (int stringId : module->mImportFileNames)
|
||||
{
|
||||
BfStringPoolEntry& stringPoolEntry = module->mContext->mStringObjectIdMap[stringId];
|
||||
stringPoolEntry.mLastUsedRevision = mRevision;
|
||||
}
|
||||
|
||||
/*if (module->mOptModule != NULL)
|
||||
MarkStringPool(module->mOptModule);*/
|
||||
auto altModule = module->mNextAltModule;
|
||||
|
@ -5220,7 +5231,7 @@ int BfCompiler::GetVTableMethodOffset()
|
|||
bool BfCompiler::DoWorkLoop(bool onlyReifiedTypes, bool onlyReifiedMethods)
|
||||
{
|
||||
bool hadAnyWork = false;
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
bool didWork = false;
|
||||
|
@ -6596,7 +6607,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
|
||||
BpEnter("Compile_Start");
|
||||
|
||||
bool hasRequiredTypes = true;
|
||||
mHasRequiredTypes = true;
|
||||
|
||||
//HashSet<BfTypeDef*> internalTypeDefs;
|
||||
|
||||
|
@ -6606,7 +6617,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
if (typeDef == NULL)
|
||||
{
|
||||
mPassInstance->Fail(StrFormat("Unable to find system type: %s", typeName.c_str()));
|
||||
hasRequiredTypes = false;
|
||||
mHasRequiredTypes = false;
|
||||
}
|
||||
return typeDef;
|
||||
};
|
||||
|
@ -6654,6 +6665,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
mDbgRawAllocDataTypeDef = _GetRequiredType("System.DbgRawAllocData");
|
||||
mDeferredCallTypeDef = _GetRequiredType("System.DeferredCall");
|
||||
mDelegateTypeDef = _GetRequiredType("System.Delegate");
|
||||
mFunctionTypeDef = _GetRequiredType("System.Function");
|
||||
mActionTypeDef = _GetRequiredType("System.Action");
|
||||
mEnumTypeDef = _GetRequiredType("System.Enum");
|
||||
mFriendAttributeTypeDef = _GetRequiredType("System.FriendAttribute");
|
||||
|
@ -6662,8 +6674,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
mNoExtensionAttributeTypeDef = _GetRequiredType("System.NoExtensionAttribute");
|
||||
mCheckedAttributeTypeDef = _GetRequiredType("System.CheckedAttribute");
|
||||
mUncheckedAttributeTypeDef = _GetRequiredType("System.UncheckedAttribute");
|
||||
mResultTypeDef = _GetRequiredType("System.Result", 1);
|
||||
mFunctionTypeDef = _GetRequiredType("System.Function");
|
||||
mResultTypeDef = _GetRequiredType("System.Result", 1);
|
||||
mGCTypeDef = _GetRequiredType("System.GC");
|
||||
mGenericIEnumerableTypeDef = _GetRequiredType("System.Collections.IEnumerable", 1);
|
||||
mGenericIEnumeratorTypeDef = _GetRequiredType("System.Collections.IEnumerator", 1);
|
||||
|
@ -6722,21 +6733,17 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
mContext->mBfTypeType = NULL;
|
||||
mContext->mBfClassVDataPtrType = NULL;
|
||||
|
||||
if (!hasRequiredTypes)
|
||||
{
|
||||
// Force rebuilding
|
||||
BfLogSysM("Compile missing required types\n");
|
||||
mInInvalidState = true;
|
||||
mOptions.mForceRebuildIdx++;
|
||||
return true;
|
||||
}
|
||||
if (!mHasRequiredTypes)
|
||||
{
|
||||
// Force rebuilding
|
||||
BfLogSysM("Compile missing required types\n");
|
||||
mOptions.mForceRebuildIdx++;
|
||||
}
|
||||
|
||||
mSystem->CheckLockYield();
|
||||
|
||||
mContext->mScratchModule->ResolveTypeDef(mBfObjectTypeDef);
|
||||
VisitSourceExteriorNodes();
|
||||
|
||||
//BF_ASSERT(hasRequiredTypes);
|
||||
VisitSourceExteriorNodes();
|
||||
|
||||
if (!mIsResolveOnly)
|
||||
{
|
||||
|
@ -6811,19 +6818,14 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
|
||||
if (mIsResolveOnly)
|
||||
VisitAutocompleteExteriorIdentifiers();
|
||||
|
||||
if (!hasRequiredTypes)
|
||||
{
|
||||
BfLogSysM("Missing required types\n");
|
||||
}
|
||||
|
||||
|
||||
mStats.mTypesQueued = 0;
|
||||
mStats.mMethodsQueued = 0;
|
||||
|
||||
mStats.mTypesQueued += (int)mContext->mPopulateTypeWorkList.size();
|
||||
mStats.mMethodsQueued += (int)mContext->mMethodWorkList.size();
|
||||
|
||||
if (hasRequiredTypes)
|
||||
//
|
||||
{
|
||||
mContext->mScratchModule->ResolveTypeDef(mBfObjectTypeDef, BfPopulateType_Full);
|
||||
|
||||
|
@ -6864,9 +6866,8 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hasRequiredTypes)
|
||||
ProcessPurgatory(true);
|
||||
|
||||
ProcessPurgatory(true);
|
||||
|
||||
// Mark used modules
|
||||
if ((mOptions.mCompileOnDemandKind != BfCompileOnDemandKind_AlwaysInclude) && (!mCanceling))
|
||||
|
@ -6967,7 +6968,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
}
|
||||
|
||||
// Generate slot nums
|
||||
if ((!mIsResolveOnly) && (hasRequiredTypes) && (!mCanceling))
|
||||
if ((!mIsResolveOnly) && (!mCanceling))
|
||||
{
|
||||
if ((!IsHotCompile()) || (mHotState->mHasNewInterfaceTypes))
|
||||
{
|
||||
|
@ -6996,7 +6997,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DoWorkLoop();
|
||||
|
||||
BfLogSysM("Compile QueueUnused\n");
|
||||
|
@ -7098,13 +7099,12 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
{
|
||||
DoWorkLoop();
|
||||
}
|
||||
|
||||
if (hasRequiredTypes)
|
||||
ProcessPurgatory(false);
|
||||
|
||||
ProcessPurgatory(false);
|
||||
|
||||
// Old Mark used modules
|
||||
|
||||
if ((!mIsResolveOnly) && (hasRequiredTypes))
|
||||
if (!mIsResolveOnly)
|
||||
{
|
||||
// if ((!mPassInstance->HasFailed()) && (!mCanceling))
|
||||
// {
|
||||
|
@ -7161,7 +7161,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
|
||||
String moduleListStr;
|
||||
int numModulesWritten = 0;
|
||||
if ((hasRequiredTypes) && (!mCanceling))
|
||||
if (!mCanceling)
|
||||
{
|
||||
if (!mIsResolveOnly)
|
||||
{
|
||||
|
@ -7250,9 +7250,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
//printf("Compile done, waiting for finish\n");
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (!hasRequiredTypes)
|
||||
break;
|
||||
{
|
||||
if (mCanceling)
|
||||
mCodeGen.Cancel();
|
||||
bool isDone = mCodeGen.Finish();
|
||||
|
@ -7391,8 +7389,8 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
// gBEMemReporter.Report();
|
||||
// int memReporterSize = gBEMemReporterSize;
|
||||
|
||||
mLastRevisionAborted = mCanceling || !hasRequiredTypes;
|
||||
bool didCancel = mCanceling && hasRequiredTypes;
|
||||
mLastRevisionAborted = mCanceling;
|
||||
bool didCancel = mCanceling;
|
||||
mCanceling = false;
|
||||
|
||||
mContext->ValidateDependencies();
|
||||
|
@ -8961,9 +8959,10 @@ BF_EXPORT const char* BF_CALLTYPE BfCompiler_GetTypeInfo(BfCompiler* bfCompiler,
|
|||
SetAndRestoreValue<bool> prevIgnoreWarnings(bfCompiler->mContext->mScratchModule->mIgnoreWarnings, true);
|
||||
SetAndRestoreValue<BfResolvePassData*> prevResolvePass(bfCompiler->mResolvePassData, &resolvePass);
|
||||
|
||||
auto type = bfCompiler->mContext->mScratchModule->ResolveTypeRef(typeRef, BfPopulateType_Data, BfResolveTypeRefFlag_NoCreate);
|
||||
auto type = bfCompiler->mContext->mScratchModule->ResolveTypeRef(typeRef, BfPopulateType_Identity, BfResolveTypeRefFlag_NoCreate);
|
||||
if (type != NULL)
|
||||
{
|
||||
bfCompiler->mContext->mScratchModule->PopulateType(type);
|
||||
outString += "Found";
|
||||
if (auto typeInst = type->ToTypeInstance())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue