diff options
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/GraphWriter.h | 3 | ||||
-rw-r--r-- | include/llvm/Support/YAMLTraits.h | 3 | ||||
-rw-r--r-- | include/llvm/Support/raw_ostream.h | 30 |
3 files changed, 6 insertions, 30 deletions
diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h index a6bd1afa16..2f02aa7a1c 100644 --- a/include/llvm/Support/GraphWriter.h +++ b/include/llvm/Support/GraphWriter.h @@ -184,7 +184,8 @@ public: O << "|" << DOT::EscapeString(NodeDesc); } - string_ostream EdgeSourceLabels; + std::string edgeSourceLabels; + raw_string_ostream EdgeSourceLabels(edgeSourceLabels); bool hasEdgeSourceLabels = getEdgeSourceLabels(EdgeSourceLabels, Node); if (hasEdgeSourceLabels) { diff --git a/include/llvm/Support/YAMLTraits.h b/include/llvm/Support/YAMLTraits.h index 14ca2db932..a23faf65bb 100644 --- a/include/llvm/Support/YAMLTraits.h +++ b/include/llvm/Support/YAMLTraits.h @@ -612,7 +612,8 @@ template<typename T> typename std::enable_if<has_ScalarTraits<T>::value,void>::type yamlize(IO &io, T &Val, bool) { if ( io.outputting() ) { - llvm::string_ostream Buffer; + std::string Storage; + llvm::raw_string_ostream Buffer(Storage); ScalarTraits<T>::output(Val, io.getContext(), Buffer); StringRef Str = Buffer.str(); io.scalarString(Str, ScalarTraits<T>::mustQuote(Str)); diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h index ceabf88a57..34fbe082cd 100644 --- a/include/llvm/Support/raw_ostream.h +++ b/include/llvm/Support/raw_ostream.h @@ -15,12 +15,13 @@ #define LLVM_SUPPORT_RAW_OSTREAM_H #include "llvm/ADT/StringRef.h" -#include "llvm/ADT/SmallVector.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/DataTypes.h" namespace llvm { class format_object_base; + template <typename T> + class SmallVectorImpl; namespace sys { namespace fs { @@ -460,14 +461,6 @@ class raw_svector_ostream : public raw_ostream { /// current_pos - Return the current position within the stream, not /// counting the bytes currently in the buffer. uint64_t current_pos() const override; - -protected: - // This constructor is specified not to access \p O provided for storage as it - // may not yet be initialized at construction time. - explicit raw_svector_ostream(SmallVectorImpl<char> &O, std::nullptr_t) - : OS(O){}; - void init(); - public: /// Construct a new raw_svector_ostream. /// @@ -500,25 +493,6 @@ public: ~raw_null_ostream(); }; -/// string_ostream - A raw_ostream that builds a string. This is a -/// raw_svector_ostream with storage. -template <unsigned InternalLen> -class small_string_ostream : public raw_svector_ostream { - SmallVector<char, InternalLen> Buffer; - // There's no need to flush explicitly. - using raw_svector_ostream::flush; - -public: - small_string_ostream() : raw_svector_ostream(Buffer, nullptr) { init(); } - - void clear() { - flush(); - Buffer.clear(); - } -}; - -typedef small_string_ostream<128> string_ostream; - } // end llvm namespace #endif |