[PATCH] D106681: [analyzer][NFC] Move a block from `getBindingForElement` to separate functions

Denys Petrov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 20 01:49:32 PDT 2021


ASDenysPetrov added a comment.

@steakhal
All your comments are fair in terms of NFC. I also tried to improve some places. I think I should requalificate the revision to non-NFC, that I can be more untied to bring some improvements.



================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1636
+
+  // Array should be immutable.
+  const VarDecl *VD = VR->getDecl();
----------------
steakhal wrote:
> Please preserve the original comment.
OK.


================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1650
+  // TODO: Support multidimensional array.
+  if (isa<ConstantArrayType>(CAT->getElementType())) // is multidimensional
+    return None;
----------------
steakhal wrote:
> What if that is a typedef?
I'll add a test case.


================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1714
+  // Return a constant value, if it is presented.
+  // FIXME: Support other SVals.
+  const Expr *E = ILE->getInit(Offset);
----------------
steakhal wrote:
> What other values could appear in this context other than constants?
It's hard to say. I didn't do any investigation yet, but I think some symbolic or loc values.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106681



More information about the cfe-commits mailing list