[PATCH] llvm-cov: Added -c option for branch counts.

Yuchen Wu yuchenericwu at hotmail.com
Wed Dec 18 10:44:57 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 -c option for branch counts.
> Date: Tue, 17 Dec 2013 20:54:26 -0800
>
> Yuchen Wu <yuchenericwu at hotmail.com> writes:
>> + void print(raw_ostream &OS) const {
>> + if (Total) {
>> + if (Options.BranchCount) {
>> + // Print branch counts
>> + OS << "taken " << Count;
>> + } else {
>> + // Print branch probabilities
>> + OS << "taken " << branchDiv(Count, Total) << "%";
>> + }
>> + } else {
>> + OS << "never executed";
>> + }
>> + }
>
> This seems a bit simpler...
>
> if (!Total)
> OS << "never executed";
> else if (Options.BranchCount)
> OS << "taken " << Count;
> else // Probabilities
> OS << "taken " << branchDiv(Count, Total) << "%";

Excellent point. Committed in r197594.

>
> Otherwise, LGTM.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits 		 	   		  



More information about the llvm-commits mailing list