Add 2x constructors for TinyPtrVector, one that takes in one elemenet and the other...
[oota-llvm.git] / include / llvm / ADT / TinyPtrVector.h
index e158f9d278b207074a186bca8b58cffa4523d5c2..15137f5ebf8c8a89530827c596233eaeb0c29862 100644 (file)
@@ -96,6 +96,13 @@ public:
     return *this;
   }
 
+  /// Constructor from a single element.
+  explicit TinyPtrVector(EltTy Elt) : Val(Elt) {}
+
+  /// Constructor from an ArrayRef.
+  explicit TinyPtrVector(ArrayRef<EltTy> Elts)
+      : Val(new VecTy(Elts.begin(), Elts.end())) {}
+
   // implicit conversion operator to ArrayRef.
   operator ArrayRef<EltTy>() const {
     if (Val.isNull())