[llvm] r184373 - Make the comparison operators non-member functions.
Bill Wendling
isanbard at gmail.com
Wed Jun 19 15:09:25 PDT 2013
Author: void
Date: Wed Jun 19 17:09:25 2013
New Revision: 184373
URL: http://llvm.org/viewvc/llvm-project?rev=184373&view=rev
Log:
Make the comparison operators non-member functions.
Modified:
llvm/trunk/include/llvm/Target/TargetOptions.h
llvm/trunk/lib/CodeGen/TargetOptionsImpl.cpp
Modified: llvm/trunk/include/llvm/Target/TargetOptions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=184373&r1=184372&r2=184373&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetOptions.h (original)
+++ llvm/trunk/include/llvm/Target/TargetOptions.h Wed Jun 19 17:09:25 2013
@@ -203,12 +203,16 @@ namespace llvm {
/// via the llvm.fma.* intrinsic) will always be honored, regardless of
/// the value of this option.
FPOpFusion::FPOpFusionMode AllowFPOpFusion;
-
- bool operator==(const TargetOptions &TM);
- bool operator!=(const TargetOptions &TM) {
- return !(*this == TM);
- }
};
+
+// Comparison operators:
+
+bool operator==(const TargetOptions &LHS, const TargetOptions &RHS);
+
+bool operator!=(const TargetOptions &LHS, const TargetOptions &RHS) {
+ return !(LHS == RHS);
+}
+
} // End llvm namespace
#endif
Modified: llvm/trunk/lib/CodeGen/TargetOptionsImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetOptionsImpl.cpp?rev=184373&r1=184372&r2=184373&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetOptionsImpl.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetOptionsImpl.cpp Wed Jun 19 17:09:25 2013
@@ -50,8 +50,8 @@ StringRef TargetOptions::getTrapFunction
return TrapFuncName;
}
-bool TargetOptions::operator==(const TargetOptions &TO) {
-#define ARE_EQUAL(X) X == TO.X
+bool operator==(const TargetOptions &LHS, const TargetOptions &RHS) {
+#define ARE_EQUAL(X) LHS.X == RHS.X
return
ARE_EQUAL(UnsafeFPMath) &&
ARE_EQUAL(NoInfsFPMath) &&
More information about the llvm-commits
mailing list