misc: chore: Use collection expressions in Shader project

This commit is contained in:
Evan Husted 2025-01-26 15:50:50 -06:00
parent a5dbcb75d0
commit 95f9e548ca
38 changed files with 198 additions and 204 deletions

View file

@ -34,11 +34,11 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
public BasicBlock()
{
Operations = new LinkedList<INode>();
Operations = [];
Predecessors = new List<BasicBlock>();
Predecessors = [];
DominanceFrontiers = new HashSet<BasicBlock>();
DominanceFrontiers = [];
}
public BasicBlock(int index) : this()

View file

@ -20,7 +20,7 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
private Operand()
{
UseOps = new HashSet<INode>();
UseOps = [];
}
public Operand(OperandType type) : this()

View file

@ -27,11 +27,11 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
value.AsgOp = this;
}
_dests = new[] { value };
_dests = [value];
}
else
{
_dests = Array.Empty<Operand>();
_dests = [];
}
}
}
@ -82,7 +82,7 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
}
else
{
_dests = Array.Empty<Operand>();
_dests = [];
}
}
@ -94,11 +94,11 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
{
dest.AsgOp = this;
_dests = new[] { dest };
_dests = [dest];
}
else
{
_dests = Array.Empty<Operand>();
_dests = [];
}
}
@ -111,11 +111,11 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
{
dest.AsgOp = this;
_dests = new[] { dest };
_dests = [dest];
}
else
{
_dests = Array.Empty<Operand>();
_dests = [];
}
}
@ -258,7 +258,7 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
source.UseOps.Add(this);
}
_sources = new Operand[] { source };
_sources = [source];
}
public void TurnDoubleIntoFloat()

View file

@ -35,9 +35,9 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
public PhiNode(Operand dest)
{
_blocks = new HashSet<BasicBlock>();
_blocks = [];
_sources = new List<PhiSource>();
_sources = [];
dest.AsgOp = this;