[llvm] r184348 - Add operator!= as the compliment to operator==. This is for a future change.

David Blaikie dblaikie at gmail.com
Wed Jun 19 14:45:42 PDT 2013


On Wed, Jun 19, 2013 at 1:50 PM, Bill Wendling <isanbard at gmail.com> wrote:
> Author: void
> Date: Wed Jun 19 15:50:12 2013
> New Revision: 184348
>
> URL: http://llvm.org/viewvc/llvm-project?rev=184348&view=rev
> Log:
> Add operator!= as the compliment to operator==. This is for a future change.
>
> Modified:
>     llvm/trunk/include/llvm/Target/TargetOptions.h
>
> Modified: llvm/trunk/include/llvm/Target/TargetOptions.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=184348&r1=184347&r2=184348&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Target/TargetOptions.h (original)
> +++ llvm/trunk/include/llvm/Target/TargetOptions.h Wed Jun 19 15:50:12 2013
> @@ -204,7 +204,10 @@ namespace llvm {
>      /// the value of this option.
>      FPOpFusion::FPOpFusionMode AllowFPOpFusion;
>
> -    bool operator==(const TargetOptions &);
> +    bool operator==(const TargetOptions &TM);
> +    bool operator!=(const TargetOptions &TM) {

Both == and != (& other similar operators) should, ideally, be
non-members for symmetry (yeah, probably not a major concern for this
type since it's unlikely you need an implicit conversion on the LHS,
but it's also the case that these operators are accidentally
non-const, too)

> +      return !(*this == TM);
> +    }
>    };
>  } // End llvm namespace
>
>
>
> _______________________________________________
> 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