mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
- report implicitly initialized variable in code generator once
Vectors are no longer reported several times Previously, warnings were issued per every register
This commit is contained in:
parent
024456048e
commit
4a2ae357a2
1 changed files with 9 additions and 1 deletions
|
@ -11358,6 +11358,9 @@ ExpEmit FxLocalVariableDeclaration::Emit(VMFunctionBuilder *build)
|
||||||
auto& registers = build->Registers[regType];
|
auto& registers = build->Registers[regType];
|
||||||
RegNum = registers.Get(RegCount);
|
RegNum = registers.Get(RegCount);
|
||||||
|
|
||||||
|
// Check for reused registers and clean them if needed
|
||||||
|
bool useDirtyRegisters = false;
|
||||||
|
|
||||||
for (int reg = RegNum, end = RegNum + RegCount; reg < end; ++reg)
|
for (int reg = RegNum, end = RegNum + RegCount; reg < end; ++reg)
|
||||||
{
|
{
|
||||||
if (!registers.IsDirty(reg))
|
if (!registers.IsDirty(reg))
|
||||||
|
@ -11365,7 +11368,7 @@ ExpEmit FxLocalVariableDeclaration::Emit(VMFunctionBuilder *build)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptPosition.Message(MSG_DEBUGMSG, "Implicit initialization of variable %s\n", Name.GetChars());
|
useDirtyRegisters = true;
|
||||||
|
|
||||||
switch (regType)
|
switch (regType)
|
||||||
{
|
{
|
||||||
|
@ -11390,6 +11393,11 @@ ExpEmit FxLocalVariableDeclaration::Emit(VMFunctionBuilder *build)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (useDirtyRegisters)
|
||||||
|
{
|
||||||
|
ScriptPosition.Message(MSG_DEBUGMSG, "Implicit initialization of variable %s", Name.GetChars());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue