From: Eugene Zelenko Date: Wed, 30 Nov 2016 23:10:42 +0000 (+0000) Subject: Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8069677ad214f4e923173ad1f6ed69794dde429f;p=platform%2Fupstream%2Fllvm.git Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC). llvm-svn: 288285 --- diff --git a/llvm/include/llvm/ADT/PostOrderIterator.h b/llvm/include/llvm/ADT/PostOrderIterator.h index ae72776..e519b5c 100644 --- a/llvm/include/llvm/ADT/PostOrderIterator.h +++ b/llvm/include/llvm/ADT/PostOrderIterator.h @@ -17,10 +17,12 @@ #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 #include +#include #include namespace llvm { @@ -55,6 +57,7 @@ namespace llvm { template class po_iterator_storage { SetType Visited; + public: // Return true if edge destination should be visited. template @@ -70,6 +73,7 @@ public: template class po_iterator_storage { SetType &Visited; + public: po_iterator_storage(SetType &VSet) : Visited(VSet) {} po_iterator_storage(const po_iterator_storage &S) : Visited(S.Visited) {} @@ -87,7 +91,7 @@ public: template ::NodeRef, 8>, + SmallPtrSet::NodeRef, 8>, bool ExtStorage = false, class GT = GraphTraits> class po_iterator : public std::iterator, @@ -115,7 +119,8 @@ class po_iterator 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(S) { @@ -128,6 +133,7 @@ class po_iterator po_iterator(SetType &S) : po_iterator_storage(S) { } // End is when stack is empty. + public: typedef typename super::pointer pointer; @@ -274,13 +280,15 @@ inverse_post_order_ext(const T &G, SetType &S) { // } // -template > +template> class ReversePostOrderTraversal { typedef typename GT::NodeRef NodeRef; std::vector 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::reverse_iterator rpo_iterator; @@ -291,6 +299,6 @@ public: rpo_iterator end() { return Blocks.rend(); } }; -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_ADT_POSTORDERITERATOR_H diff --git a/llvm/include/llvm/ADT/PriorityWorklist.h b/llvm/include/llvm/ADT/PriorityWorklist.h index 511606b..c0b4709 100644 --- a/llvm/include/llvm/ADT/PriorityWorklist.h +++ b/llvm/include/llvm/ADT/PriorityWorklist.h @@ -19,9 +19,10 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/Compiler.h" #include #include -#include +#include #include namespace llvm { @@ -60,7 +61,7 @@ public: 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 { @@ -217,9 +218,9 @@ class SmallPriorityWorklist : public PriorityWorklist, SmallDenseMap> { public: - SmallPriorityWorklist() {} + SmallPriorityWorklist() = default; }; -} +} // end namespace llvm -#endif +#endif // LLVM_ADT_PRIORITYWORKLIST_H diff --git a/llvm/include/llvm/ADT/SCCIterator.h b/llvm/include/llvm/ADT/SCCIterator.h index e89345c..9a8a7b1 100644 --- a/llvm/include/llvm/ADT/SCCIterator.h +++ b/llvm/include/llvm/ADT/SCCIterator.h @@ -26,6 +26,9 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/iterator.h" +#include +#include +#include #include namespace llvm { @@ -93,7 +96,7 @@ class scc_iterator : public iterator_facade_base< } /// End is when the DFS stack is empty. - scc_iterator() {} + scc_iterator() = default; public: static scc_iterator begin(const GraphT &G) { @@ -230,15 +233,15 @@ template scc_iterator scc_end(const T &G) { } /// \brief Construct the begin iterator for a deduced graph type T's Inverse. -template scc_iterator > scc_begin(const Inverse &G) { - return scc_iterator >::begin(G); +template scc_iterator> scc_begin(const Inverse &G) { + return scc_iterator>::begin(G); } /// \brief Construct the end iterator for a deduced graph type T's Inverse. -template scc_iterator > scc_end(const Inverse &G) { - return scc_iterator >::end(G); +template scc_iterator> scc_end(const Inverse &G) { + return scc_iterator>::end(G); } -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_ADT_SCCITERATOR_H diff --git a/llvm/include/llvm/ADT/SetVector.h b/llvm/include/llvm/ADT/SetVector.h index c6bc9bf..98b6476 100644 --- a/llvm/include/llvm/ADT/SetVector.h +++ b/llvm/include/llvm/ADT/SetVector.h @@ -20,12 +20,13 @@ #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 #include -#include +#include #include namespace llvm { @@ -52,7 +53,7 @@ public: 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 @@ -285,7 +286,7 @@ template class SmallSetVector : public SetVector, SmallDenseSet> { public: - SmallSetVector() {} + SmallSetVector() = default; /// \brief Initialize a SmallSetVector with a range of elements template @@ -294,7 +295,6 @@ public: } }; -} // End llvm namespace +} // end namespace llvm -// vim: sw=2 ai -#endif +#endif // LLVM_ADT_SETVECTOR_H diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h index 07bdf0c..6dac167 100644 --- a/llvm/include/llvm/ADT/SmallSet.h +++ b/llvm/include/llvm/ADT/SmallSet.h @@ -17,7 +17,11 @@ #include "llvm/ADT/None.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/Compiler.h" +#include +#include #include +#include namespace llvm { @@ -28,7 +32,7 @@ namespace llvm { /// /// Note that this set does not provide a way to iterate over members in the /// set. -template > +template > 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 @@ -45,7 +49,8 @@ class SmallSet { public: typedef size_t size_type; - SmallSet() {} + + SmallSet() = default; LLVM_NODISCARD bool empty() const { return Vector.empty() && Set.empty(); @@ -133,4 +138,4 @@ class SmallSet : public SmallPtrSet {}; } // end namespace llvm -#endif +#endif // LLVM_ADT_SMALLSET_H