[PATCH] D58035: [clang/DIVar] Emit flag for params that have unchanged values

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 22 06:58:37 PST 2019


lebedev.ri added inline comments.


================
Comment at: lib/Sema/SemaExpr.cpp:11301
+    EmitArgumentsValueModification(E);
+
   SourceLocation OrigLoc = Loc;
----------------
riccibruno wrote:
> Comments:
> 
> 1. Shouldn't you mark the variable to be modified only if `CheckForModifiableLvalue` returns true ?
> 
> 2. I think that you need to handle way more than just member expressions. For example are you handling `(x, y)` (comma operator) ? But hard-coding every cases here is probably not ideal. It would be nice if there was already some code somewhere that could help you do this.
> 
> 3. I believe that a `MemberExpr` has always a base. Similarly `DeclRefExpr`s always have a referenced declaration (so you can omit the `if`).
I'm not quite sure what this differential is about, but i feel like mentioning ExprMutationAnalyzer lib in clang-tidy / clang-tools-extra.


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

https://reviews.llvm.org/D58035





More information about the cfe-commits mailing list