mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed hotswap error zeroing libs, fixed indexer type lookup errors
This commit is contained in:
parent
e2a6a122c4
commit
766b274426
4 changed files with 30 additions and 23 deletions
|
@ -14739,7 +14739,7 @@ void BeMCContext::Generate(BeFunction* function)
|
||||||
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
||||||
|
|
||||||
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
||||||
mDebugging = function->mName == "?Hey@Blurg@bf@@SAXXZ";
|
//mDebugging = function->mName == "?Hey@Blurg@bf@@SAXXZ";
|
||||||
//"?ColorizeCodeString@IDEUtils@IDE@bf@@SAXPEAVString@System@3@W4CodeKind@123@@Z";
|
//"?ColorizeCodeString@IDEUtils@IDE@bf@@SAXPEAVString@System@3@W4CodeKind@123@@Z";
|
||||||
//"?Main@Program@bf@@CAHPEAV?$Array1@PEAVString@System@bf@@@System@2@@Z";
|
//"?Main@Program@bf@@CAHPEAV?$Array1@PEAVString@System@bf@@@System@2@@Z";
|
||||||
|
|
||||||
|
|
|
@ -449,7 +449,7 @@ void BfCodeGenThread::RunLoop()
|
||||||
DoBfLog(2, "Generating obj %s\n", request->mOutFileName.c_str());
|
DoBfLog(2, "Generating obj %s\n", request->mOutFileName.c_str());
|
||||||
|
|
||||||
BeCOFFObject coffObject;
|
BeCOFFObject coffObject;
|
||||||
coffObject.mWriteToLib = (request->mOptions.mWriteToLib) && (!request->mOptions.mIsHotCompile);
|
coffObject.mWriteToLib = request->mOptions.mWriteToLib;
|
||||||
if (!coffObject.Generate(beIRCodeGen->mBeModule, objFileName))
|
if (!coffObject.Generate(beIRCodeGen->mBeModule, objFileName))
|
||||||
errorMsg = StrFormat("Failed to write object file: %s", objFileName.c_str());
|
errorMsg = StrFormat("Failed to write object file: %s", objFileName.c_str());
|
||||||
|
|
||||||
|
|
|
@ -3949,7 +3949,15 @@ void BfCompiler::ProcessAutocompleteTempType()
|
||||||
auto propDeclaration = BfNodeDynCast<BfPropertyDeclaration>(propDef->mFieldDeclaration);
|
auto propDeclaration = BfNodeDynCast<BfPropertyDeclaration>(propDef->mFieldDeclaration);
|
||||||
if (propDeclaration != NULL)
|
if (propDeclaration != NULL)
|
||||||
autoComplete->CheckProperty(propDeclaration);
|
autoComplete->CheckProperty(propDeclaration);
|
||||||
module->ResolveTypeRef(propDef->mTypeRef, BfPopulateType_Data, BfResolveTypeRefFlag_AllowRef);
|
module->ResolveTypeRef(propDef->mTypeRef, BfPopulateType_Identity, BfResolveTypeRefFlag_AllowRef);
|
||||||
|
|
||||||
|
if (auto indexerDeclaration = BfNodeDynCast<BfIndexerDeclaration>(propDef->mFieldDeclaration))
|
||||||
|
{
|
||||||
|
for (auto paramDecl : indexerDeclaration->mParams)
|
||||||
|
{
|
||||||
|
module->ResolveTypeRef(paramDecl->mTypeRef, BfPopulateType_Identity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((autoComplete->mIsGetDefinition) && (propDef->mFieldDeclaration != NULL) && (autoComplete->IsAutocompleteNode(propDef->mFieldDeclaration->mNameNode)))
|
if ((autoComplete->mIsGetDefinition) && (propDef->mFieldDeclaration != NULL) && (autoComplete->IsAutocompleteNode(propDef->mFieldDeclaration->mNameNode)))
|
||||||
{
|
{
|
||||||
|
@ -6520,19 +6528,24 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
||||||
|
|
||||||
#ifdef BF_PLATFORM_WINDOWS
|
#ifdef BF_PLATFORM_WINDOWS
|
||||||
if (!mIsResolveOnly)
|
if (!mIsResolveOnly)
|
||||||
{
|
{
|
||||||
for (auto mainModule : mContext->mModules)
|
if (!IsHotCompile())
|
||||||
{
|
{
|
||||||
BfModule* bfModule = mainModule;
|
// Remove individually-written object files from any libs that previously had them,
|
||||||
if (bfModule->mIsReified)
|
// in the case that lib settings changed (ie: switching a module from Og+ to O0)
|
||||||
|
for (auto mainModule : mContext->mModules)
|
||||||
{
|
{
|
||||||
for (auto outFileName : bfModule->mOutFileNames)
|
BfModule* bfModule = mainModule;
|
||||||
|
if (bfModule->mIsReified)
|
||||||
{
|
{
|
||||||
if (outFileName.mModuleWritten)
|
for (auto outFileName : bfModule->mOutFileNames)
|
||||||
BeLibManager::Get()->AddUsedFileName(outFileName.mFileName);
|
{
|
||||||
|
if (outFileName.mModuleWritten)
|
||||||
|
BeLibManager::Get()->AddUsedFileName(outFileName.mFileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto libManager = BeLibManager::Get();
|
auto libManager = BeLibManager::Get();
|
||||||
libManager->Finish();
|
libManager->Finish();
|
||||||
|
|
|
@ -19350,7 +19350,6 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
|
||||||
bool wasGenericParam = false;
|
bool wasGenericParam = false;
|
||||||
if (resolvedParamType == NULL)
|
if (resolvedParamType == NULL)
|
||||||
{
|
{
|
||||||
SetAndRestoreValue<bool> prevIngoreErrors(mIgnoreErrors, mIgnoreErrors || (methodDef->GetPropertyDeclaration() != NULL));
|
|
||||||
resolvedParamType = ResolveTypeRef(paramDef->mTypeRef, BfPopulateType_Declaration,
|
resolvedParamType = ResolveTypeRef(paramDef->mTypeRef, BfPopulateType_Declaration,
|
||||||
(BfResolveTypeRefFlags)(BfResolveTypeRefFlag_NoResolveGenericParam | BfResolveTypeRefFlag_AllowRef | BfResolveTypeRefFlag_AllowRefGeneric | BfResolveTypeRefFlag_AllowGenericMethodParamConstValue));
|
(BfResolveTypeRefFlags)(BfResolveTypeRefFlag_NoResolveGenericParam | BfResolveTypeRefFlag_AllowRef | BfResolveTypeRefFlag_AllowRefGeneric | BfResolveTypeRefFlag_AllowGenericMethodParamConstValue));
|
||||||
}
|
}
|
||||||
|
@ -21011,7 +21010,8 @@ bool BfModule::Finish()
|
||||||
mCompiler->mStats.mConstBytes += mBfIRBuilder->mTempAlloc.GetAllocSize();
|
mCompiler->mStats.mConstBytes += mBfIRBuilder->mTempAlloc.GetAllocSize();
|
||||||
|
|
||||||
bool allowWriteToLib = true;
|
bool allowWriteToLib = true;
|
||||||
if ((allowWriteToLib) && (codeGenOptions.mOptLevel == BfOptLevel_OgPlus) && (mModuleName != "vdata"))
|
if ((allowWriteToLib) && (codeGenOptions.mOptLevel == BfOptLevel_OgPlus) &&
|
||||||
|
(!mCompiler->IsHotCompile()) && (mModuleName != "vdata"))
|
||||||
{
|
{
|
||||||
codeGenOptions.mWriteToLib = true;
|
codeGenOptions.mWriteToLib = true;
|
||||||
mWroteToLib = true;
|
mWroteToLib = true;
|
||||||
|
@ -21065,15 +21065,9 @@ bool BfModule::Finish()
|
||||||
if (mCompiler->IsHotCompile())
|
if (mCompiler->IsHotCompile())
|
||||||
{
|
{
|
||||||
codeGenOptions.mIsHotCompile = true;
|
codeGenOptions.mIsHotCompile = true;
|
||||||
//TODO: Why did we have this 'mWroteToLib' check? 'vdata' didn't get this flag set, which
|
if (mParentModule != NULL)
|
||||||
// is required for rebuilding vdata after we hot create a vdata
|
mParentModule->mHadHotObjectWrites = true;
|
||||||
//if (mWroteToLib)
|
mHadHotObjectWrites = true;
|
||||||
|
|
||||||
{
|
|
||||||
if (mParentModule != NULL)
|
|
||||||
mParentModule->mHadHotObjectWrites = true;
|
|
||||||
mHadHotObjectWrites = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue