@@ -405,19 +405,15 @@ class RegionStoreManager : public StoreManager {
405
405
// ===-------------------------------------------------------------------===//
406
406
// Binding values to regions.
407
407
// ===-------------------------------------------------------------------===//
408
- RegionBindingsRef invalidateGlobalRegion (MemRegion::Kind K,
409
- const Expr *Ex,
408
+ RegionBindingsRef invalidateGlobalRegion (MemRegion::Kind K, const Stmt *S,
410
409
unsigned Count,
411
410
const LocationContext *LCtx,
412
411
RegionBindingsRef B,
413
412
InvalidatedRegions *Invalidated);
414
413
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,
421
417
RegionAndSymbolInvalidationTraits &ITraits,
422
418
InvalidatedRegions *Invalidated,
423
419
InvalidatedRegions *InvalidatedTopLevel) override ;
@@ -975,26 +971,23 @@ RegionStoreManager::removeSubRegionBindings(RegionBindingsConstRef B,
975
971
namespace {
976
972
class InvalidateRegionsWorker : public ClusterAnalysis <InvalidateRegionsWorker>
977
973
{
978
- const Expr *Ex ;
974
+ const Stmt *S ;
979
975
unsigned Count;
980
976
const LocationContext *LCtx;
981
977
InvalidatedSymbols &IS;
982
978
RegionAndSymbolInvalidationTraits &ITraits;
983
979
StoreManager::InvalidatedRegions *Regions;
984
980
GlobalsFilterKind GlobalsFilter;
985
981
public:
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,
992
985
RegionAndSymbolInvalidationTraits &ITraitsIn,
993
986
StoreManager::InvalidatedRegions *r,
994
987
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) {}
998
991
999
992
void VisitCluster (const MemRegion *baseR, const ClusterBindings *C);
1000
993
void VisitBinding (SVal V);
@@ -1127,7 +1120,7 @@ void InvalidateRegionsWorker::VisitCluster(const MemRegion *baseR,
1127
1120
// Invalidate the region by setting its default value to
1128
1121
// conjured symbol. The type of the symbol is irrelevant.
1129
1122
DefinedOrUnknownSVal V =
1130
- svalBuilder.conjureSymbolVal (baseR, Ex , LCtx, Ctx.IntTy , Count);
1123
+ svalBuilder.conjureSymbolVal (baseR, S , LCtx, Ctx.IntTy , Count);
1131
1124
B = B.addBinding (baseR, BindingKey::Default, V);
1132
1125
return ;
1133
1126
}
@@ -1148,8 +1141,8 @@ void InvalidateRegionsWorker::VisitCluster(const MemRegion *baseR,
1148
1141
if (T->isRecordType ()) {
1149
1142
// Invalidate the region by setting its default value to
1150
1143
// 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);
1153
1146
B = B.addBinding (baseR, BindingKey::Default, V);
1154
1147
return ;
1155
1148
}
@@ -1216,15 +1209,14 @@ void InvalidateRegionsWorker::VisitCluster(const MemRegion *baseR,
1216
1209
}
1217
1210
conjure_default:
1218
1211
// 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 ;
1224
1216
}
1225
1217
1226
- DefinedOrUnknownSVal V = svalBuilder. conjureSymbolVal (baseR, Ex, LCtx,
1227
- T, Count);
1218
+ DefinedOrUnknownSVal V =
1219
+ svalBuilder. conjureSymbolVal (baseR, S, LCtx, T, Count);
1228
1220
assert (SymbolManager::canSymbolicate (T) || V.isUnknown ());
1229
1221
B = B.addBinding (baseR, BindingKey::Direct, V);
1230
1222
}
@@ -1252,19 +1244,16 @@ bool InvalidateRegionsWorker::includeEntireMemorySpace(const MemRegion *Base) {
1252
1244
RegionAndSymbolInvalidationTraits::TK_EntireMemSpace);
1253
1245
}
1254
1246
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) {
1262
1251
// Bind the globals memory space to a new symbol that we will use to derive
1263
1252
// the bindings for all globals.
1264
1253
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);
1268
1257
1269
1258
B = B.removeBinding (GS)
1270
1259
.addBinding (BindingKey::Make (GS, BindingKey::Default), V);
@@ -1298,16 +1287,11 @@ void RegionStoreManager::populateWorkList(InvalidateRegionsWorker &W,
1298
1287
}
1299
1288
}
1300
1289
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) {
1311
1295
GlobalsFilterKind GlobalsFilter;
1312
1296
if (Call) {
1313
1297
if (Call->isInSystemHeader ())
@@ -1319,7 +1303,7 @@ RegionStoreManager::invalidateRegions(Store store,
1319
1303
}
1320
1304
1321
1305
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,
1323
1307
Invalidated, GlobalsFilter);
1324
1308
1325
1309
// Scan the bindings and generate the clusters.
@@ -1339,12 +1323,12 @@ RegionStoreManager::invalidateRegions(Store store,
1339
1323
// TODO: This could possibly be more precise with modules.
1340
1324
switch (GlobalsFilter) {
1341
1325
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);
1344
1328
[[fallthrough]];
1345
1329
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);
1348
1332
[[fallthrough]];
1349
1333
case GFK_None:
1350
1334
break ;
0 commit comments