summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/shader_recompiler/frontend/ir/basic_block.cpp12
-rw-r--r--src/shader_recompiler/frontend/ir/basic_block.h17
2 files changed, 12 insertions, 17 deletions
diff --git a/src/shader_recompiler/frontend/ir/basic_block.cpp b/src/shader_recompiler/frontend/ir/basic_block.cpp
index e1f0191f4..f92fc2571 100644
--- a/src/shader_recompiler/frontend/ir/basic_block.cpp
+++ b/src/shader_recompiler/frontend/ir/basic_block.cpp
@@ -69,24 +69,12 @@ u32 Block::LocationEnd() const noexcept {
return location_end;
}
-Block::InstructionList& Block::Instructions() noexcept {
- return instructions;
-}
-
-const Block::InstructionList& Block::Instructions() const noexcept {
- return instructions;
-}
-
void Block::AddImmediatePredecessor(Block* block) {
if (std::ranges::find(imm_predecessors, block) == imm_predecessors.end()) {
imm_predecessors.push_back(block);
}
}
-std::span<IR::Block* const> Block::ImmediatePredecessors() const noexcept {
- return imm_predecessors;
-}
-
static std::string BlockToIndex(const std::map<const Block*, size_t>& block_to_index,
Block* block) {
if (const auto it{block_to_index.find(block)}; it != block_to_index.end()) {
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:
/// Gets the end location for this basic block.
[[nodiscard]] u32 LocationEnd() const noexcept;
+ /// Adds a new immediate predecessor to this basic block.
+ void AddImmediatePredecessor(Block* block);
+
/// Gets a mutable reference to the instruction list for this basic block.
- [[nodiscard]] InstructionList& Instructions() noexcept;
+ [[nodiscard]] InstructionList& Instructions() noexcept {
+ return instructions;
+ }
/// Gets an immutable reference to the instruction list for this basic block.
- [[nodiscard]] const InstructionList& Instructions() const noexcept;
+ [[nodiscard]] const InstructionList& Instructions() const noexcept {
+ return instructions;
+ }
- /// Adds a new immediate predecessor to this basic block.
- void AddImmediatePredecessor(Block* block);
/// Gets an immutable span to the immediate predecessors.
- [[nodiscard]] std::span<Block* const> ImmediatePredecessors() const noexcept;
+ [[nodiscard]] std::span<Block* const> ImmediatePredecessors() const noexcept {
+ return imm_predecessors;
+ }
/// Intrusively store the host definition of this instruction.
template <typename DefinitionType>