The way `-ftest-coverage -fprofile-arcs` works at the moment it only flushes via `atexit()`. This patch allows you to flush the coverage at any point by calling `__llvm_gcov_flush` the same way `__gcov_flush` works for gcc. <div>
<br></div><div>If there is another way of doing this, I might of missed it but I was looking for `__gcov_flush` and I did not find the equivalent in llvm at the moment. <br><div><br clear="all"><div>--<div>John Harrison</div>
</div>
<br><br><div class="gmail_quote">On Tue, Feb 5, 2013 at 11:26 PM, Bill Wendling <span dir="ltr"><<a href="mailto:wendling@apple.com" target="_blank">wendling@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">We do have a gcov "flush" implementation. It should be emitted with the normal coverage code. Is it not showing up?<div><br></div><div>-bw</div><div><br><div><div><div class="h5">
<div>On Feb 5, 2013, at 4:20 PM, John Harrison <<a href="mailto:ash.gti@gmail.com" target="_blank">ash.gti@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div><div class="h5"><div>Hi,</div><div>
<br>
</div><div>I ran into the bug/feature request that you cannot flush gcov buffers while the app is running. They are only called when you exit the program, since the flush functions are registered with atexit(). This is the bug report: <a href="http://llvm.org/bugs/show_bug.cgi?id=12144" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=12144</a></div>
<div><br></div><div>I have what I think is a basic implementation of the `__gcov_flush` call, although I called this version `__llvm_gcov_flush`. Here is the diff <a href="https://gist.github.com/ashgti/4685743" target="_blank">https://gist.github.com/ashgti/4685743</a> if anyone would like to see it. </div>
<div><br></div><div>So, my question is where should I go from here? Do I need to email the exact patch to llvm-commits? This touches both the llvm and compiler-rt, so I don't know if that changes anything. </div><div>
<br></div><div><br></div><div>Thanks,</div><div><br></div><div><div>--<div>John Harrison</div></div>
</div></div></div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></div>
</blockquote></div><br></div></div>