<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 12, 2014 at 8:26 PM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 12/06/2014 21:31, Chandler Carruth wrote:<div class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Thu, Jun 12, 2014 at 5:21 PM, James Molloy <<a href="mailto:james@jamesmolloy.co.uk" target="_blank">james@jamesmolloy.co.uk</a> <mailto:<a href="mailto:james@jamesmolloy.co.uk" target="_blank">james@jamesmolloy.co.<u></u>uk</a>>> wrote:<br>

<br>
    FWIW, I like Alp's suggestion. There are a bunch of ways to do<br>
    string building in LLVM (Twine, raw_string_ostream,<br>
    std::stringstream). I'd appreciate a single mechanism for making<br>
    strings.<br>
<br>
<br>
But that's not what we would get.<br>
</blockquote>
<br></div>
I think you're taking an extreme and isolated view on this one Chandler.</blockquote><div><br></div><div>Dave independently wrote almost the exact same thing.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 What James describes is exactly what we get from the proposed patch.<br></blockquote><div><br></div><div>We disagree here.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I've gone ahead and produced examples of invalid string access, and demonstrated how the patch fixes each of these:<br></blockquote><div><br></div><div>Yes, two bugs in debugging code. Both of which would also be avoided by the simpler suggestion I already made. I continue to believe the simpler suggestion could be made to work equally well with stack based storage.</div>
<div><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=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
, and it's going to be quite far from replacing the use cases of Twine.<br>
</blockquote>
<br></div>
The latest iteration of the patch is actually a very worthwhile Twine alternative if you're hitting string lifetime issues with that.<br>
<br>
Anyway, shouldn't we be working to make the LLVM interfaces safer and more efficient for developers?<br></blockquote><div><br></div><div>We are. Part of that is code review. Currently, I don't see any strong consensus that your proposal is the right tradeoff, and an alternative has been proposed in code review that hasn't really been explored. I'm not sure what more you want, but I don't think that this thread is a basis for "moving forward" at all.</div>
</div></div></div>