Make StoreManager::castRegion function usage safier. Replace const MemRegion * with Optional<const MemRegion *>. Simplified one of related test cases due to suggestions in D101635.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Looks great, thanks!
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).
Comment Actions
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?