================
@@ -102,6 +102,11 @@ class FactsGenerator : public 
ConstStmtVisitor<FactsGenerator> {
   // corresponding to the left-hand side is updated to be a "write", thereby
   // exempting it from the check.
   llvm::DenseMap<const DeclRefExpr *, UseFact *> UseFacts;
+
+  // Tracks declarations that have been moved via std::move. This is used to
+  // prevent false positives when the original owner is destroyed after the
+  // value has been moved. This tracking is flow-insensitive.
----------------
ymand wrote:

Consider moving the comments on lines 195-201 here, or at least mentioning 
them. But, that's a matter of taste :)

Also, whether in comments or test maybe highlight some example impacts? e.g. 
modifying your test below:

```
{
  MyObj a;
  v = a;
  b = std::move(a);

  refresh(a); // For types which can take on valid state after move.
  v = a;
}
```

Or, a branch?
```
{
  MyObj a;
  v = a;
  if (c) {
    b = std::move(a);
  }
}
```



https://github.com/llvm/llvm-project/pull/170007
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to