Skip to content

Commit 0ac2069

Browse files
committed
Annotate more constructors.
1 parent 8d10e49 commit 0ac2069

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/include/llvm/ADT/ArrayRef.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,15 @@ namespace llvm {
7171

7272
/// Construct an ArrayRef from a single element.
7373
/*implicit*/ ArrayRef(const T &OneElt LLVM_LIFETIME_BOUND)
74-
: Data(&OneElt), Length(1) {}
74+
: Data(&OneElt), Length(1) {}
7575

7676
/// Construct an ArrayRef from a pointer and length.
77-
constexpr /*implicit*/ ArrayRef(const T *data, size_t length)
77+
constexpr /*implicit*/ ArrayRef(const T *data LLVM_LIFETIME_BOUND,
78+
size_t length)
7879
: Data(data), Length(length) {}
7980

8081
/// Construct an ArrayRef from a range.
81-
constexpr ArrayRef(const T *begin, const T *end)
82+
constexpr ArrayRef(const T *begin LLVM_LIFETIME_BOUND, const T *end)
8283
: Data(begin), Length(end - begin) {
8384
assert(begin <= end);
8485
}
@@ -114,7 +115,8 @@ namespace llvm {
114115
#pragma GCC diagnostic push
115116
#pragma GCC diagnostic ignored "-Winit-list-lifetime"
116117
#endif
117-
constexpr /*implicit*/ ArrayRef(std::initializer_list<T> Vec)
118+
constexpr /*implicit*/ ArrayRef(
119+
std::initializer_list<T> Vec LLVM_LIFETIME_BOUND)
118120
: Data(Vec.begin() == Vec.end() ? (T *)nullptr : Vec.begin()),
119121
Length(Vec.size()) {}
120122
#if LLVM_GNUC_PREREQ(9, 0, 0)

0 commit comments

Comments
 (0)