shader: Avoid usage of C++20 ranges to build in clang

This commit is contained in:
ReinUsesLisp 2021-07-12 05:22:01 -03:00 committed by ameerj
parent a23f05c215
commit 2321666580
11 changed files with 47 additions and 39 deletions

View file

@ -2,8 +2,10 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <ranges>
#include <algorithm>
#include <string>
#include <tuple>
#include <type_traits>
#include "common/div_ceil.h"
#include "common/settings.h"
@ -120,7 +122,10 @@ void PrecolorInst(IR::Inst& phi) {
void Precolor(const IR::Program& program) {
for (IR::Block* const block : program.blocks) {
for (IR::Inst& phi : block->Instructions() | std::views::take_while(IR::IsPhi)) {
for (IR::Inst& phi : block->Instructions()) {
if (!IR::IsPhi(phi)) {
break;
}
PrecolorInst(phi);
}
}