aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/ADT/SetVector.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/SetVector.h')
-rw-r--r--include/llvm/ADT/SetVector.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/ADT/SetVector.h b/include/llvm/ADT/SetVector.h
index 4dc18bc52178..13378aa3a04e 100644
--- a/include/llvm/ADT/SetVector.h
+++ b/include/llvm/ADT/SetVector.h
@@ -119,6 +119,12 @@ public:
return vector_.rend();
}
+ /// \brief Return the first element of the SetVector.
+ const T &front() const {
+ assert(!empty() && "Cannot call front() on empty SetVector!");
+ return vector_.front();
+ }
+
/// \brief Return the last element of the SetVector.
const T &back() const {
assert(!empty() && "Cannot call back() on empty SetVector!");
@@ -232,7 +238,7 @@ public:
bool operator!=(const SetVector &that) const {
return vector_ != that.vector_;
}
-
+
/// \brief Compute This := This u S, return whether 'This' changed.
/// TODO: We should be able to use set_union from SetOperations.h, but
/// SetVector interface is inconsistent with DenseSet.