LLVM  6.0.0svn
Classes | Namespaces | Typedefs | Functions | Variables
STLExtras.h File Reference
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdlib>
#include <functional>
#include <iterator>
#include <limits>
#include <memory>
#include <tuple>
#include <utility>
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
Include dependency graph for STLExtras.h:

Go to the source code of this file.

Classes

struct  llvm::SameType< T, T >
 
struct  llvm::identity< Ty >
 
struct  llvm::less_ptr< Ty >
 
struct  llvm::greater_ptr< Ty >
 
class  llvm::function_ref< Fn >
 An efficient, type-erasing, non-owning reference to a callable. More...
 
class  llvm::function_ref< Ret(Params...)>
 
class  llvm::mapped_iterator< RootIt, UnaryFunc >
 
class  llvm::has_rbegin_impl< Ty >
 Helper to determine if type T has a member called rbegin(). More...
 
struct  llvm::has_rbegin< Ty >
 Metafunction to determine if T& or T has a member called rbegin(). More...
 
class  llvm::filter_iterator< WrappedIteratorT, PredicateT >
 An iterator adaptor that filters the elements of given inner iterators. More...
 
struct  llvm::index_sequence< I >
 Alias for the common case of a sequence of size_ts. More...
 
struct  llvm::index_sequence_for< Ts >
 Creates a compile-time integer sequence for a parameter pack. More...
 
struct  llvm::detail::ZipTupleType< Iters >
 
struct  llvm::detail::zip_common< ZipType, Iters >
 
struct  llvm::detail::zip_first< Iters >
 
class  llvm::detail::zip_shortest< Iters >
 
class  llvm::detail::zippy< ItType, Args >
 
class  llvm::concat_iterator< ValueT, IterTs >
 Iterator wrapper that concatenates sequences together. More...
 
class  llvm::detail::concat_range< ValueT, RangeTs >
 Helper to store a sequence of ranges being concatenated and access them. More...
 
struct  llvm::less_first
 Function object to check whether the first component of a std::pair compares less than the first component of another std::pair. More...
 
struct  llvm::less_second
 Function object to check whether the second component of a std::pair compares less than the second component of another std::pair. More...
 
struct  llvm::integer_sequence< T, I >
 Represents a compile-time sequence of integers. More...
 
struct  llvm::index_sequence< I >
 Alias for the common case of a sequence of size_ts. More...
 
struct  llvm::build_index_impl< N, I >
 
struct  llvm::build_index_impl< 0, I... >
 
struct  llvm::index_sequence_for< Ts >
 Creates a compile-time integer sequence for a parameter pack. More...
 
struct  llvm::rank< N >
 Utility type to build an inheritance chain that makes it easy to rank overload candidates. More...
 
struct  llvm::rank< 0 >
 
struct  llvm::is_one_of< T, Ts >
 traits class for checking whether type T is one of any of the given types in the variadic list. More...
 
struct  llvm::is_one_of< T, U, Ts... >
 
struct  llvm::are_base_of< T, Ts >
 traits class for checking whether type T is a base class for all the given types in the variadic list. More...
 
struct  llvm::are_base_of< T, U, Ts... >
 
struct  llvm::FreeDeleter
 
struct  llvm::pair_hash< First, Second >
 
struct  llvm::less
 A functor like C++14's std::less<void> in its absence. More...
 
struct  llvm::equal
 A functor like C++14's std::equal<void> in its absence. More...
 
struct  llvm::deref< T >
 Binary functor that adapts to any other binary functor after dereferencing operands. More...
 
class  llvm::detail::enumerator_iter< R >
 
struct  llvm::detail::result_pair< R >
 
class  llvm::detail::enumerator_iter< R >
 
class  llvm::detail::enumerator< R >
 

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 
 llvm::detail
 Implementation details of the pass manager interfaces.
 

Typedefs

template<typename RangeT >
using llvm::detail::IterOfRange = decltype(std::begin(std::declval< RangeT & >()))
 
template<typename RangeT >
using llvm::detail::ValueOfRange = typename std::remove_reference< decltype(*std::begin(std::declval< RangeT & >()))>::type
 
template<typename ZipType , typename... Iters>
using llvm::detail::zip_traits = iterator_facade_base< ZipType, typename std::common_type< std::bidirectional_iterator_tag, typename std::iterator_traits< Iters >::iterator_category... >::type, typename ZipTupleType< Iters... >::type, typename std::iterator_traits< typename std::tuple_element< 0, std::tuple< Iters... > >::type >::difference_type, typename ZipTupleType< Iters... >::type *, typename ZipTupleType< Iters... >::type >
 

Functions

template<class T >
void llvm::deleter (T *Ptr)
 
template<class Iterator , class Func >
mapped_iterator< Iterator, Func > llvm::operator+ (typename mapped_iterator< Iterator, Func >::difference_type N, const mapped_iterator< Iterator, Func > &X)
 
template<class ItTy , class FuncTy >
mapped_iterator< ItTy, FuncTy > llvm::map_iterator (const ItTy &I, FuncTy F)
 
template<typename ContainerTy >
auto llvm::reverse (ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
 
template<typename IteratorTy >
std::reverse_iterator< IteratorTy > llvm::make_reverse_iterator (IteratorTy It)
 
template<typename ContainerTy >
auto llvm::reverse (ContainerTy &&C, typename std::enable_if<!has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(llvm::make_reverse_iterator(std::end(C)), llvm::make_reverse_iterator(std::begin(C))))
 
template<typename RangeT , typename PredicateT >
iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > llvm::make_filter_range (RangeT &&Range, PredicateT Pred)
 Convenience function that takes a range of elements and a predicate, and return a new filter_iterator range. More...
 
template<typename R , typename UnaryPredicate >
bool llvm::all_of (R &&Range, UnaryPredicate P)
 Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename T , typename U , typename... Args>
detail::zippy< detail::zip_shortest, T, U, Args... > llvm::zip (T &&t, U &&u, Args &&... args)
 zip iterator for two or more iteratable types. More...
 
template<typename T , typename U , typename... Args>
detail::zippy< detail::zip_first, T, U, Args... > llvm::zip_first (T &&t, U &&u, Args &&... args)
 zip iterator that, for the sake of efficiency, assumes the first iteratee to be the shortest. More...
 
template<typename ValueT , typename... RangeTs>
detail::concat_range< ValueT, RangeTs... > llvm::concat (RangeTs &&... Ranges)
 Concatenated range across two or more ranges. More...
 
template<class T , std::size_t N>
constexpr size_t llvm::array_lengthof (T(&)[N])
 Find the length of an array. More...
 
template<typename T >
int llvm::array_pod_sort_comparator (const void *P1, const void *P2)
 Adapt std::less<T> for array_pod_sort. More...
 
template<class IteratorTy >
void llvm::array_pod_sort (IteratorTy Start, IteratorTy End)
 array_pod_sort - This sorts an array with the specified start and end extent. More...
 
template<class IteratorTy >
void llvm::array_pod_sort (IteratorTy Start, IteratorTy End, int(*Compare)(const typename std::iterator_traits< IteratorTy >::value_type *, const typename std::iterator_traits< IteratorTy >::value_type *))
 
template<typename Container >
void llvm::DeleteContainerPointers (Container &C)
 For a container of pointers, deletes the pointers and then clears the container. More...
 
template<typename Container >
void llvm::DeleteContainerSeconds (Container &C)
 In a container of pairs (usually a map) whose second element is a pointer, deletes the second elements and then clears the container. More...
 
template<typename R , typename UnaryPredicate >
bool llvm::any_of (R &&Range, UnaryPredicate P)
 Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename UnaryPredicate >
bool llvm::none_of (R &&Range, UnaryPredicate P)
 Provide wrappers to std::none_of which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename T >
auto llvm::find (R &&Range, const T &Val) -> decltype(std::begin(Range))
 Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename UnaryPredicate >
auto llvm::find_if (R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
 Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename UnaryPredicate >
auto llvm::find_if_not (R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
 
template<typename R , typename UnaryPredicate >
auto llvm::remove_if (R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
 Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename OutputIt , typename UnaryPredicate >
OutputIt llvm::copy_if (R &&Range, OutputIt Out, UnaryPredicate P)
 Provide wrappers to std::copy_if which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename E >
bool llvm::is_contained (R &&Range, const E &Element)
 Wrapper function around std::find to detect if an element exists in a container. More...
 
template<typename R , typename E >
auto llvm::count (R &&Range, const E &Element) -> typename std::iterator_traits< decltype(std::begin(Range))>::difference_type
 Wrapper function around std::count to count the number of times an element Element occurs in the given range Range. More...
 
template<typename R , typename UnaryPredicate >
auto llvm::count_if (R &&Range, UnaryPredicate P) -> typename std::iterator_traits< decltype(std::begin(Range))>::difference_type
 Wrapper function around std::count_if to count the number of times an element satisfying a given predicate occurs in a range. More...
 
template<typename R , typename OutputIt , typename UnaryPredicate >
OutputIt llvm::transform (R &&Range, OutputIt d_first, UnaryPredicate P)
 Wrapper function around std::transform to apply a function to a range and store the result elsewhere. More...
 
template<typename R , typename UnaryPredicate >
auto llvm::partition (R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
 Provide wrappers to std::partition which take ranges instead of having to pass begin/end explicitly. More...
 
template<unsigned Size, typename R >
SmallVector< typename std::remove_const< detail::ValueOfRange< R > >::type, Size > llvm::to_vector (R &&Range)
 Given a range of type R, iterate the entire range and return a SmallVector with elements of the vector. More...
 
template<typename Container , typename UnaryPredicate >
void llvm::erase_if (Container &C, UnaryPredicate P)
 Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent to: More...
 
template<class T , class... Args>
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type llvm::make_unique (Args &&... args)
 Constructs a new T() with the given args and returns a unique_ptr<T> which owns the object. More...
 
template<class T >
std::enable_if< std::is_array< T >::value &&std::extent< T >::value==0, std::unique_ptr< T > >::type llvm::make_unique (size_t n)
 Constructs a new T[n] with the given args and returns a unique_ptr<T[]> which owns the object. More...
 
template<class T , class... Args>
std::enable_if< std::extent< T >::value !=0 >::type llvm::make_unique (Args &&...)=delete
 This function isn't used and is only here to provide better compile errors. More...
 
template<typename R >
detail::enumerator< R > llvm::enumerate (R &&TheRange)
 Given an input range, returns a new range whose values are are pair (A,B) such that A is the 0-based index of the item in the sequence, and B is the value from the original sequence. More...
 
template<typename F , typename Tuple , std::size_t... I>
auto llvm::detail::apply_tuple_impl (F &&f, Tuple &&t, index_sequence< I... >) -> decltype(std::forward< F >(f)(std::get< I >(std::forward< Tuple >(t))...))
 
template<typename F , typename Tuple >
auto llvm::apply_tuple (F &&f, Tuple &&t) -> decltype(detail::apply_tuple_impl(std::forward< F >(f), std::forward< Tuple >(t), build_index_impl< std::tuple_size< typename std::decay< Tuple >::type >::value >
 Given an input tuple (a1, a2, ..., an), pass the arguments of the tuple variadically to f as if by calling f(a1, a2, ..., an) and return the result. More...
 

Variables

template<typename T >
int(*)(const void *, const void *) llvm::get_array_pod_sort_comparator (const T &)
 get_array_pod_sort_comparator - This is an internal helper function used to get type deduction of T right. More...