<div dir="ltr">This seems like more than a performance fix - the API itself seems a little problematic. If buildSegments was called more than once on the same SegmentBuilder, tehre would be trouble, right? (before this patch, it could build on top of existing segments - after this patch it will use a moved-from-vector which might be in some non-empty state (moved from objects are in a "valid but unspecified" state - I'm not sure there's anything other than empty that a vector could be in, but it's still a bit subtle/risky))<br><br>Could the API be redesigned so it doesn't have this problem?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 4, 2016 at 8:07 AM, Igor Kudrin via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ikudrin created this revision.<br>
ikudrin added reviewers: bogner, davidxl.<br>
ikudrin added a subscriber: llvm-commits.<br>
<br>
<a href="http://reviews.llvm.org/D18756" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18756</a><br>
<br>
Files:<br>
  llvm/trunk/lib/ProfileData/CoverageMapping.cpp<br>
<br>
Index: llvm/trunk/lib/ProfileData/CoverageMapping.cpp<br>
===================================================================<br>
--- llvm/trunk/lib/ProfileData/CoverageMapping.cpp<br>
+++ llvm/trunk/lib/ProfileData/CoverageMapping.cpp<br>
@@ -341,7 +341,7 @@<br>
     // Pop any regions that are left in the stack.<br>
     while (!ActiveRegions.empty())<br>
       popRegion();<br>
-    return Segments;<br>
+    return std::move(Segments);<br>
   }<br>
 };<br>
 }<br>
<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>