Change raw_svector_ostream to reserve the input buffer if necessary, Ted was
[oota-llvm.git] / include / llvm / Support / raw_ostream.h
index ed06dbf42e40d74d27b0a227f9d86d864b0dac93..dc496d46e054a7e32f106eec73c9f12dadb626c2 100644 (file)
@@ -454,10 +454,14 @@ class raw_svector_ostream : public raw_ostream {
 public:
   /// Construct a new raw_svector_ostream.
   ///
-  /// \arg O - The vector to write to; this *must* have at least 128 bytes of
-  /// free space in it.
+  /// \arg O - The vector to write to; this should generally have at least 128
+  /// bytes free to avoid any extraneous memory overhead.
   explicit raw_svector_ostream(SmallVectorImpl<char> &O);
   ~raw_svector_ostream();
+
+  /// str - Flushes the stream contents to the target vector and return a
+  /// StringRef for the vector contents.
+  StringRef str();
 };
 
 /// raw_null_ostream - A raw_ostream that discards all output.