misc: chore: Use explicit types in ARMeilleure project

This commit is contained in:
Evan Husted 2025-01-25 14:01:13 -06:00
parent be3bd0bcb5
commit e0567c5ce9
37 changed files with 109 additions and 106 deletions

View file

@ -13,13 +13,13 @@ namespace ARMeilleure.CodeGen.X86
public static void RunPass(ControlFlowGraph cfg)
{
var constants = new Dictionary<ulong, Operand>();
Dictionary<ulong, Operand> constants = new Dictionary<ulong, Operand>();
Operand GetConstantCopy(BasicBlock block, Operation operation, Operand source)
{
// If the constant has many uses, we also force a new constant mov to be added, in order
// to avoid overflow of the counts field (that is limited to 16 bits).
if (!constants.TryGetValue(source.Value, out var constant) || constant.UsesCount > MaxConstantUses)
if (!constants.TryGetValue(source.Value, out Operand constant) || constant.UsesCount > MaxConstantUses)
{
constant = Local(source.Type);