1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Improved handling of mGhostDependencies. Codegen Abort

This commit is contained in:
Brian Fiete 2025-01-19 08:39:46 -08:00
parent 9988dec99d
commit a82cc0534d
6 changed files with 37 additions and 4 deletions

View file

@ -1123,7 +1123,10 @@ void BeIRCodeGen::Read(BeMDNode*& llvmMD)
}
void BeIRCodeGen::HandleNextCmd()
{
{
if (mFailed)
return;
int curId = mCmdCount;
BfIRCmd cmd = (BfIRCmd)mStream->Read();
@ -1192,6 +1195,11 @@ void BeIRCodeGen::HandleNextCmd()
mBeModule->print(outStream, NULL);*/
}
break;
case BfIRCmd_Abort:
{
Fail("Stream aborted");
}
break;
case BfIRCmd_SetType:
{
CMD_PARAM(int, typeId);
@ -1236,6 +1244,13 @@ void BeIRCodeGen::HandleNextCmd()
CMD_PARAM(int, instSize);
CMD_PARAM(int, instAlign);
CMD_PARAM(bool, isPacked);
if ((type == NULL) || (type->mTypeCode != BeTypeCode_Struct))
{
Fail("StructSetBody invalid type");
break;
}
BF_ASSERT(type->mTypeCode == BeTypeCode_Struct);
auto structType = (BeStructType*)type;
mBeContext->SetStructBody(structType, members, isPacked);

View file

@ -82,7 +82,7 @@ public:
BeContext* mBeContext;
BeModule* mBeModule;
Array<BeDbgLoc*> mSavedDebugLocs;
bool mHasDebugLoc;
bool mHasDebugLoc;
int mCmdCount;
Dictionary<int, BeIRCodeGenEntry> mResults;