================
@@ -77,9 +77,15 @@ class BodyIndexer : public RecursiveASTVisitor<BodyIndexer> {
     const Stmt *Parent = *It;
 
     if (auto BO = dyn_cast<BinaryOperator>(Parent)) {
-      if (BO->getOpcode() == BO_Assign && BO->getLHS()->IgnoreParenCasts() == 
E)
-        Roles |= (unsigned)SymbolRole::Write;
-
+      if (BO->getOpcode() == BO_Assign) {
+        if (BO->getLHS()->IgnoreParenCasts() == E)
----------------
ArcsinX wrote:

I split this `if` to avoid this check `else if (auto CA = 
dyn_cast<CompoundAssignOperator>(Parent))`  if `BO->getOpcode() == BO_Assign && 
BO->getLHS()->IgnoreParenCasts() != E`

I.e. if `BO->getOpcode() == BO_Assign` then `Parent` is not a  
`CompoundAssignOperator` and we don't need to check this

https://github.com/llvm/llvm-project/pull/69370
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to