[PATCH] D69540: [analyzer] DynamicSize: Remove 'getExtent()' from regions

Csaba Dabis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 28 17:52:02 PDT 2019


Charusso marked 3 inline comments as done.
Charusso added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:880
   uint64_t Length = UINT64_MAX;
-  SVal Extent = Top->getExtent(SVB);
+  SVal Extent = Top->getMemRegionManager().getStaticSize(Top);
   if (Optional<nonloc::ConcreteInt> ExtentCI =
----------------
That is why the static size information needs to be obtainable by a manager, which seems like a design problem from the very beginning.


================
Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:158
               // symbols to use, only content metadata.
-              return nonloc::SymbolVal(SymMgr.getExtentSymbol(FTR));
+              return FTR->getMemRegionManager().getStaticSize(FTR);
 
----------------
That is the breaking test's code, which is super wonky. I cannot understand what is the rational behind this concept.


================
Comment at: clang/test/Analysis/weak-functions.c:10
   clang_analyzer_eval(myFunc == NULL);  // expected-warning{{FALSE}}
-  clang_analyzer_eval(myWeakFunc == NULL);  // expected-warning{{UNKNOWN}}
+  clang_analyzer_eval(myWeakFunc == NULL);  // expected-warning{{FALSE}}
   if (myWeakFunc == NULL) {
----------------
I have literally copy-pasted the implementation of `getExtent()`, so I could not figured out why this test has been changed.


Repository:
  rC Clang

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

https://reviews.llvm.org/D69540





More information about the cfe-commits mailing list