From 8dd8d5c2b2ad0f9dd1ca01c0a7d8ebac57b8537d Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Thu, 26 Jun 2014 22:52:05 +0000 Subject: Revert "Introduce a string_ostream string builder facilty" Temporarily back out commits r211749, r211752 and r211754. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211814 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/CommandLine.cpp | 34 +++++++++++++++++++--------------- lib/Support/raw_ostream.cpp | 4 ---- 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'lib/Support') diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index e28e1d1763..c2b739fa73 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -1342,21 +1342,25 @@ printGenericOptionDiff(const Option &O, const GenericOptionValue &Value, // printOptionDiff - Specializations for printing basic value types. // -#define PRINT_OPT_DIFF(T) \ - void parser::printOptionDiff(const Option &O, T V, OptionValue D, \ - size_t GlobalWidth) const { \ - printOptionName(O, GlobalWidth); \ - string_ostream SS; \ - SS << V; \ - outs() << "= " << SS.str(); \ - size_t NumSpaces = MaxOptWidth > SS.tell() ? MaxOptWidth - SS.tell() : 0; \ - outs().indent(NumSpaces) << " (default: "; \ - if (D.hasValue()) \ - outs() << D.getValue(); \ - else \ - outs() << "*no default*"; \ - outs() << ")\n"; \ - } +#define PRINT_OPT_DIFF(T) \ + void parser:: \ + printOptionDiff(const Option &O, T V, OptionValue D, \ + size_t GlobalWidth) const { \ + printOptionName(O, GlobalWidth); \ + std::string Str; \ + { \ + raw_string_ostream SS(Str); \ + SS << V; \ + } \ + outs() << "= " << Str; \ + size_t NumSpaces = MaxOptWidth > Str.size() ? MaxOptWidth - Str.size() : 0;\ + outs().indent(NumSpaces) << " (default: "; \ + if (D.hasValue()) \ + outs() << D.getValue(); \ + else \ + outs() << "*no default*"; \ + outs() << ")\n"; \ + } \ PRINT_OPT_DIFF(bool) PRINT_OPT_DIFF(boolOrDefault) diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index b3f3056ba6..f7c213ac2b 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -704,10 +704,6 @@ void raw_string_ostream::write_impl(const char *Ptr, size_t Size) { // and we only need to set the vector size when the data is flushed. raw_svector_ostream::raw_svector_ostream(SmallVectorImpl &O) : OS(O) { - init(); -} - -void raw_svector_ostream::init() { // Set up the initial external buffer. We make sure that the buffer has at // least 128 bytes free; raw_ostream itself only requires 64, but we want to // make sure that we don't grow the buffer unnecessarily on destruction (when -- cgit v1.2.3