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

Yuchen Wu yuchenericwu at hotmail.com
Mon Dec 16 16:01:48 PST 2013

> From: mail at justinbogner.com
> To: llvm-commits at cs.uiuc.edu
> CC: llvm-commits at cs.uiuc.edu
> Subject: Re: [PATCH] llvm-cov: Added -f option for function summaries.
> Date: Thu, 12 Dec 2013 19:18:35 -0800
> 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.

It's gone now.

> 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?

Because there are two separate loops involved, we do need a map as the functions are not monotonically traversed.

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


New patch attached. 		 	   		  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-llvm-cov-Added-f-option-for-function-summaries.patch
Type: application/octet-stream
Size: 16166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131216/163e4c22/attachment.obj>

More information about the llvm-commits mailing list