#define LLVM_ADT_POSTORDERITERATOR_H
#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include <iterator>
#include <set>
+#include <utility>
#include <vector>
namespace llvm {
template<class SetType, bool External>
class po_iterator_storage {
SetType Visited;
+
public:
// Return true if edge destination should be visited.
template <typename NodeRef>
template<class SetType>
class po_iterator_storage<SetType, true> {
SetType &Visited;
+
public:
po_iterator_storage(SetType &VSet) : Visited(VSet) {}
po_iterator_storage(const po_iterator_storage &S) : Visited(S.Visited) {}
template <class GraphT,
class SetType =
- llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeRef, 8>,
+ SmallPtrSet<typename GraphTraits<GraphT>::NodeRef, 8>,
bool ExtStorage = false, class GT = GraphTraits<GraphT>>
class po_iterator
: public std::iterator<std::forward_iterator_tag, typename GT::NodeRef>,
VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB)));
traverseChild();
}
- po_iterator() {} // End is when stack is empty.
+
+ po_iterator() = default; // End is when stack is empty.
po_iterator(NodeRef BB, SetType &S)
: po_iterator_storage<SetType, ExtStorage>(S) {
po_iterator(SetType &S)
: po_iterator_storage<SetType, ExtStorage>(S) {
} // End is when stack is empty.
+
public:
typedef typename super::pointer pointer;
// }
//
-template<class GraphT, class GT = GraphTraits<GraphT> >
+template<class GraphT, class GT = GraphTraits<GraphT>>
class ReversePostOrderTraversal {
typedef typename GT::NodeRef NodeRef;
std::vector<NodeRef> Blocks; // Block list in normal PO order
+
void Initialize(NodeRef BB) {
std::copy(po_begin(BB), po_end(BB), std::back_inserter(Blocks));
}
+
public:
typedef typename std::vector<NodeRef>::reverse_iterator rpo_iterator;
rpo_iterator end() { return Blocks.rend(); }
};
-} // End llvm namespace
+} // end namespace llvm
-#endif
+#endif // LLVM_ADT_POSTORDERITERATOR_H
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
#include <algorithm>
#include <cassert>
-#include <utility>
+#include <cstddef>
#include <vector>
namespace llvm {
typedef typename MapT::size_type size_type;
/// Construct an empty PriorityWorklist
- PriorityWorklist() {}
+ PriorityWorklist() = default;
/// Determine if the PriorityWorklist is empty or not.
bool empty() const {
: public PriorityWorklist<T, SmallVector<T, N>,
SmallDenseMap<T, ptrdiff_t>> {
public:
- SmallPriorityWorklist() {}
+ SmallPriorityWorklist() = default;
};
-}
+} // end namespace llvm
-#endif
+#endif // LLVM_ADT_PRIORITYWORKLIST_H
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator.h"
+#include <cassert>
+#include <cstddef>
+#include <iterator>
#include <vector>
namespace llvm {
}
/// End is when the DFS stack is empty.
- scc_iterator() {}
+ scc_iterator() = default;
public:
static scc_iterator begin(const GraphT &G) {
}
/// \brief Construct the begin iterator for a deduced graph type T's Inverse<T>.
-template <class T> scc_iterator<Inverse<T> > scc_begin(const Inverse<T> &G) {
- return scc_iterator<Inverse<T> >::begin(G);
+template <class T> scc_iterator<Inverse<T>> scc_begin(const Inverse<T> &G) {
+ return scc_iterator<Inverse<T>>::begin(G);
}
/// \brief Construct the end iterator for a deduced graph type T's Inverse<T>.
-template <class T> scc_iterator<Inverse<T> > scc_end(const Inverse<T> &G) {
- return scc_iterator<Inverse<T> >::end(G);
+template <class T> scc_iterator<Inverse<T>> scc_end(const Inverse<T> &G) {
+ return scc_iterator<Inverse<T>>::end(G);
}
-} // End llvm namespace
+} // end namespace llvm
-#endif
+#endif // LLVM_ADT_SCCITERATOR_H
#ifndef LLVM_ADT_SETVECTOR_H
#define LLVM_ADT_SETVECTOR_H
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallSet.h"
+#include "llvm/Support/Compiler.h"
#include <algorithm>
#include <cassert>
-#include <utility>
+#include <iterator>
#include <vector>
namespace llvm {
typedef typename vector_type::size_type size_type;
/// \brief Construct an empty SetVector
- SetVector() {}
+ SetVector() = default;
/// \brief Initialize a SetVector with a range of elements
template<typename It>
class SmallSetVector
: public SetVector<T, SmallVector<T, N>, SmallDenseSet<T, N>> {
public:
- SmallSetVector() {}
+ SmallSetVector() = default;
/// \brief Initialize a SmallSetVector with a range of elements
template<typename It>
}
};
-} // End llvm namespace
+} // end namespace llvm
-// vim: sw=2 ai
-#endif
+#endif // LLVM_ADT_SETVECTOR_H
#include "llvm/ADT/None.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
+#include <cstddef>
+#include <functional>
#include <set>
+#include <utility>
namespace llvm {
///
/// Note that this set does not provide a way to iterate over members in the
/// set.
-template <typename T, unsigned N, typename C = std::less<T> >
+template <typename T, unsigned N, typename C = std::less<T>>
class SmallSet {
/// Use a SmallVector to hold the elements here (even though it will never
/// reach its 'large' stage) to avoid calling the default ctors of elements
public:
typedef size_t size_type;
- SmallSet() {}
+
+ SmallSet() = default;
LLVM_NODISCARD bool empty() const {
return Vector.empty() && Set.empty();
} // end namespace llvm
-#endif
+#endif // LLVM_ADT_SMALLSET_H