rpcsx/rpcsx-gpu/lib/gcn-shader/include/shader/ir/RegionLikeImpl.hpp
2024-10-01 22:04:40 +03:00

26 lines
647 B
C++

#pragma once
#include "PreincNodeIterable.hpp"
#include "RegionLike.hpp"
namespace shader::ir {
struct RegionLikeImpl {
Instruction first = nullptr;
Instruction last = nullptr;
virtual ~RegionLikeImpl() = default;
template <typename T = Instruction> auto children() const {
return PreincNodeIterable<T>{first, nullptr};
}
template <typename T = Instruction> auto revChildren() const {
return RevPreincNodeIterable<T>{last, nullptr};
}
virtual void insertAfter(Instruction point, Instruction node);
virtual void prependChild(Instruction node);
virtual void addChild(Instruction node);
};
} // namespace shader::ir