[PATCH] D103319: [analyzer] Use Optional as a return type of StoreManager::castRegion

Denys Petrov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 29 11:13:12 PDT 2021


ASDenysPetrov added a comment.

@NoQ

> I guess another option is to put `loc::MemRegionVal()` inside `castRegion()`. This way the return type `Optional<loc::MemRegionVal>` unambigously tells that the region is always non-null if present (protected by the assertion in the constructor of `loc::MemRegionVal`).

IMO we should keep `const MemRegion *` for `castRegion` as is, since it's intended for //cast// and should behave as //cast//. I'd better add a kinda wrapper`SValBuilder::getCastedMemRegionVal`. WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103319



More information about the cfe-commits mailing list