clover/util: add id_type_equals to support symbols with multiple sections

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6569>
This commit is contained in:
Karol Herbst 2020-09-02 20:35:35 +02:00 committed by Marge Bot
parent 7fb4ab9ec1
commit af85985250

View file

@ -406,6 +406,30 @@ namespace clover {
return { x };
}
template<typename T>
class id_type_equals_t {
public:
id_type_equals_t(const uint32_t id, T t) :
id(id), type(t) {
}
template<typename X>
bool
operator()(const X &x) const {
return id == x.id && type(x);
}
private:
const uint32_t id;
type_equals_t<T> type;
};
template<typename T>
id_type_equals_t<T>
id_type_equals(const uint32_t id, T x) {
return { id, x };
}
struct interval_overlaps {
template<typename T>
bool