[clang-tools-extra] r254066 - [clang-tidy] code cleanup using isAssignmentOp()

Daniel Marjamaki via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 25 03:30:01 PST 2015


Author: danielmarjamaki
Date: Wed Nov 25 05:30:00 2015
New Revision: 254066

URL: http://llvm.org/viewvc/llvm-project?rev=254066&view=rev
Log:
[clang-tidy] code cleanup using isAssignmentOp()

Modified:
    clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.cpp?rev=254066&r1=254065&r2=254066&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.cpp Wed Nov 25 05:30:00 2015
@@ -33,11 +33,7 @@ AST_MATCHER_P(Expr, hasSideEffect, bool,
   }
 
   if (const auto *Op = dyn_cast<BinaryOperator>(E)) {
-    BinaryOperator::Opcode OC = Op->getOpcode();
-    return OC == BO_Assign || OC == BO_MulAssign || OC == BO_DivAssign ||
-           OC == BO_RemAssign || OC == BO_AddAssign || OC == BO_SubAssign ||
-           OC == BO_ShlAssign || OC == BO_ShrAssign || OC == BO_AndAssign ||
-           OC == BO_XorAssign || OC == BO_OrAssign;
+    return Op->isAssignmentOp();
   }
 
   if (const auto *OpCallExpr = dyn_cast<CXXOperatorCallExpr>(E)) {




More information about the cfe-commits mailing list