build: fix clang-cl compile of ResourceTracking

Tracker::IndirectImagePlan lives in an anonymous namespace, so std::projected
cannot be formed for it and the three std::ranges algorithms over
m_indirect_images fail to compile under clang-cl with the MSVC STL:

  error: function 'std::projected<..., std::identity>::operator*' is used but
  not defined in this translation unit, and cannot be defined in any other
  translation unit because its type does not have linkage

Using the iterator-pair overloads compiles and is otherwise identical.

Seen with clang-cl and MSVC 14.29 (VS2019) STL. CI does not catch this because
its build targets are launcher and the smaller test binaries; kyty_emulator,
which is what pulls in this file, is never built there.
This commit is contained in:
Mac
2026-08-31 23:39:50 +05:30
parent beb8047083
commit c8f34f94d3
@@ -139,7 +139,8 @@ public:
} }
std::erase_if(m_program.dynamic_reads, [&](Value value) { std::erase_if(m_program.dynamic_reads, [&](Value value) {
const auto* inst = value.Resolve().TryInstruction(); const auto* inst = value.Resolve().TryInstruction();
return std::ranges::any_of(m_indirect_images, [&](const IndirectImagePlan& plan) { return std::any_of(m_indirect_images.begin(), m_indirect_images.end(),
[&](const IndirectImagePlan& plan) {
return std::ranges::find(plan.reads, inst) != plan.reads.end(); return std::ranges::find(plan.reads, inst) != plan.reads.end();
}); });
}); });
@@ -432,14 +433,16 @@ private:
const IndirectImagePlan* FindIndirectImage(const Inst& handle) const { const IndirectImagePlan* FindIndirectImage(const Inst& handle) const {
const auto found = const auto found =
std::ranges::find_if(m_indirect_images, [&](const IndirectImagePlan& plan) { std::find_if(m_indirect_images.begin(), m_indirect_images.end(),
[&](const IndirectImagePlan& plan) {
return plan.handle == &handle; return plan.handle == &handle;
}); });
return found == m_indirect_images.end() ? nullptr : &*found; return found == m_indirect_images.end() ? nullptr : &*found;
} }
bool IsIndirectPlanningMemory(uint32_t index) const { bool IsIndirectPlanningMemory(uint32_t index) const {
return std::ranges::any_of(m_indirect_images, [&](const IndirectImagePlan& plan) { return std::any_of(m_indirect_images.begin(), m_indirect_images.end(),
[&](const IndirectImagePlan& plan) {
return std::ranges::find(plan.memory, index) != plan.memory.end(); return std::ranges::find(plan.memory, index) != plan.memory.end();
}); });
} }