diff options
| author | 2021-04-20 22:28:06 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:28 -0400 | |
| commit | 4bbe5303376e693d15d7de80b25f5fda783281ce (patch) | |
| tree | 6432c932baf63ea9b4c6b7e56d0c5dcb3b3b13ba /src/shader_recompiler/frontend/ir/basic_block.h | |
| parent | shader: Use a small_vector for phi blocks (diff) | |
| download | yuzu-4bbe5303376e693d15d7de80b25f5fda783281ce.tar.gz yuzu-4bbe5303376e693d15d7de80b25f5fda783281ce.tar.xz yuzu-4bbe5303376e693d15d7de80b25f5fda783281ce.zip | |
shader: Inline common IR::Block methods
Diffstat (limited to 'src/shader_recompiler/frontend/ir/basic_block.h')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/basic_block.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/shader_recompiler/frontend/ir/basic_block.h b/src/shader_recompiler/frontend/ir/basic_block.h index b14a35ec5..6a1d615d9 100644 --- a/src/shader_recompiler/frontend/ir/basic_block.h +++ b/src/shader_recompiler/frontend/ir/basic_block.h | |||
| @@ -59,15 +59,22 @@ public: | |||
| 59 | /// Gets the end location for this basic block. | 59 | /// Gets the end location for this basic block. |
| 60 | [[nodiscard]] u32 LocationEnd() const noexcept; | 60 | [[nodiscard]] u32 LocationEnd() const noexcept; |
| 61 | 61 | ||
| 62 | /// Adds a new immediate predecessor to this basic block. | ||
| 63 | void AddImmediatePredecessor(Block* block); | ||
| 64 | |||
| 62 | /// Gets a mutable reference to the instruction list for this basic block. | 65 | /// Gets a mutable reference to the instruction list for this basic block. |
| 63 | [[nodiscard]] InstructionList& Instructions() noexcept; | 66 | [[nodiscard]] InstructionList& Instructions() noexcept { |
| 67 | return instructions; | ||
| 68 | } | ||
| 64 | /// Gets an immutable reference to the instruction list for this basic block. | 69 | /// Gets an immutable reference to the instruction list for this basic block. |
| 65 | [[nodiscard]] const InstructionList& Instructions() const noexcept; | 70 | [[nodiscard]] const InstructionList& Instructions() const noexcept { |
| 71 | return instructions; | ||
| 72 | } | ||
| 66 | 73 | ||
| 67 | /// Adds a new immediate predecessor to this basic block. | ||
| 68 | void AddImmediatePredecessor(Block* block); | ||
| 69 | /// Gets an immutable span to the immediate predecessors. | 74 | /// Gets an immutable span to the immediate predecessors. |
| 70 | [[nodiscard]] std::span<Block* const> ImmediatePredecessors() const noexcept; | 75 | [[nodiscard]] std::span<Block* const> ImmediatePredecessors() const noexcept { |
| 76 | return imm_predecessors; | ||
| 77 | } | ||
| 71 | 78 | ||
| 72 | /// Intrusively store the host definition of this instruction. | 79 | /// Intrusively store the host definition of this instruction. |
| 73 | template <typename DefinitionType> | 80 | template <typename DefinitionType> |