diff options
| author | Andrey Sukharev <SukharevAndrey@users.noreply.github.com> | 2022-12-05 16:47:39 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-05 14:47:39 +0100 |
| commit | 4da44e09cb2a32f69b4a6b47221117b78e4618dc (patch) | |
| tree | c3648a09202374dabff6fac472fe341bf9e1f0ee /ARMeilleure/CodeGen/RegisterAllocators | |
| parent | ae13f0ab4da5b371bba746c1bd6598baaa44585d (diff) | |
Make structs readonly when applicable (#4002)
* Make all structs readonly when applicable. It should reduce amount of needless defensive copies
* Make structs with trivial boilerplate equality code record structs
* Remove unnecessary readonly modifiers from TextureCreateInfo
* Make BitMap structs readonly too
Diffstat (limited to 'ARMeilleure/CodeGen/RegisterAllocators')
4 files changed, 4 insertions, 4 deletions
diff --git a/ARMeilleure/CodeGen/RegisterAllocators/AllocationResult.cs b/ARMeilleure/CodeGen/RegisterAllocators/AllocationResult.cs index 94ac6991..43e5c7e2 100644 --- a/ARMeilleure/CodeGen/RegisterAllocators/AllocationResult.cs +++ b/ARMeilleure/CodeGen/RegisterAllocators/AllocationResult.cs @@ -1,6 +1,6 @@ namespace ARMeilleure.CodeGen.RegisterAllocators { - struct AllocationResult + readonly struct AllocationResult { public int IntUsedRegisters { get; } public int VecUsedRegisters { get; } diff --git a/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs b/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs index df4b6db1..587b1a02 100644 --- a/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs +++ b/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs @@ -11,7 +11,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators { private class ParallelCopy { - private struct Copy + private readonly struct Copy { public Register Dest { get; } public Register Source { get; } diff --git a/ARMeilleure/CodeGen/RegisterAllocators/HybridAllocator.cs b/ARMeilleure/CodeGen/RegisterAllocators/HybridAllocator.cs index de084026..25952c77 100644 --- a/ARMeilleure/CodeGen/RegisterAllocators/HybridAllocator.cs +++ b/ARMeilleure/CodeGen/RegisterAllocators/HybridAllocator.cs @@ -11,7 +11,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators { class HybridAllocator : IRegisterAllocator { - private struct BlockInfo + private readonly struct BlockInfo { public bool HasCall { get; } diff --git a/ARMeilleure/CodeGen/RegisterAllocators/RegisterMasks.cs b/ARMeilleure/CodeGen/RegisterAllocators/RegisterMasks.cs index 9652224e..5b11aac2 100644 --- a/ARMeilleure/CodeGen/RegisterAllocators/RegisterMasks.cs +++ b/ARMeilleure/CodeGen/RegisterAllocators/RegisterMasks.cs @@ -3,7 +3,7 @@ using System; namespace ARMeilleure.CodeGen.RegisterAllocators { - struct RegisterMasks + readonly struct RegisterMasks { public int IntAvailableRegisters { get; } public int VecAvailableRegisters { get; } |
