<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 5, 2015 at 4:24 PM, Frederic Riss <span dir="ltr"><<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">REPOSITORY<br>
  rL LLVM<br>
<br>
================<br>
Comment at: lib/DebugInfo/DWARFDebugInfoEntry.cpp:44-47<br>
@@ -41,2 +43,6 @@<br>
     uint32_t abbrCode = debug_info_data.getULEB128(&offset);<br>
+    {<br>
+      WithColor C(OS, syntax::Address);<br>
+      OS << format("\n0x%8.8x: ", Offset);<br>
+    }<br>
<br>
----------------<br>
I'm not too fond of all the extra scopes, dunno what others think.<br>
<br>
If this could be implemented too look like:<br>
```<br>
WithColor(OS, syntax::Address) << format("\n0x%8.8x: ", Offset);</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
```<br>
I think I'd prefer that (not sure if just adding a conversion operator from WithColor to raw_ostream would do the trick).<br></blockquote><div> </div><div><div>Alternatively you can (ab)use the comma operator with the existing scoped device you have:<br><br>WithColor(OS, syntax::Address), OS << format(...)<br><br>But to remove the 'get' call and avoid the extra OS reference, you can probably have "WithColor" return an object that's implicitly convertible to ostream. (that does mean the op<< you then call must be a non-member function (they shoudl be anyway, you might have to make some non-members that are members))</div><br>I believe that should work...<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5"><br>
<a href="http://reviews.llvm.org/D6852" target="_blank">http://reviews.llvm.org/D6852</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>