gribozavr2 added inline comments.

================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:1024
+      // representation of built-in and user-defined operators.
+      if (child->getBeginLoc() == S->getOperatorLoc())
+        continue;
----------------
eduucaldas wrote:
> Here we want to check if this child is just a DeclRefExpr to an operator - as 
> opposed to an operand.
> Is comparing SourceLocation generally safe?
> Is there a better way of figuring out if the child DeclRefExpr refers to an 
> operator?
Comparing SourceLocations should work, but you're right that it is a 
questionable pattern.

Iterating only over `S->arguments()` instead of all children could work here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85750/new/

https://reviews.llvm.org/D85750

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to