- 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:
alexey.lysiuk 2019-06-08 11:12:34 +03:00 committed by drfrag
parent 279bac7fe9
commit b3f18e5e47

View file

@ -11355,6 +11355,9 @@ ExpEmit FxLocalVariableDeclaration::Emit(VMFunctionBuilder *build)
auto& registers = build->Registers[regType];
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)
{
if (!registers.IsDirty(reg))
@ -11362,7 +11365,7 @@ ExpEmit FxLocalVariableDeclaration::Emit(VMFunctionBuilder *build)
continue;
}
ScriptPosition.Message(MSG_DEBUGMSG, "Implicit initialization of variable %s\n", Name.GetChars());
useDirtyRegisters = true;
switch (regType)
{
@ -11387,6 +11390,11 @@ ExpEmit FxLocalVariableDeclaration::Emit(VMFunctionBuilder *build)
break;
}
}
if (useDirtyRegisters)
{
ScriptPosition.Message(MSG_DEBUGMSG, "Implicit initialization of variable %s", Name.GetChars());
}
}
else
{