@@ -405,19 +405,15 @@ class RegionStoreManager : public StoreManager {
405405 // ===-------------------------------------------------------------------===//
406406 // Binding values to regions.
407407 // ===-------------------------------------------------------------------===//
408- RegionBindingsRef invalidateGlobalRegion (MemRegion::Kind K,
409- const Expr *Ex,
408+ RegionBindingsRef invalidateGlobalRegion (MemRegion::Kind K, const Stmt *S,
410409 unsigned Count,
411410 const LocationContext *LCtx,
412411 RegionBindingsRef B,
413412 InvalidatedRegions *Invalidated);
414413
415- StoreRef invalidateRegions (Store store,
416- ArrayRef<SVal> Values,
417- const Expr *E, unsigned Count,
418- const LocationContext *LCtx,
419- const CallEvent *Call,
420- InvalidatedSymbols &IS,
414+ StoreRef invalidateRegions (Store store, ArrayRef<SVal> Values, const Stmt *S,
415+ unsigned Count, const LocationContext *LCtx,
416+ const CallEvent *Call, InvalidatedSymbols &IS,
421417 RegionAndSymbolInvalidationTraits &ITraits,
422418 InvalidatedRegions *Invalidated,
423419 InvalidatedRegions *InvalidatedTopLevel) override ;
@@ -975,26 +971,23 @@ RegionStoreManager::removeSubRegionBindings(RegionBindingsConstRef B,
975971namespace {
976972class InvalidateRegionsWorker : public ClusterAnalysis <InvalidateRegionsWorker>
977973{
978- const Expr *Ex ;
974+ const Stmt *S ;
979975 unsigned Count;
980976 const LocationContext *LCtx;
981977 InvalidatedSymbols &IS;
982978 RegionAndSymbolInvalidationTraits &ITraits;
983979 StoreManager::InvalidatedRegions *Regions;
984980 GlobalsFilterKind GlobalsFilter;
985981public:
986- InvalidateRegionsWorker (RegionStoreManager &rm,
987- ProgramStateManager &stateMgr,
988- RegionBindingsRef b,
989- const Expr *ex, unsigned count,
990- const LocationContext *lctx,
991- InvalidatedSymbols &is,
982+ InvalidateRegionsWorker (RegionStoreManager &rm, ProgramStateManager &stateMgr,
983+ RegionBindingsRef b, const Stmt *S, unsigned count,
984+ const LocationContext *lctx, InvalidatedSymbols &is,
992985 RegionAndSymbolInvalidationTraits &ITraitsIn,
993986 StoreManager::InvalidatedRegions *r,
994987 GlobalsFilterKind GFK)
995- : ClusterAnalysis<InvalidateRegionsWorker>(rm, stateMgr, b),
996- Ex (ex), Count(count), LCtx(lctx), IS(is), ITraits(ITraitsIn), Regions(r),
997- GlobalsFilter (GFK) {}
988+ : ClusterAnalysis<InvalidateRegionsWorker>(rm, stateMgr, b), S(S ),
989+ Count (count), LCtx(lctx), IS(is), ITraits(ITraitsIn), Regions(r),
990+ GlobalsFilter (GFK) {}
998991
999992 void VisitCluster (const MemRegion *baseR, const ClusterBindings *C);
1000993 void VisitBinding (SVal V);
@@ -1127,7 +1120,7 @@ void InvalidateRegionsWorker::VisitCluster(const MemRegion *baseR,
11271120 // Invalidate the region by setting its default value to
11281121 // conjured symbol. The type of the symbol is irrelevant.
11291122 DefinedOrUnknownSVal V =
1130- svalBuilder.conjureSymbolVal (baseR, Ex , LCtx, Ctx.IntTy , Count);
1123+ svalBuilder.conjureSymbolVal (baseR, S , LCtx, Ctx.IntTy , Count);
11311124 B = B.addBinding (baseR, BindingKey::Default, V);
11321125 return ;
11331126 }
@@ -1148,8 +1141,8 @@ void InvalidateRegionsWorker::VisitCluster(const MemRegion *baseR,
11481141 if (T->isRecordType ()) {
11491142 // Invalidate the region by setting its default value to
11501143 // conjured symbol. The type of the symbol is irrelevant.
1151- DefinedOrUnknownSVal V = svalBuilder. conjureSymbolVal (baseR, Ex, LCtx,
1152- Ctx.IntTy , Count);
1144+ DefinedOrUnknownSVal V =
1145+ svalBuilder. conjureSymbolVal (baseR, S, LCtx, Ctx.IntTy , Count);
11531146 B = B.addBinding (baseR, BindingKey::Default, V);
11541147 return ;
11551148 }
@@ -1216,15 +1209,14 @@ void InvalidateRegionsWorker::VisitCluster(const MemRegion *baseR,
12161209 }
12171210 conjure_default:
12181211 // Set the default value of the array to conjured symbol.
1219- DefinedOrUnknownSVal V =
1220- svalBuilder.conjureSymbolVal (baseR, Ex, LCtx,
1221- AT->getElementType (), Count);
1222- B = B.addBinding (baseR, BindingKey::Default, V);
1223- return ;
1212+ DefinedOrUnknownSVal V = svalBuilder.conjureSymbolVal (
1213+ baseR, S, LCtx, AT->getElementType (), Count);
1214+ B = B.addBinding (baseR, BindingKey::Default, V);
1215+ return ;
12241216 }
12251217
1226- DefinedOrUnknownSVal V = svalBuilder. conjureSymbolVal (baseR, Ex, LCtx,
1227- T, Count);
1218+ DefinedOrUnknownSVal V =
1219+ svalBuilder. conjureSymbolVal (baseR, S, LCtx, T, Count);
12281220 assert (SymbolManager::canSymbolicate (T) || V.isUnknown ());
12291221 B = B.addBinding (baseR, BindingKey::Direct, V);
12301222}
@@ -1252,19 +1244,16 @@ bool InvalidateRegionsWorker::includeEntireMemorySpace(const MemRegion *Base) {
12521244 RegionAndSymbolInvalidationTraits::TK_EntireMemSpace);
12531245}
12541246
1255- RegionBindingsRef
1256- RegionStoreManager::invalidateGlobalRegion (MemRegion::Kind K,
1257- const Expr *Ex,
1258- unsigned Count,
1259- const LocationContext *LCtx,
1260- RegionBindingsRef B,
1261- InvalidatedRegions *Invalidated) {
1247+ RegionBindingsRef RegionStoreManager::invalidateGlobalRegion (
1248+ MemRegion::Kind K, const Stmt *S, unsigned Count,
1249+ const LocationContext *LCtx, RegionBindingsRef B,
1250+ InvalidatedRegions *Invalidated) {
12621251 // Bind the globals memory space to a new symbol that we will use to derive
12631252 // the bindings for all globals.
12641253 const GlobalsSpaceRegion *GS = MRMgr.getGlobalsRegion (K);
1265- SVal V = svalBuilder. conjureSymbolVal ( /* symbolTag = */ ( const void *) GS, Ex, LCtx,
1266- /* type does not matter */ Ctx. IntTy ,
1267- Count);
1254+ SVal V =
1255+ svalBuilder. conjureSymbolVal ( /* symbolTag = */ ( const void *)GS, S, LCtx ,
1256+ /* type does not matter */ Ctx. IntTy , Count);
12681257
12691258 B = B.removeBinding (GS)
12701259 .addBinding (BindingKey::Make (GS, BindingKey::Default), V);
@@ -1298,16 +1287,11 @@ void RegionStoreManager::populateWorkList(InvalidateRegionsWorker &W,
12981287 }
12991288}
13001289
1301- StoreRef
1302- RegionStoreManager::invalidateRegions (Store store,
1303- ArrayRef<SVal> Values,
1304- const Expr *Ex, unsigned Count,
1305- const LocationContext *LCtx,
1306- const CallEvent *Call,
1307- InvalidatedSymbols &IS,
1308- RegionAndSymbolInvalidationTraits &ITraits,
1309- InvalidatedRegions *TopLevelRegions,
1310- InvalidatedRegions *Invalidated) {
1290+ StoreRef RegionStoreManager::invalidateRegions (
1291+ Store store, ArrayRef<SVal> Values, const Stmt *S, unsigned Count,
1292+ const LocationContext *LCtx, const CallEvent *Call, InvalidatedSymbols &IS,
1293+ RegionAndSymbolInvalidationTraits &ITraits,
1294+ InvalidatedRegions *TopLevelRegions, InvalidatedRegions *Invalidated) {
13111295 GlobalsFilterKind GlobalsFilter;
13121296 if (Call) {
13131297 if (Call->isInSystemHeader ())
@@ -1319,7 +1303,7 @@ RegionStoreManager::invalidateRegions(Store store,
13191303 }
13201304
13211305 RegionBindingsRef B = getRegionBindings (store);
1322- InvalidateRegionsWorker W (*this , StateMgr, B, Ex , Count, LCtx, IS, ITraits,
1306+ InvalidateRegionsWorker W (*this , StateMgr, B, S , Count, LCtx, IS, ITraits,
13231307 Invalidated, GlobalsFilter);
13241308
13251309 // Scan the bindings and generate the clusters.
@@ -1339,12 +1323,12 @@ RegionStoreManager::invalidateRegions(Store store,
13391323 // TODO: This could possibly be more precise with modules.
13401324 switch (GlobalsFilter) {
13411325 case GFK_All:
1342- B = invalidateGlobalRegion (MemRegion::GlobalInternalSpaceRegionKind,
1343- Ex, Count, LCtx, B, Invalidated);
1326+ B = invalidateGlobalRegion (MemRegion::GlobalInternalSpaceRegionKind, S,
1327+ Count, LCtx, B, Invalidated);
13441328 [[fallthrough]];
13451329 case GFK_SystemOnly:
1346- B = invalidateGlobalRegion (MemRegion::GlobalSystemSpaceRegionKind,
1347- Ex, Count, LCtx, B, Invalidated);
1330+ B = invalidateGlobalRegion (MemRegion::GlobalSystemSpaceRegionKind, S, Count,
1331+ LCtx, B, Invalidated);
13481332 [[fallthrough]];
13491333 case GFK_None:
13501334 break ;
0 commit comments