a_sidorin added a comment.

Hi Artem,
The change looks fine, just some nits.



================
Comment at: lib/StaticAnalyzer/Checkers/MoveChecker.cpp:537
+    const MemRegion *ThisRegion = nullptr;
+    if (const auto *IC = dyn_cast_or_null<CXXInstanceCall>(Call))
+      ThisRegion = IC->getCXXThisVal().getAsRegion();
----------------
It looks like Call is already checked for null, and we can use just dyn_cast.


================
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);
----------------
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.


Repository:
  rC Clang

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

https://reviews.llvm.org/D55289



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

Reply via email to