[PATCH] llvm-cov: Added -f option for function summaries.

Justin Bogner mail at justinbogner.com
Thu Dec 12 19:18:35 PST 2013


Yuchen Wu <yuchenericwu at hotmail.com> writes:
> From 4939a9be9ed921a7c3ccc6ecb43ab700184a60de Mon Sep 17 00:00:00 2001
> From: Yuchen Wu <yuchen_wu at apple.com>
> Date: Thu, 12 Dec 2013 12:24:05 -0800
> Subject: [PATCH 4/5] llvm-cov: Added -f option for function summaries.
>
> Similar to the file summaries, the function summaries output line,
> branching and call statistics. The file summaries have been moved
> outside the initial loop so that all of the function summaries can be
> outputted before file summaries.
>
> Added data structure StringMapVector which combines the functionalities
> of StringMap and MapVector. This is required so that the coverage output
> is deterministic and for the order of the functions and files to match
> gcov's.

Two things:

1. The StringMapVector seems excessive. It's obviously not needed for
   the file summaries, since you always operate on one file at a time,
   and I suspect it's overkill for the function summaries.

   How often are consecutive basic blocks from different functions that
   have already been seen? The only case I can think of where this would
   happen is when we exit an inlined function, or something like that.
   I suspect that nearly every basic block is either (a) the same
   function as the previous block, or (b) a function we've never seen
   before.

   Given that, can we get away with something simpler?

2. printFunctionSummary and printFileSummary are painfully similar. Can
   we share some code here?



More information about the llvm-commits mailing list