[PATCH] D22910: Add support for CXXOperatorCallExpr in Expr::HasSideEffects
Andi via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 18 04:06:33 PDT 2016
Abpostelnicu marked 2 inline comments as done.
================
Comment at: lib/AST/Expr.cpp:2868
@@ +2867,3 @@
+ OverloadedOperatorKind binOp = cast<CXXOperatorCallExpr>(this)->getOperator();
+ if (binOp == OO_Equal || (binOp >= OO_PlusEqual && binOp <= OO_PipeEqual)) {
+ return true;
----------------
rsmith wrote:
> Please don't hard-code the order of OO enumerators like this (and this isn't even correct: you missed `<<=` and `>>=`).
>
> Instead, consider extending `BinaryOperator::isAssignmentOp` / `BinaryOperator::getOverloadedOpcode` so you can use them for this.
i was thinking more on doing for this specific case since BinaryOperator::isAssignmentOp and BinaryOperator::getOverloadedOpcode only accepts binary op codes and CXXOperatorCallExpr incapsulates operators both binary and unary
Repository:
rL LLVM
https://reviews.llvm.org/D22910
More information about the cfe-commits
mailing list