diff options
author | Alp Toker <alp@nuanti.com> | 2014-06-26 22:52:05 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-06-26 22:52:05 +0000 |
commit | 8dd8d5c2b2ad0f9dd1ca01c0a7d8ebac57b8537d (patch) | |
tree | 7da91c52380a71a92a895b0c172ae28b83fb6011 /lib/Support | |
parent | eca517deaa890b1658ed0452704f398ce80e47b8 (diff) | |
download | llvm-8dd8d5c2b2ad0f9dd1ca01c0a7d8ebac57b8537d.tar.gz llvm-8dd8d5c2b2ad0f9dd1ca01c0a7d8ebac57b8537d.tar.bz2 llvm-8dd8d5c2b2ad0f9dd1ca01c0a7d8ebac57b8537d.tar.xz |
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
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/CommandLine.cpp | 34 | ||||
-rw-r--r-- | lib/Support/raw_ostream.cpp | 4 |
2 files changed, 19 insertions, 19 deletions
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<T>::printOptionDiff(const Option &O, T V, OptionValue<T> 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<T>:: \ + printOptionDiff(const Option &O, T V, OptionValue<T> 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<char> &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 |