[PATCH] D135136: [analyzer] Make directly bounded LazyCompoundVal as lazily copied

Tomasz KamiƄski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 08:29:01 PDT 2022


tomasz-kaminski-sonarsource added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:2843
-    // subregions of the `LCS.getRegion()` also lazily copied.
-    if (const MemRegion *R = LCS->getRegion())
-      SymReaper.markLazilyCopied(R);
----------------
martong wrote:
> Why can we remove this line?
> If `LCS->getRegion()` returns a non-null unconditionally then please add an `assert`.
The interface of the `LazyCompoundVal` is already marked as returning non-null, and this is why we removed the if condition:
```
  LLVM_ATTRIBUTE_RETURNS_NONNULL
  const TypedValueRegion *getRegion() const;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135136



More information about the cfe-commits mailing list