diff options
| author | Zachary Turner <zturner@google.com> | 2016-08-30 18:19:18 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2016-08-30 18:19:18 +0000 |
| commit | fc6e880d6d989b7220fcfe86449da56e63ce813e (patch) | |
| tree | 91724960ebcd5fd30172e461ef2eb3a896863461 /llvm | |
| parent | 61aca6ef798aa918833be6125d4600cb95a585ce (diff) | |
| download | bcm5719-llvm-fc6e880d6d989b7220fcfe86449da56e63ce813e.tar.gz bcm5719-llvm-fc6e880d6d989b7220fcfe86449da56e63ce813e.zip | |
Rename ArrayRef::keep_front / keep_back to take_front / take_back.
The name decided on was take_, but I only updated it for StringRef
and forgot to do it for ArrayRef.
llvm-svn: 280126
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/ADT/ArrayRef.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h index 47e1398b5df..c1d66c69903 100644 --- a/llvm/include/llvm/ADT/ArrayRef.h +++ b/llvm/include/llvm/ADT/ArrayRef.h @@ -195,17 +195,17 @@ namespace llvm { return slice(0, size() - N); } - /// \brief Keep the first \p N elements of the array. + /// \brief Return a copy of *this with only the first \p N elements. LLVM_ATTRIBUTE_UNUSED_RESULT - ArrayRef<T> keep_front(size_t N = 1) const { + ArrayRef<T> take_front(size_t N = 1) const { if (N >= size()) return *this; return drop_back(size() - N); } - /// \brief Keep the last \p N elements of the array. + /// \brief Return a copy of *this with only the last \p N elements. LLVM_ATTRIBUTE_UNUSED_RESULT - ArrayRef<T> keep_back(size_t N = 1) const { + ArrayRef<T> take_back(size_t N = 1) const { if (N >= size()) return *this; return drop_front(size() - N); @@ -337,17 +337,17 @@ namespace llvm { return slice(0, this->size() - N); } - /// \brief Drop everything but the first \p N elements of the array. + /// \brief Return a copy of *this with only the first \p N elements. LLVM_ATTRIBUTE_UNUSED_RESULT - MutableArrayRef<T> keep_front(size_t N = 1) const { + MutableArrayRef<T> take_front(size_t N = 1) const { if (N >= this->size()) return *this; return drop_back(this->size() - N); } - /// \brief Drop everything but the last \p N elements of the array. + /// \brief Return a copy of *this with only the last \p N elements. LLVM_ATTRIBUTE_UNUSED_RESULT - MutableArrayRef<T> keep_back(size_t N = 1) const { + MutableArrayRef<T> take_back(size_t N = 1) const { if (N >= this->size()) return *this; return drop_front(this->size() - N); |

