I forgot to initialize NameLen. :-/<div><div><br><div>I stored 'Name' as start+size because I saw that pattern in lib/Basic/DiagnosticID.h, and assumed it was expected. Storing a StringRef makes more sense to me. Here's an updated patch. Clang builds successfully, and hopefully the tests will pass.</div>

<div><br></div><div>ZJ<br><br><div class="gmail_quote">

On Thu, Jun 30, 2011 at 4:04 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div><br>
On Jun 30, 2011, at 11:47 AM, Zach Wheeler wrote:<br>
<br>
> This patch changes the return type of Option::getName() from const char* to StringRef, doing away with the need for several calls to strlen.<br>
> Clang builds fine with these changes.<br>
<br>
</div>THis patch looks reasonable, except that it completely breaks the testsuite :).  Please track down the bug and resubmit a patch.  Also, why not just embed a 'Name' StringRef in Option.h instead of storing the start+size?<br>




<font color="#888888"><br>
-Chris<br>
<br>
</font></blockquote></div><br></div>
</div></div>