[PATCH] D55289: [analyzer] MoveChecker Pt.5: Improve invalidation policies.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 5 14:00:05 PST 2018


NoQ added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/MoveChecker.cpp:528
     ArrayRef<const MemRegion *> ExplicitRegions,
     ArrayRef<const MemRegion *> Regions, const LocationContext *LCtx,
     const CallEvent *Call) const {
----------------
Szelethus wrote:
> This isn't specific to this revision, but I find the parameter name `Regions` way too vague. Maybe `ImplicitRegions`?
How about these?


================
Comment at: lib/StaticAnalyzer/Checkers/MoveChecker.cpp:545
+      if (ThisRegion != Region)
+        if (std::find(Regions.begin(), Regions.end(), Region) != Regions.end())
+          State = removeFromState(State, Region);
----------------
a_sidorin wrote:
> NoQ wrote:
> > This is clumsy. I think we shouldn't include non-invalidated regions in the `ExplicitRegions` array in the first place.
> Just a reminder: we have `llvm::find` and a bunch of nice related range wrappers.
Thx!


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

https://reviews.llvm.org/D55289





More information about the cfe-commits mailing list