<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 26, 2011, at 9:17 PM, Talin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Here's an example of how this would be used: In the constructor for ConstantVector, there's an assert:<div><br><div><div><div><font class="Apple-style-span" face="'courier new', monospace">  assert(C->getType() == T->getElementType() &&</font></div><div><font class="Apple-style-span" face="'courier new', monospace">         "Initializer for vector element doesn't match vector element type!");</font></div></div><div><br></div><div>I would change this to:</div><br><div><div><font class="Apple-style-span" face="'courier new', monospace">  ASSERT_STRM(C->getType() == T->getElementType(),</font></div><div><font class="Apple-style-span" face="'courier new', monospace">    "Initializer for vector element " << I - V.begin() << " with type " <<</font></div><div><font class="Apple-style-span" face="'courier new', monospace">    C->getType() << " doesn't match vector element type " <<</font></div><div><font class="Apple-style-span" face="'courier new', monospace">    T->getElementType());</font></div><div><br></div></div><div>With more detailed assertions like this, a much larger class of programmer errors can be diagnosed without having to go into the debugger.</div><div><br></div><div>Because the stream is a raw_ostream, LLVM types and values can easily be printed to the stream without having to convert them to string form.</div></div></div></span></blockquote><br></div><div>I'm unconvinced that this is worth it at all.  This is only going to allow you to "avoid going into the debugger" in the most trivial cases.</div><div><br></div><div>-Chris</div></body></html>