<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Sep 19, 2016 at 1:38 PM Sean Callanan <<a href="mailto:scallanan@apple.com">scallanan@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg">I'll only comment on the stuff that affects me.<div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"></div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><span id="m_4177169934230976198inbox-inbox-docs-internal-guid-68353e50-4408-e1e7-100e-f9ce9abc13e0" class="gmail_msg"><ol style="margin-top:0pt;margin-bottom:0pt" class="gmail_msg"><ol style="margin-top:0pt;margin-bottom:0pt" class="gmail_msg"><li style="list-style-type:lower-alpha;font-size:14.6667px;font-family:arial;vertical-align:baseline" class="gmail_msg"><div style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" class="gmail_msg"><span style="font-size:14.6667px;vertical-align:baseline;white-space:pre-wrap" class="gmail_msg">Use llvm streams instead of </span><span style="font-size:14.6667px;font-family:"courier new";vertical-align:baseline;white-space:pre-wrap" class="gmail_msg">lldb::StreamString</span></div></li><ol style="margin-top:0pt;margin-bottom:0pt" class="gmail_msg"><li style="list-style-type:lower-roman;font-size:14.6667px;font-family:arial;vertical-align:baseline" class="gmail_msg"><div style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" class="gmail_msg"><span style="font-size:14.6667px;vertical-align:baseline;white-space:pre-wrap" class="gmail_msg">Supports output re-targeting (stderr, stdout, std::string, etc), printf style formatting, and type-safe streaming operators.</span></div></li><li style="list-style-type:lower-roman;font-size:14.6667px;font-family:arial;vertical-align:baseline" class="gmail_msg"><div style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" class="gmail_msg"><span style="font-size:14.6667px;vertical-align:baseline;white-space:pre-wrap" class="gmail_msg">Interoperates nicely with many existing llvm utility classes</span></div></li><li style="list-style-type:lower-roman;font-size:14.6667px;font-family:arial;vertical-align:baseline" class="gmail_msg"><div style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" class="gmail_msg"><span style="font-size:14.6667px;vertical-align:baseline;white-space:pre-wrap" class="gmail_msg">Risk: 4</span></div></li><li style="list-style-type:lower-roman;font-size:14.6667px;font-family:arial;vertical-align:baseline" class="gmail_msg"><div style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" class="gmail_msg"><span style="font-size:14.6667px;vertical-align:baseline;white-space:pre-wrap" class="gmail_msg">Impact: 5</span></div></li><li style="list-style-type:lower-roman;font-size:14.6667px;font-family:arial;vertical-align:baseline" class="gmail_msg"><div style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" class="gmail_msg"><span style="font-size:14.6667px;vertical-align:baseline;white-space:pre-wrap" class="gmail_msg">Difficulty / Effort: 7</span></div></li></ol></ol></ol></span></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">I don't like that llvm's stringstream needs to be babied to make it produce its string.  You have to wrap it and then flush it and then read the string.  Maybe a subclass could be made that wraps its own string and flushes automatically on read?</div></div></div></div></blockquote><div><br></div><div>You do have to wrap it.  But if you call llvm::raw_string_ostream::str(), it will internally flush before it returns the thing.  So if you write:</div><div><br></div><div>std::string s;</div><div>llvm::raw_string_ostream stream(s);</div><div>stream << "foo";</div><div>return stream.str();</div><div><br></div><div>then the code will be correct.  It's still a bit more annoying then if the string were automatically part of the stream though, so there's probably a clean way to design a version of it that owns the string.</div></div></div>