14#ifndef LLVM_ADT_PRIORITYQUEUE_H
15#define LLVM_ADT_PRIORITYQUEUE_H
26template <
class T,
class Sequence = std::vector<T>,
27 class Compare = std::less<
typename Sequence::value_type>>
29 :
public std::priority_queue<T, Sequence, Compare> {
32 const Sequence &sequence = Sequence())
33 :
std::priority_queue<
T, Sequence, Compare>(compare, sequence)
36 template<
class Iterator>
38 const Compare &compare = Compare(),
39 const Sequence &sequence = Sequence())
40 :
std::priority_queue<
T, Sequence, Compare>(begin, end, compare, sequence)
50 typename Sequence::size_type i =
find(this->c, t) - this->c.begin();
54 typename Sequence::size_type parent = (i - 1) / 2;
55 this->c[i] = this->c[parent];
72 std::make_heap(this->c.begin(), this->c.end(), this->comp);
#define LLVM_ATTRIBUTE_WARN_UNUSED
static const BasicSubtargetSubTypeKV * find(StringRef S, ArrayRef< BasicSubtargetSubTypeKV > A)
Find KV in array using binary search.
PriorityQueue(Iterator begin, Iterator end, const Compare &compare=Compare(), const Sequence &sequence=Sequence())
void clear()
clear - Erase all elements from the queue.
void reheapify()
reheapify - If an element in the queue has changed in a way that affects its standing in the comparis...
PriorityQueue(const Compare &compare=Compare(), const Sequence &sequence=Sequence())
void erase_one(const T &t)
erase_one - Erase one element from the queue, regardless of its position.
This is an optimization pass for GlobalISel generic memory operations.
Implement std::hash so that hash_code can be used in STL containers.