[PATCH] D27262: Add front() method to SetVector.

Jan Sjödin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 09:20:16 PST 2016


jsjodin created this revision.
jsjodin added reviewers: arsenm, tstellarAMD.
jsjodin added a subscriber: llvm-commits.
Herald added a subscriber: wdng.

This will later be needed by the Machine CFG Structurizer.


https://reviews.llvm.org/D27262

Files:
  include/llvm/ADT/SetVector.h


Index: include/llvm/ADT/SetVector.h
===================================================================
--- include/llvm/ADT/SetVector.h
+++ include/llvm/ADT/SetVector.h
@@ -112,6 +112,12 @@
     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!");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27262.79764.patch
Type: text/x-patch
Size: 565 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161130/d28de941/attachment.bin>


More information about the llvm-commits mailing list