mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed build cache error, fixed ordered hash bug
Fixed error writing to build.bat when build directory was externally cleared Fixed ordered hash errors where the fields were added but the hash didn't change
This commit is contained in:
parent
d26e2957b0
commit
8659afa944
2 changed files with 32 additions and 1 deletions
|
@ -244,7 +244,29 @@ void BeIRCodeGen::Hash(BeHashContext& hashCtx)
|
|||
hashCtx.Mixin(mPtrSize);
|
||||
hashCtx.Mixin(mIsOptimized);
|
||||
if (mBeModule != NULL)
|
||||
mBeModule->Hash(hashCtx);
|
||||
mBeModule->Hash(hashCtx);
|
||||
|
||||
Array<BeStructType*> structHashList;
|
||||
|
||||
for (auto beType : mBeContext->mTypes)
|
||||
{
|
||||
if (!beType->IsStruct())
|
||||
continue;
|
||||
auto beStructType = (BeStructType*)beType;
|
||||
if (beStructType->mHashId != -1)
|
||||
continue;
|
||||
structHashList.Add(beStructType);
|
||||
}
|
||||
|
||||
structHashList.Sort([](BeStructType* lhs, BeStructType* rhs)
|
||||
{
|
||||
return lhs->mName < rhs->mName;
|
||||
});
|
||||
|
||||
for (auto beStructType : structHashList)
|
||||
{
|
||||
beStructType->HashReference(hashCtx);
|
||||
}
|
||||
}
|
||||
|
||||
bool BeIRCodeGen::IsModuleEmpty()
|
||||
|
|
|
@ -112,6 +112,15 @@ void BfCodeGenDirectoryData::Write()
|
|||
String fileName = GetDataFileName();
|
||||
if (!fileStream.Open(fileName, "wb"))
|
||||
{
|
||||
String directory = GetFileDir(fileName);
|
||||
if (!DirectoryExists(directory))
|
||||
{
|
||||
// Someone else (or the user) cleared this directory
|
||||
DoBfLog(2, "BfCodeGen cleared cache because '%s' was removed\n", directory.c_str());
|
||||
mFileMap.Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
mError = "Failed to write to " + fileName;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue