Remove unused Target argument from AsmParser construction methods.
[oota-llvm.git] / include / llvm / ADT / SmallString.h
index 035462515a83e96d1a1e5be3edb89ff80fc0e7a6..da264164821f2a9bcf209e4641dae75a6e8aa8da 100644 (file)
@@ -27,6 +27,9 @@ public:
   // Default ctor - Initialize to empty.
   SmallString() {}
 
+  // Initialize from a StringRef.
+  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
+
   // Initialize with a range.
   template<typename ItTy>
   SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
@@ -38,12 +41,16 @@ public:
   // Extra methods.
   StringRef str() const { return StringRef(this->begin(), this->size()); }
 
-  const char *c_str() {
+  // TODO: Make this const, if it's safe...
+  const char* c_str() {
     this->push_back(0);
     this->pop_back();
     return this->data();
   }
-  
+
+  // Implicit conversion to StringRef.
+  operator StringRef() const { return str(); }
+
   // Extra operators.
   const SmallString &operator=(StringRef RHS) {
     this->clear();