Fix enums in debug output

This commit is contained in:
drmortalwombat 2023-05-27 14:17:30 +02:00
parent 7d3dc493c0
commit a4faf204cb
3 changed files with 20 additions and 8 deletions

View File

@ -1182,12 +1182,15 @@ bool Compiler::WriteDbjFile(const char* filename)
bool tfirst = true; bool tfirst = true;
Declaration* mdec = dec->mParams; Declaration* mdec = dec->mParams;
while (mdec) while (mdec)
{
if (mdec->mIdent)
{ {
if (!tfirst) if (!tfirst)
fprintf(file, ",\n"); fprintf(file, ",\n");
tfirst = false; tfirst = false;
fprintf(file, "\t\t\t{\"name\": \"%s\", \"value\": %d}", mdec->mIdent->mString, int(mdec->mInteger)); fprintf(file, "\t\t\t{\"name\": \"%s\", \"value\": %d}", mdec->mIdent->mString, int(mdec->mInteger));
}
mdec = mdec->mNext; mdec = mdec->mNext;
} }

View File

@ -28173,6 +28173,9 @@ bool NativeCodeBasicBlock::OptimizeSimpleLoopInvariant(NativeCodeProcedure* proc
{ {
if (!prevBlock) if (!prevBlock)
return OptimizeSimpleLoopInvariant(proc, full); return OptimizeSimpleLoopInvariant(proc, full);
mExitRequiredRegs += CPU_REG_Y;
exitBlock->mEntryRequiredRegs += CPU_REG_Y;
exitBlock->mIns.Insert(0, mIns[ei]); exitBlock->mIns.Insert(0, mIns[ei]);
mIns.Remove(ei); mIns.Remove(ei);
@ -29500,6 +29503,10 @@ bool NativeCodeBasicBlock::OptimizeSimpleLoop(NativeCodeProcedure * proc, bool f
assert(mBranch != ASMIT_JMP || mFalseJump == nullptr); assert(mBranch != ASMIT_JMP || mFalseJump == nullptr);
CheckLive(); CheckLive();
if (mTrueJump)
mTrueJump->CheckLive();
if (mFalseJump)
mFalseJump->CheckLive();
#if 1 #if 1
if (sz > 3 && if (sz > 3 &&
@ -30226,6 +30233,8 @@ bool NativeCodeBasicBlock::OptimizeInnerLoop(NativeCodeProcedure* proc, NativeCo
tail->mEntryRequiredRegs += CPU_REG_Y; tail->mEntryRequiredRegs += CPU_REG_Y;
tail->mExitRequiredRegs += CPU_REG_Y; tail->mExitRequiredRegs += CPU_REG_Y;
head->mExitRequiredRegs += CPU_REG_Y; head->mExitRequiredRegs += CPU_REG_Y;
eblock->mEntryRequiredRegs = tail->mExitRequiredRegs;
eblock->mEntryRequiredRegs += CPU_REG_Y;
lblock->CheckLive(); lblock->CheckLive();
@ -39225,7 +39234,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
{ {
mInterProc = proc; mInterProc = proc;
CheckFunc = !strcmp(mInterProc->mIdent->mString, "iec_read"); CheckFunc = !strcmp(mInterProc->mIdent->mString, "rirq_build");
int nblocks = proc->mBlocks.Size(); int nblocks = proc->mBlocks.Size();
tblocks = new NativeCodeBasicBlock * [nblocks]; tblocks = new NativeCodeBasicBlock * [nblocks];

View File

@ -333,13 +333,13 @@ Declaration* Parser::ParseBaseTypeDeclaration(uint64 flags)
else if (cdec->mInteger > maxValue) else if (cdec->mInteger > maxValue)
maxValue = cdec->mInteger; maxValue = cdec->mInteger;
cdec->mNext = dec->mParams;
dec->mParams = cdec;
if (mScanner->mToken == TK_COMMA) if (mScanner->mToken == TK_COMMA)
mScanner->NextToken(); mScanner->NextToken();
else else
break; break;
cdec->mNext = dec->mParams;
dec->mParams = cdec;
} }
dec->mMinValue = minValue; dec->mMinValue = minValue;