<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 9, 2016 at 12:07 PM, David Li 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">This revision was automatically updated to reflect the committed changes.<br>
Closed by commit rL260270: [PGO] Fix issue: explicitly defaulted assignop is not profiled (authored by davidxl).<br></blockquote><div><br></div><div>In general, if you send something out for review it's best to wait for explicit sign-off before committing. Sorry I hadn't taken a moment to look at the clang test you had added - again, got a bit lost in the noise of the discussion.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Changed prior to commit:<br>
  <a href="http://reviews.llvm.org/D16947?vs=47239&id=47351#toc" rel="noreferrer" target="_blank">http://reviews.llvm.org/D16947?vs=47239&id=47351#toc</a><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D16947" rel="noreferrer" target="_blank">http://reviews.llvm.org/D16947</a><br>
<br>
Files:<br>
  cfe/trunk/lib/CodeGen/CGClass.cpp<br>
  cfe/trunk/test/Profile/def-assignop.cpp<br>
<br>
Index: cfe/trunk/test/Profile/def-assignop.cpp<br>
===================================================================<br>
--- cfe/trunk/test/Profile/def-assignop.cpp<br>
+++ cfe/trunk/test/Profile/def-assignop.cpp<br>
@@ -0,0 +1,32 @@<br>
+// RUN: %clang_cc1 -x c++ -std=c++11 %s -triple x86_64-unknown-linux-gnu -main-file-name def-assignop.cpp -o - -emit-llvm -fprofile-instrument=clang | FileCheck --check-prefix=PGOGEN %s<br>
+// RUN: %clang_cc1 -x c++ -std=c++11 %s -triple x86_64-unknown-linux-gnu -main-file-name def-assignop.cpp -o - -emit-llvm -fprofile-instrument=clang -fcoverage-mapping | FileCheck --check-prefix=COVMAP %s<br>
+<br>
+struct B {<br>
<span class="">+  B& operator=(const B &b);<br>
+  B& operator=(const B &&b);<br>
+};<br>
+<br>
+struct A {<br>
</span><span class="">+  A &operator=(const A &) = default;<br>
</span><span class="">+  // PGOGEN: define {{.*}}@_ZN1AaSERKS_(<br>
</span>+  // PGOGEN: %pgocount = load {{.*}} @__profc__ZN1AaSERKS_<br>
+  // PGOGEN: {{.*}}add{{.*}}%pgocount, 1<br>
+  // PGOGEN: store{{.*}}@__profc__ZN1AaSERKS_<br>
<span class="">+  A &operator=(A &&) = default;<br>
+  // PGOGEN: define {{.*}}@_ZN1AaSEOS_<br>
+  // PGOGEN: %pgocount = load {{.*}} @__profc__ZN1AaSEOS_<br>
+  // PGOGEN: {{.*}}add{{.*}}%pgocount, 1<br>
+  // PGOGEN: store{{.*}}@__profc__ZN1AaSEOS_<br>
+<br>
+  // Check that coverage mapping includes 6 function records including the<br>
+  // defaulted copy and move operators: A::operator=<br>
</span>+  // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }, [3 x <{{.*}}>],<br>
<span class="">+  B b;<br>
+};<br>
+<br>
+int main() {<br>
+  A a1, a2;<br>
+  a1 = a2;<br>
+  a2 = static_cast<A &&>(a1);<br>
</span>+  return 0;<br>
+}<br>
Index: cfe/trunk/lib/CodeGen/CGClass.cpp<br>
===================================================================<br>
--- cfe/trunk/lib/CodeGen/CGClass.cpp<br>
+++ cfe/trunk/lib/CodeGen/CGClass.cpp<br>
<div class="HOEnZb"><div class="h5">@@ -1608,6 +1608,7 @@<br>
<br>
   LexicalScope Scope(*this, RootCS->getSourceRange());<br>
<br>
+  incrementProfileCounter(RootCS);<br>
   AssignmentMemcpyizer AM(*this, AssignOp, Args);<br>
   for (auto *I : RootCS->body())<br>
     AM.emitAssignment(I);<br>
<br>
<br>
</div></div><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></div>