mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 11:06:24 +02:00
misc: chore: Use explicit types in Generator projects
This commit is contained in:
parent
fe661dc750
commit
e6b393e420
9 changed files with 45 additions and 44 deletions
|
@ -239,8 +239,8 @@ namespace Spv.Generator
|
|||
|
||||
public override string ToString()
|
||||
{
|
||||
var labels = _operandLabels.TryGetValue(Opcode, out var opLabels) ? opLabels : Array.Empty<string>();
|
||||
var result = _resultType == null ? string.Empty : $"{_resultType} ";
|
||||
string[] labels = _operandLabels.TryGetValue(Opcode, out string[] opLabels) ? opLabels : Array.Empty<string>();
|
||||
string result = _resultType == null ? string.Empty : $"{_resultType} ";
|
||||
return $"{result}{Opcode}{_operands.ToString(labels)}";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,9 +63,9 @@ namespace Spv.Generator
|
|||
|
||||
public readonly string ToString(string[] labels)
|
||||
{
|
||||
var labeledParams = AllOperands.Zip(labels, (op, label) => $"{label}: {op}");
|
||||
var unlabeledParams = AllOperands.Skip(labels.Length).Select(op => op.ToString());
|
||||
var paramsToPrint = labeledParams.Concat(unlabeledParams);
|
||||
IEnumerable<string> labeledParams = AllOperands.Zip(labels, (op, label) => $"{label}: {op}");
|
||||
IEnumerable<string> unlabeledParams = AllOperands.Skip(labels.Length).Select(op => op.ToString());
|
||||
IEnumerable<string> paramsToPrint = labeledParams.Concat(unlabeledParams);
|
||||
return $"({string.Join(", ", paramsToPrint)})";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace Spv.Generator
|
|||
|
||||
public Instruction NewInstruction(Op opcode, uint id = Instruction.InvalidId, Instruction resultType = null)
|
||||
{
|
||||
var result = _instPool.Allocate();
|
||||
Instruction result = _instPool.Allocate();
|
||||
result.Set(opcode, id, resultType);
|
||||
|
||||
return result;
|
||||
|
@ -93,7 +93,7 @@ namespace Spv.Generator
|
|||
|
||||
public Instruction AddExtInstImport(string import)
|
||||
{
|
||||
var key = new DeterministicStringKey(import);
|
||||
DeterministicStringKey key = new DeterministicStringKey(import);
|
||||
|
||||
if (_extInstImports.TryGetValue(key, out Instruction extInstImport))
|
||||
{
|
||||
|
@ -113,7 +113,7 @@ namespace Spv.Generator
|
|||
|
||||
private void AddTypeDeclaration(Instruction instruction, bool forceIdAllocation)
|
||||
{
|
||||
var key = new TypeDeclarationKey(instruction);
|
||||
TypeDeclarationKey key = new TypeDeclarationKey(instruction);
|
||||
|
||||
if (!forceIdAllocation)
|
||||
{
|
||||
|
@ -214,7 +214,7 @@ namespace Spv.Generator
|
|||
constant.Opcode == Op.OpConstantNull ||
|
||||
constant.Opcode == Op.OpConstantComposite);
|
||||
|
||||
var key = new ConstantKey(constant);
|
||||
ConstantKey key = new ConstantKey(constant);
|
||||
|
||||
if (_constants.TryGetValue(key, out Instruction global))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue