/usr/include/llvm-3.9/llvm/ADT/Sequence.h is in llvm-3.9-dev 1:3.9.1-19ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | //===- Sequence.h - Utility for producing sequences of values ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
/// \file
/// This routine provides some synthesis utilities to produce sequences of
/// values. The names are intentionally kept very short as they tend to occur
/// in common and widely used contexts.
///
//===----------------------------------------------------------------------===//
#ifndef LLVM_ADT_SEQ_H
#define LLVM_ADT_SEQ_H
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
namespace llvm {
namespace detail {
template <typename ValueT>
class value_sequence_iterator
: public iterator_facade_base<value_sequence_iterator<ValueT>,
std::random_access_iterator_tag,
const ValueT> {
typedef typename value_sequence_iterator::iterator_facade_base BaseT;
ValueT Value;
public:
typedef typename BaseT::difference_type difference_type;
typedef typename BaseT::reference reference;
value_sequence_iterator() = default;
value_sequence_iterator(const value_sequence_iterator &) = default;
value_sequence_iterator(value_sequence_iterator &&Arg)
: Value(std::move(Arg.Value)) {}
template <typename U, typename Enabler = decltype(ValueT(std::declval<U>()))>
value_sequence_iterator(U &&Value) : Value(std::forward<U>(Value)) {}
value_sequence_iterator &operator+=(difference_type N) {
Value += N;
return *this;
}
value_sequence_iterator &operator-=(difference_type N) {
Value -= N;
return *this;
}
using BaseT::operator-;
difference_type operator-(const value_sequence_iterator &RHS) const {
return Value - RHS.Value;
}
bool operator==(const value_sequence_iterator &RHS) const {
return Value == RHS.Value;
}
bool operator<(const value_sequence_iterator &RHS) const {
return Value < RHS.Value;
}
reference operator*() const { return Value; }
};
} // End detail namespace.
template <typename ValueT>
iterator_range<detail::value_sequence_iterator<ValueT>> seq(ValueT Begin,
ValueT End) {
return make_range(detail::value_sequence_iterator<ValueT>(Begin),
detail::value_sequence_iterator<ValueT>(End));
}
}
#endif
|