<div dir="ltr">Thanks for the comments.  I think I understand more the utility of the project and why my first attempt is no good.  How about this patch?<div><br></div><div style>I'll try to keep an eye out for Arrayrefizations.  Could you point me to an example where this was recently done as you said?  (I'm still new to git and just did my first rebase.)</div>
<div style><br></div><div style>Thanks for helping the noob,</div><div style>Chris</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 21, 2013 at 11:35 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Sun, Apr 21, 2013 at 8:16 PM, Christopher Jones<br>
<<a href="mailto:chrisjones.lambda@gmail.com">chrisjones.lambda@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> This patch is pretty small and probably doesn't have much impact, but it's<br>
> my first one and I mainly want to make sure I have the workflow down.  I'd<br>
> appreciate any criticism.<br>
><br>
> This is a first attempt at the StringRef-ization open project.  If anyone<br>
> has any recommendations on which parts of the interface would be most useful<br>
> to start on, I'd appreciate it.<br>
<br>
</div>There's probably more value in changing parameter types rather than<br>
return types.<br>
<br>
(& I'd say there's probably more immediate value in ArrayRef-ization<br>
than StringRef-ization, maybe - especially in call sites that are<br>
passing magic constant "array size" parameters (some of these were<br>
just recently fixed in LLVM, for example), but for StringRefization,<br>
the value is in updating API/usage that may currently accept a "const<br>
std::string&" but never actually needs a string object (because both<br>
the caller passes in non-std::strings (string literals, for example)<br>
and the implementation doesn't use complex std::string operations))<br>
<div class="im"><br>
> Otherwise, I'll do something of a random<br>
> walk through the code.<br>
<br>
</div>Some of the code you've updated will leade to dangling StringRefs -<br>
several of the RewriteFilename functions return local variables - they<br>
will go out of scope at the end of the function & the caller will be<br>
left with a dangling StringRef. That's no good.<br>
<br>
><br>
> Thanks,<br>
> Chris<br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
</blockquote></div><br></div>