[PATCH] D111654: [analyzer] Retrieve a value from list initialization of multi-dimensional array declaration.

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 5 10:53:52 PDT 2021


steakhal accepted this revision.
steakhal added a comment.
This revision is now accepted and ready to land.

Feel free to commit your change given that you fix my final nits.
Yeah, I'm soo bad in review. I should have proposed these previously. Sorry.



================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1641
+///
+/// \param CAT [in] The given type of ConstantArrayType.
+///
----------------
You don't need to document this.
Aside from that consider marking these //implementation detail// functions `static` if they are not yet in an anonymous namespace - I haven't checked.


================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1646
+  assert(CAT && "ConstantArrayType should not be null");
+  // Get a canonical type of the array.
+  CAT = cast<ConstantArrayType>(CAT->getCanonicalTypeInternal());
----------------
I think we will get it :D


================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1751
+  // Treat an n-dimensional array.
+  const std::pair<SmallVector<SVal, 2>, const MemRegion *> SValOffsetsAndBase =
+      getElementRegionOffsetsWithBase(R);
----------------
The `std::tie()` pattern is probably more readable.


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

https://reviews.llvm.org/D111654



More information about the cfe-commits mailing list