<div dir="ltr">I don't believe there's any correctness issue with passing Twine by value.<div><br>Not sure it'd even be a performance problem - the sizeof(Twine) looks like it'd be small enough (like StringRef - though a bit bigger, StringRef should be two words, Twine would be three) not to worry too much either way.<br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 30, 2019 at 12:14 AM Shoaib Meenai via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_-7228852921736580901WordSection1">
<p class="MsoNormal"><span style="font-size:11pt">Twine.h says twines should only be accepted as const references in arguments, but there are a bunch of functions that take Twine by value (e.g. you'll find lots of them in CGObjCMac.cpp in clang). Is this
just a potential performance issue, or are there potential correctness issues from passing a twine by value as well?<u></u><u></u></span></p>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>