shader: Avoid usage of C++20 ranges to build in clang
This commit is contained in:
parent
94af0a00f6
commit
bf2956d77a
11 changed files with 47 additions and 39 deletions
|
@ -3,7 +3,6 @@
|
|||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <ranges>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
|
@ -599,7 +598,9 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
|
|||
} // Anonymous namespace
|
||||
|
||||
void ConstantPropagationPass(IR::Program& program) {
|
||||
for (IR::Block* const block : program.post_order_blocks | std::views::reverse) {
|
||||
const auto end{program.post_order_blocks.rend()};
|
||||
for (auto it = program.post_order_blocks.rbegin(); it != end; ++it) {
|
||||
IR::Block* const block{*it};
|
||||
for (IR::Inst& inst : block->Instructions()) {
|
||||
ConstantPropagation(*block, inst);
|
||||
}
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <ranges>
|
||||
|
||||
#include "shader_recompiler/frontend/ir/basic_block.h"
|
||||
#include "shader_recompiler/frontend/ir/value.h"
|
||||
#include "shader_recompiler/ir_opt/passes.h"
|
||||
|
|
|
@ -2,12 +2,6 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <ranges>
|
||||
|
||||
#include "common/bit_cast.h"
|
||||
#include "common/bit_util.h"
|
||||
#include "shader_recompiler/exception.h"
|
||||
#include "shader_recompiler/frontend/ir/ir_emitter.h"
|
||||
#include "shader_recompiler/ir_opt/passes.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include <algorithm>
|
||||
#include <compare>
|
||||
#include <optional>
|
||||
#include <ranges>
|
||||
#include <queue>
|
||||
|
||||
#include <boost/container/flat_set.hpp>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <ranges>
|
||||
#include <utility>
|
||||
|
||||
#include "shader_recompiler/exception.h"
|
||||
|
@ -207,7 +206,9 @@ void Lower(IR::Block& block, IR::Inst& inst) {
|
|||
} // Anonymous namespace
|
||||
|
||||
void LowerInt64ToInt32(IR::Program& program) {
|
||||
for (IR::Block* const block : program.post_order_blocks | std::views::reverse) {
|
||||
const auto end{program.post_order_blocks.rend()};
|
||||
for (auto it = program.post_order_blocks.rbegin(); it != end; ++it) {
|
||||
IR::Block* const block{*it};
|
||||
for (IR::Inst& inst : block->Instructions()) {
|
||||
Lower(*block, inst);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
// https://link.springer.com/chapter/10.1007/978-3-642-37051-9_6
|
||||
//
|
||||
|
||||
#include <ranges>
|
||||
#include <span>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
@ -243,7 +242,9 @@ public:
|
|||
void SealBlock(IR::Block* block) {
|
||||
const auto it{incomplete_phis.find(block)};
|
||||
if (it != incomplete_phis.end()) {
|
||||
for (auto& [variant, phi] : it->second) {
|
||||
for (auto& pair : it->second) {
|
||||
auto& variant{pair.first};
|
||||
auto& phi{pair.second};
|
||||
std::visit([&](auto& variable) { AddPhiOperands(variable, *phi, block); }, variant);
|
||||
}
|
||||
}
|
||||
|
@ -373,8 +374,9 @@ void VisitBlock(Pass& pass, IR::Block* block) {
|
|||
|
||||
void SsaRewritePass(IR::Program& program) {
|
||||
Pass pass;
|
||||
for (IR::Block* const block : program.post_order_blocks | std::views::reverse) {
|
||||
VisitBlock(pass, block);
|
||||
const auto end{program.post_order_blocks.rend()};
|
||||
for (auto block = program.post_order_blocks.rbegin(); block != end; ++block) {
|
||||
VisitBlock(pass, *block);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue