From af85985250acc645c56a03d561b19316a2a07846 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 2 Sep 2020 20:35:35 +0200 Subject: [PATCH] clover/util: add id_type_equals to support symbols with multiple sections Signed-off-by: Karol Herbst Reviewed-by: Jason Ekstrand Part-of: --- .../frontends/clover/util/functional.hpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/gallium/frontends/clover/util/functional.hpp b/src/gallium/frontends/clover/util/functional.hpp index bf374c6b199..a89c4fc2f4c 100644 --- a/src/gallium/frontends/clover/util/functional.hpp +++ b/src/gallium/frontends/clover/util/functional.hpp @@ -406,6 +406,30 @@ namespace clover { return { x }; } + template + class id_type_equals_t { + public: + id_type_equals_t(const uint32_t id, T t) : + id(id), type(t) { + } + + template + bool + operator()(const X &x) const { + return id == x.id && type(x); + } + + private: + const uint32_t id; + type_equals_t type; + }; + + template + id_type_equals_t + id_type_equals(const uint32_t id, T x) { + return { id, x }; + } + struct interval_overlaps { template bool