aaron.ballman added inline comments.
================
Comment at: clang-tidy/utils/ExprMutationAnalyzer.cpp:42
+ const auto Memoized = Results.find(Exp);
+ if (Memoized != Results.end()) {
+ return Memoized->second;
----------------
Can elide the braces.
================
Comment at: clang-tidy/utils/ExprMutationAnalyzer.cpp:71
+ for (const auto &DeclNodes : Matches) {
+ if (const auto *S = findDeclMutation(DeclNodes.getNodeAs<Decl>("decl")))
+ return S;
----------------
Don't use `auto` here.
================
Comment at: clang-tidy/utils/ExprMutationAnalyzer.cpp:82-83
+ const auto *E = RefNodes.getNodeAs<Expr>("expr");
+ if (findMutation(E))
+ return E;
+ }
----------------
Why does this not return the result of `findMutation()` like the other call
above?
================
Comment at: clang-tidy/utils/ExprMutationAnalyzer.cpp:88
+
+const Stmt *ExprMutationAnalyzer::findDirectMutation(const Expr *Exp) {
+ // LHS of any assignment operators.
----------------
Should this also consider a DeclRefExpr to a volatile-qualified variable as a
direct mutation?
What about using `Expr::HasSideEffect()`?
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits