projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Delete an unused declaration.
[oota-llvm.git]
/
include
/
llvm
/
ADT
/
PriorityQueue.h
diff --git
a/include/llvm/ADT/PriorityQueue.h
b/include/llvm/ADT/PriorityQueue.h
index 1cff0f2a0ceeaf0ca062a8e6209e18cb944c72bd..bf8a687081638fdbdc7daa535751ccae1bf1928a 100644
(file)
--- a/
include/llvm/ADT/PriorityQueue.h
+++ b/
include/llvm/ADT/PriorityQueue.h
@@
-14,13
+14,14
@@
#ifndef LLVM_ADT_PRIORITY_QUEUE_H
#define LLVM_ADT_PRIORITY_QUEUE_H
#ifndef LLVM_ADT_PRIORITY_QUEUE_H
#define LLVM_ADT_PRIORITY_QUEUE_H
+#include <algorithm>
#include <queue>
namespace llvm {
/// PriorityQueue - This class behaves like std::priority_queue and
/// provides a few additional convenience functions.
#include <queue>
namespace llvm {
/// PriorityQueue - This class behaves like std::priority_queue and
/// provides a few additional convenience functions.
-///
+///
template<class T,
class Sequence = std::vector<T>,
class Compare = std::less<typename Sequence::value_type> >
template<class T,
class Sequence = std::vector<T>,
class Compare = std::less<typename Sequence::value_type> >
@@
-51,7
+52,7
@@
public:
// Logarithmic-time heap bubble-up.
while (i != 0) {
typename Sequence::size_type parent = (i - 1) / 2;
// Logarithmic-time heap bubble-up.
while (i != 0) {
typename Sequence::size_type parent = (i - 1) / 2;
-
std::swap(this->c[i], this->c[parent])
;
+
this->c[i] = this->c[parent]
;
i = parent;
}
i = parent;
}
@@
-70,6
+71,12
@@
public:
void reheapify() {
std::make_heap(this->c.begin(), this->c.end(), this->comp);
}
void reheapify() {
std::make_heap(this->c.begin(), this->c.end(), this->comp);
}
+
+ /// clear - Erase all elements from the queue.
+ ///
+ void clear() {
+ this->c.clear();
+ }
};
} // End llvm namespace
};
} // End llvm namespace