From e69170a11079504e1b20ec79296925f295dc01c0 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. llvm-svn: 211814 --- llvm/lib/Support/CommandLine.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'llvm/lib/Support/CommandLine.cpp') diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index e28e1d17638..c2b739fa736 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/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) -- cgit v1.2.3