[llvm] r227018 - InstrProf: Add operator!= to coverage counters

David Blaikie dblaikie at gmail.com
Sat Jan 24 14:26:57 PST 2015


On Sat, Jan 24, 2015 at 1:13 PM, Justin Bogner <mail at justinbogner.com>
wrote:

> Author: bogner
> Date: Sat Jan 24 15:13:23 2015
> New Revision: 227018
>
> URL: http://llvm.org/viewvc/llvm-project?rev=227018&view=rev
> Log:
> InstrProf: Add operator!= to coverage counters
>
> I'll use this in clang shortly. Also makes the operator definition
> style more consistent in this class.
>

Test cases?


>
> Modified:
>     llvm/trunk/include/llvm/ProfileData/CoverageMapping.h
>
> Modified: llvm/trunk/include/llvm/ProfileData/CoverageMapping.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/CoverageMapping.h?rev=227018&r1=227017&r2=227018&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/ProfileData/CoverageMapping.h (original)
> +++ llvm/trunk/include/llvm/ProfileData/CoverageMapping.h Sat Jan 24
> 15:13:23 2015
> @@ -63,8 +63,12 @@ public:
>
>    unsigned getExpressionID() const { return ID; }
>
> -  bool operator==(const Counter &Other) const {
> -    return Kind == Other.Kind && ID == Other.ID;
> +  friend bool operator==(const Counter &LHS, const Counter &RHS) {
> +    return LHS.Kind == RHS.Kind && LHS.ID == RHS.ID;
> +  }
> +
> +  friend bool operator!=(const Counter &LHS, const Counter &RHS) {
> +    return !(LHS == RHS);
>    }
>
>    friend bool operator<(const Counter &LHS, const Counter &RHS) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150124/c5f59230/attachment.html>


More information about the llvm-commits mailing list