<div dir="ltr">2014-07-15 14:40 GMT-07:00 Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>></span>:<br><div><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">Alex Lorenz <<a href="mailto:arphaman@gmail.com">arphaman@gmail.com</a>> writes:<br>
> The patch provides the initial implementation of the updated code<br>
> coverage tool that uses clang's instrumentation based profiling data<br>
> (the -fprofile-instr-generate option) and the new coverage mapping<br>
> format.<br>
><br>
> The gcov compatible tool is still there. To invoke the new tool, pass<br>
> the 'show' or 'report' command as the first argument to llvm-cov.<br>
><br>
> The show command displays the code coverage information for a set of<br>
> source code files of a program. Some of its options follow:<br>
>   -show-expansions - Show macro expansions<br>
>   -show-instantiations - Show template/static functions instantiations<br>
>   -show-regions - Show region markers<br>
>   -show-line-counts - Show execution counts for each line (enabled by default).<br>
><br>
> The report command displays a couple of code coverage metrics for<br>
> files/functions in a concise table.<br>
<br>
</div>I'll review this more thoroughly soon, but I have a couple of high level<br>
comments:<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
1. It would probably be easier to understand this if it was split into<br>
   two patches: first move the gcov compatible code to its own file and<br>
   update llvm-cov to be a wrapper that always calls into that, and then<br>
   add the new-style support.<br>
<br>
2. The semantics for choosing whether to be gcov-compatible are a bit<br>
   confusing. I can see the value of "no recognized command" implying<br>
   compatible behaviour, but going forward we should encourage a saner<br>
   API. Consider:<br>
<br>
   - If invoked as gcov (ie, argv[0] is or ends in "gcov"), always be<br>
     gcov compatible.<br>
   - Provide a "gcov" command in addition to "show" and "report", which<br>
     invokes into gcov for the rest of the command line.<br>
   - If no command matches fall back to gcov (perhaps with a warning<br>
     that this usage may be dropped in the future)<br>
</blockquote></div><br></div><div class="gmail_extra">This sounds like a much better approach than the current one, I will update the patch with the new logic and split it into two.<br></div><div class="gmail_extra">Thanks<br>
</div></div></div>