[clang] [analyzer][NFC] Use a base region map in RemoveDeadBindingsWorker (PR #246433)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 26 12:18:59 PST 2026
https://github.com/Xazax-hun updated https://github.com/llvm/llvm-project/pull/246433
>From aa9e8739bf26c4d47f5a228364549615ccd634c5 Mon Sep 17 00:00:00 2001
From: Gabor Horvath <gaborh at apple.com>
Date: Wed, 25 Nov 2026 15:19:53 +0000
Subject: [PATCH 1/4] [analyzer] Use a base region map in
RemoveDeadBindingsWorker
RemoveDeadBindingsWorker looked up the cluster of a region in the store
every time it was added to the worklist, and tracked visited clusters in a
separate set that it probed again when filtering the store.
Record every cluster and a visited flag in a map from the base region
when the clusters are generated, so adding a region to the worklist is a
single hash lookup. If every cluster is live, return the store unchanged.
The worker no longer uses ClusterAnalysis.
On some LLVM TUs (GVN, LiveVariables, RegionStore, SemaExpr) this reduces
the instructions of the static analyzer by 2.5-3.3%.
Assisted-by: Claude Opus 5.5
---
clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 119 +++++++++++++-----
1 file changed, 88 insertions(+), 31 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index b34a3f61462bf0..a20e65b28a92ff 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -478,6 +478,14 @@ RegionBindingsRef RegionBindingsRef::removeBinding(const MemRegion *R,
namespace {
class InvalidateRegionsWorker;
+/// A cluster of the store and whether removeDeadBindings found it live.
+struct DeadBindingsClusterInfo {
+ const ClusterBindings *Cluster;
+ bool Visited;
+};
+using DeadBindingsClusterMapTy =
+ llvm::DenseMap<const MemRegion *, DeadBindingsClusterInfo>;
+
class RegionStoreManager final : public StoreManager {
public:
RegionBindings::Factory RBFactory;
@@ -485,6 +493,10 @@ class RegionStoreManager final : public StoreManager {
typedef std::vector<SVal> SValListTy;
private:
+ /// Maps the base regions of the store to their clusters during
+ /// removeDeadBindings. Kept here to reuse its storage between calls.
+ DeadBindingsClusterMapTy DeadBindingsClusters;
+
typedef llvm::DenseMap<const LazyCompoundValData *,
SValListTy> LazyBindingsMapTy;
LazyBindingsMapTy LazyBindingsMap;
@@ -911,8 +923,6 @@ class ClusterAnalysis {
RegionBindingsRef getRegionBindings() const { return B; }
- bool isVisited(const ClusterBindings *C) const { return Visited.count(C); }
-
void GenerateClusters() {
// Scan the entire set of bindings and record the region clusters.
for (RegionBindingsRef::iterator RI = B.begin(), RE = B.end();
@@ -3026,51 +3036,98 @@ RegionStoreManager::bindAggregate(LimitedRegionBindingsConstRef B,
//===----------------------------------------------------------------------===//
namespace {
-class RemoveDeadBindingsWorker
- : public ClusterAnalysis<RemoveDeadBindingsWorker> {
+class RemoveDeadBindingsWorker {
+ using ClusterInfo = DeadBindingsClusterInfo;
+
+ RegionStoreManager &RM;
+ RegionBindingsRef B;
SmallVector<const SymbolicRegion *, 12> Postponed;
SymbolReaper &SymReaper;
const StackFrame *CurrentSF;
-public:
- RemoveDeadBindingsWorker(RegionStoreManager &rm,
- ProgramStateManager &stateMgr, RegionBindingsRef b,
- SymbolReaper &symReaper, const StackFrame *SF)
- : ClusterAnalysis<RemoveDeadBindingsWorker>(rm, stateMgr, b),
- SymReaper(symReaper), CurrentSF(SF) {}
-
- // Called by ClusterAnalysis.
- void VisitAddedToCluster(const MemRegion *baseR, const ClusterBindings &C);
- void VisitCluster(const MemRegion *baseR, const ClusterBindings *C);
- using ClusterAnalysis<RemoveDeadBindingsWorker>::VisitCluster;
+ // Every cluster of the store by its base region, and whether it is live.
+ DeadBindingsClusterMapTy &Clusters;
+ SmallVector<std::pair<const MemRegion *, const ClusterBindings *>, 32>
+ ClusterWL;
+ unsigned NumVisited = 0;
- using ClusterAnalysis::AddToWorkList;
+ bool AddToWorkList(const MemRegion *BaseR, ClusterInfo &Info);
+ void VisitAddedToCluster(const MemRegion *baseR, ClusterInfo &Info);
+ void VisitCluster(const MemRegion *baseR, const ClusterBindings &C);
+ void VisitBinding(SVal V);
- bool AddToWorkList(const MemRegion *R);
+public:
+ RemoveDeadBindingsWorker(RegionStoreManager &rm, RegionBindingsRef b,
+ SymbolReaper &symReaper, const StackFrame *SF,
+ DeadBindingsClusterMapTy &Map)
+ : RM(rm), B(std::move(b)), SymReaper(symReaper), CurrentSF(SF),
+ Clusters(Map) {
+ Clusters.clear();
+ }
+ void GenerateClusters();
+ bool AddToWorkList(const MemRegion *R);
+ void RunWorkList();
bool UpdatePostponed();
- void VisitBinding(SVal V);
+
+ bool allVisited() const { return NumVisited == Clusters.size(); }
+ bool isVisited(const MemRegion *BaseR) const {
+ auto It = Clusters.find(BaseR);
+ assert(It != Clusters.end() && "Every cluster is in the map");
+ return It->second.Visited;
+ }
};
}
+void RemoveDeadBindingsWorker::GenerateClusters() {
+ for (const auto &[Base, Cluster] : B) {
+ assert(!Cluster.isEmpty() && "Empty clusters should be removed");
+ auto [It, Inserted] =
+ Clusters.try_emplace(Base, ClusterInfo{&Cluster, false});
+ assert(Inserted);
+ VisitAddedToCluster(Base, It->second);
+ }
+}
+
+bool RemoveDeadBindingsWorker::AddToWorkList(const MemRegion *BaseR,
+ ClusterInfo &Info) {
+ if (Info.Visited)
+ return false;
+ Info.Visited = true;
+ ++NumVisited;
+ ClusterWL.emplace_back(BaseR, Info.Cluster);
+ return true;
+}
+
bool RemoveDeadBindingsWorker::AddToWorkList(const MemRegion *R) {
const MemRegion *BaseR = R->getBaseRegion();
- return AddToWorkList(WorkListElement(BaseR), getCluster(BaseR));
+ auto It = Clusters.find(BaseR);
+ // A region without bindings has nothing to visit.
+ if (It == Clusters.end())
+ return false;
+ return AddToWorkList(BaseR, It->second);
+}
+
+void RemoveDeadBindingsWorker::RunWorkList() {
+ while (!ClusterWL.empty()) {
+ auto [BaseR, C] = ClusterWL.pop_back_val();
+ VisitCluster(BaseR, *C);
+ }
}
void RemoveDeadBindingsWorker::VisitAddedToCluster(const MemRegion *baseR,
- const ClusterBindings &C) {
+ ClusterInfo &Info) {
if (const VarRegion *VR = dyn_cast<VarRegion>(baseR)) {
if (SymReaper.isLive(VR))
- AddToWorkList(baseR, &C);
+ AddToWorkList(baseR, Info);
return;
}
if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(baseR)) {
if (SymReaper.isLive(SR->getSymbol()))
- AddToWorkList(SR, &C);
+ AddToWorkList(SR, Info);
else
Postponed.push_back(SR);
@@ -3078,7 +3135,7 @@ void RemoveDeadBindingsWorker::VisitAddedToCluster(const MemRegion *baseR,
}
if (isa<NonStaticGlobalSpaceRegion>(baseR)) {
- AddToWorkList(baseR, &C);
+ AddToWorkList(baseR, Info);
return;
}
@@ -3088,21 +3145,18 @@ void RemoveDeadBindingsWorker::VisitAddedToCluster(const MemRegion *baseR,
cast<StackArgumentsSpaceRegion>(TR->getSuperRegion());
const StackFrame *RegSF = StackReg->getStackFrame();
if (CurrentSF && (RegSF == CurrentSF || RegSF->isParentOf(CurrentSF)))
- AddToWorkList(TR, &C);
+ AddToWorkList(TR, Info);
}
}
void RemoveDeadBindingsWorker::VisitCluster(const MemRegion *baseR,
- const ClusterBindings *C) {
- if (!C)
- return;
-
+ const ClusterBindings &C) {
// Mark the symbol for any SymbolicRegion with live bindings as live itself.
// This means we should continue to track that symbol.
if (const SymbolicRegion *SymR = dyn_cast<SymbolicRegion>(baseR))
SymReaper.markLive(SymR->getSymbol());
- for (const auto &[Key, Val] : *C) {
+ for (const auto &[Key, Val] : C) {
// Element index of a binding key is live.
SymReaper.markElementIndicesLive(Key.getRegion());
@@ -3163,7 +3217,7 @@ StoreRef RegionStoreManager::removeDeadBindings(Store store,
const StackFrame *SF,
SymbolReaper &SymReaper) {
RegionBindingsRef B = getRegionBindings(store);
- RemoveDeadBindingsWorker W(*this, StateMgr, B, SymReaper, SF);
+ RemoveDeadBindingsWorker W(*this, B, SymReaper, SF, DeadBindingsClusters);
W.GenerateClusters();
// Enqueue the region roots onto the worklist.
@@ -3177,7 +3231,10 @@ StoreRef RegionStoreManager::removeDeadBindings(Store store,
// as live. We now remove all the regions that are dead from the store
// as well as update DSymbols with the set symbols that are now dead.
// A cluster that has been visited has been marked live.
- B = B.filterClusters([&](const auto &E) { return W.isVisited(&E.second); });
+ // If every cluster is live, the store is unchanged.
+ if (W.allVisited())
+ return StoreRef(store, *this);
+ B = B.filterClusters([&](const auto &E) { return W.isVisited(E.first); });
return StoreRef(B.asStore(), *this);
}
>From c6d402a0ad780c1360fa0f8818cb1c7ca09c36fb Mon Sep 17 00:00:00 2001
From: Gabor Horvath <gaborh at apple.com>
Date: Thu, 26 Nov 2026 17:52:55 +0000
Subject: [PATCH 2/4] [analyzer][NFC] Address review comments
Assisted-by: Claude Opus 5.5
---
clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 27 +++++++++----------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index a20e65b28a92ff..55aec3478ab34d 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -26,6 +26,7 @@
#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "llvm/ADT/ImmutableMap.h"
+#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/raw_ostream.h"
@@ -479,10 +480,8 @@ namespace {
class InvalidateRegionsWorker;
/// A cluster of the store and whether removeDeadBindings found it live.
-struct DeadBindingsClusterInfo {
- const ClusterBindings *Cluster;
- bool Visited;
-};
+using DeadBindingsClusterInfo =
+ llvm::PointerIntPair<const ClusterBindings *, 1, bool>;
using DeadBindingsClusterMapTy =
llvm::DenseMap<const MemRegion *, DeadBindingsClusterInfo>;
@@ -3059,11 +3058,9 @@ class RemoveDeadBindingsWorker {
public:
RemoveDeadBindingsWorker(RegionStoreManager &rm, RegionBindingsRef b,
SymbolReaper &symReaper, const StackFrame *SF,
- DeadBindingsClusterMapTy &Map)
+ DeadBindingsClusterMapTy &Clusters)
: RM(rm), B(std::move(b)), SymReaper(symReaper), CurrentSF(SF),
- Clusters(Map) {
- Clusters.clear();
- }
+ Clusters(Clusters) {}
void GenerateClusters();
bool AddToWorkList(const MemRegion *R);
@@ -3072,18 +3069,20 @@ class RemoveDeadBindingsWorker {
bool allVisited() const { return NumVisited == Clusters.size(); }
bool isVisited(const MemRegion *BaseR) const {
+ assert(BaseR == BaseR->getBaseRegion() && "Clusters are keyed by base");
auto It = Clusters.find(BaseR);
assert(It != Clusters.end() && "Every cluster is in the map");
- return It->second.Visited;
+ return It->second.getInt();
}
};
}
void RemoveDeadBindingsWorker::GenerateClusters() {
+ Clusters.clear();
for (const auto &[Base, Cluster] : B) {
- assert(!Cluster.isEmpty() && "Empty clusters should be removed");
+ assert(!Cluster.isEmpty() && "Empty clusters should have been removed");
auto [It, Inserted] =
- Clusters.try_emplace(Base, ClusterInfo{&Cluster, false});
+ Clusters.try_emplace(Base, ClusterInfo(&Cluster, /*Visited=*/false));
assert(Inserted);
VisitAddedToCluster(Base, It->second);
}
@@ -3091,11 +3090,11 @@ void RemoveDeadBindingsWorker::GenerateClusters() {
bool RemoveDeadBindingsWorker::AddToWorkList(const MemRegion *BaseR,
ClusterInfo &Info) {
- if (Info.Visited)
+ if (Info.getInt())
return false;
- Info.Visited = true;
+ Info.setInt(true);
++NumVisited;
- ClusterWL.emplace_back(BaseR, Info.Cluster);
+ ClusterWL.emplace_back(BaseR, Info.getPointer());
return true;
}
>From 0fe723f8084f5a4c0f8e980a4e20fa1ea0fcb007 Mon Sep 17 00:00:00 2001
From: Gabor Horvath <gaborh at apple.com>
Date: Thu, 26 Nov 2026 18:25:28 +0000
Subject: [PATCH 3/4] [analyzer][NFC] Document the visited flag
Assisted-by: Claude Opus 5.5
---
clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index 55aec3478ab34d..a08dda67eb39af 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -479,7 +479,8 @@ RegionBindingsRef RegionBindingsRef::removeBinding(const MemRegion *R,
namespace {
class InvalidateRegionsWorker;
-/// A cluster of the store and whether removeDeadBindings found it live.
+/// A cluster of the store. The int is the visited flag: whether
+/// removeDeadBindings found the cluster live.
using DeadBindingsClusterInfo =
llvm::PointerIntPair<const ClusterBindings *, 1, bool>;
using DeadBindingsClusterMapTy =
>From 997a70f6ef254c16984fe3ccb637d737e74c0e0a Mon Sep 17 00:00:00 2001
From: Gabor Horvath <gaborh at apple.com>
Date: Thu, 26 Nov 2026 20:18:40 +0000
Subject: [PATCH 4/4] [analyzer][NFC] Address review comments
Rename the methods of RemoveDeadBindingsWorker to lowerCamelCase, give
the overload that takes a cluster its own name, and capitalize the
parameter names.
Assisted-by: Claude Opus 5.5
---
clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 83 ++++++++++---------
1 file changed, 42 insertions(+), 41 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index a08dda67eb39af..547ab4be3af773 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -3051,22 +3051,22 @@ class RemoveDeadBindingsWorker {
ClusterWL;
unsigned NumVisited = 0;
- bool AddToWorkList(const MemRegion *BaseR, ClusterInfo &Info);
- void VisitAddedToCluster(const MemRegion *baseR, ClusterInfo &Info);
- void VisitCluster(const MemRegion *baseR, const ClusterBindings &C);
- void VisitBinding(SVal V);
+ bool enqueueCluster(const MemRegion *BaseR, ClusterInfo &Info);
+ void visitAddedToCluster(const MemRegion *BaseR, ClusterInfo &Info);
+ void visitCluster(const MemRegion *BaseR, const ClusterBindings &C);
+ void visitBinding(SVal V);
public:
- RemoveDeadBindingsWorker(RegionStoreManager &rm, RegionBindingsRef b,
- SymbolReaper &symReaper, const StackFrame *SF,
+ RemoveDeadBindingsWorker(RegionStoreManager &RM, RegionBindingsRef B,
+ SymbolReaper &SymReaper, const StackFrame *SF,
DeadBindingsClusterMapTy &Clusters)
- : RM(rm), B(std::move(b)), SymReaper(symReaper), CurrentSF(SF),
+ : RM(RM), B(std::move(B)), SymReaper(SymReaper), CurrentSF(SF),
Clusters(Clusters) {}
- void GenerateClusters();
- bool AddToWorkList(const MemRegion *R);
- void RunWorkList();
- bool UpdatePostponed();
+ void generateClusters();
+ bool addToWorkList(const MemRegion *R);
+ void runWorkList();
+ bool updatePostponed();
bool allVisited() const { return NumVisited == Clusters.size(); }
bool isVisited(const MemRegion *BaseR) const {
@@ -3078,19 +3078,19 @@ class RemoveDeadBindingsWorker {
};
}
-void RemoveDeadBindingsWorker::GenerateClusters() {
+void RemoveDeadBindingsWorker::generateClusters() {
Clusters.clear();
for (const auto &[Base, Cluster] : B) {
assert(!Cluster.isEmpty() && "Empty clusters should have been removed");
auto [It, Inserted] =
Clusters.try_emplace(Base, ClusterInfo(&Cluster, /*Visited=*/false));
assert(Inserted);
- VisitAddedToCluster(Base, It->second);
+ visitAddedToCluster(Base, It->second);
}
}
-bool RemoveDeadBindingsWorker::AddToWorkList(const MemRegion *BaseR,
- ClusterInfo &Info) {
+bool RemoveDeadBindingsWorker::enqueueCluster(const MemRegion *BaseR,
+ ClusterInfo &Info) {
if (Info.getInt())
return false;
Info.setInt(true);
@@ -3099,72 +3099,72 @@ bool RemoveDeadBindingsWorker::AddToWorkList(const MemRegion *BaseR,
return true;
}
-bool RemoveDeadBindingsWorker::AddToWorkList(const MemRegion *R) {
+bool RemoveDeadBindingsWorker::addToWorkList(const MemRegion *R) {
const MemRegion *BaseR = R->getBaseRegion();
auto It = Clusters.find(BaseR);
// A region without bindings has nothing to visit.
if (It == Clusters.end())
return false;
- return AddToWorkList(BaseR, It->second);
+ return enqueueCluster(BaseR, It->second);
}
-void RemoveDeadBindingsWorker::RunWorkList() {
+void RemoveDeadBindingsWorker::runWorkList() {
while (!ClusterWL.empty()) {
auto [BaseR, C] = ClusterWL.pop_back_val();
- VisitCluster(BaseR, *C);
+ visitCluster(BaseR, *C);
}
}
-void RemoveDeadBindingsWorker::VisitAddedToCluster(const MemRegion *baseR,
+void RemoveDeadBindingsWorker::visitAddedToCluster(const MemRegion *BaseR,
ClusterInfo &Info) {
- if (const VarRegion *VR = dyn_cast<VarRegion>(baseR)) {
+ if (const VarRegion *VR = dyn_cast<VarRegion>(BaseR)) {
if (SymReaper.isLive(VR))
- AddToWorkList(baseR, Info);
+ enqueueCluster(BaseR, Info);
return;
}
- if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(baseR)) {
+ if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(BaseR)) {
if (SymReaper.isLive(SR->getSymbol()))
- AddToWorkList(SR, Info);
+ enqueueCluster(SR, Info);
else
Postponed.push_back(SR);
return;
}
- if (isa<NonStaticGlobalSpaceRegion>(baseR)) {
- AddToWorkList(baseR, Info);
+ if (isa<NonStaticGlobalSpaceRegion>(BaseR)) {
+ enqueueCluster(BaseR, Info);
return;
}
// CXXThisRegion in the current or parent stack frame is live.
- if (const CXXThisRegion *TR = dyn_cast<CXXThisRegion>(baseR)) {
+ if (const CXXThisRegion *TR = dyn_cast<CXXThisRegion>(BaseR)) {
const auto *StackReg =
cast<StackArgumentsSpaceRegion>(TR->getSuperRegion());
const StackFrame *RegSF = StackReg->getStackFrame();
if (CurrentSF && (RegSF == CurrentSF || RegSF->isParentOf(CurrentSF)))
- AddToWorkList(TR, Info);
+ enqueueCluster(TR, Info);
}
}
-void RemoveDeadBindingsWorker::VisitCluster(const MemRegion *baseR,
+void RemoveDeadBindingsWorker::visitCluster(const MemRegion *BaseR,
const ClusterBindings &C) {
// Mark the symbol for any SymbolicRegion with live bindings as live itself.
// This means we should continue to track that symbol.
- if (const SymbolicRegion *SymR = dyn_cast<SymbolicRegion>(baseR))
+ if (const SymbolicRegion *SymR = dyn_cast<SymbolicRegion>(BaseR))
SymReaper.markLive(SymR->getSymbol());
for (const auto &[Key, Val] : C) {
// Element index of a binding key is live.
SymReaper.markElementIndicesLive(Key.getRegion());
- VisitBinding(Val);
+ visitBinding(Val);
}
}
-void RemoveDeadBindingsWorker::VisitBinding(SVal V) {
+void RemoveDeadBindingsWorker::visitBinding(SVal V) {
// Is it a LazyCompoundVal? All referenced regions are live as well.
// The LazyCompoundVal itself is not live but should be readable.
if (auto LCS = V.getAs<nonloc::LazyCompoundVal>()) {
@@ -3174,7 +3174,7 @@ void RemoveDeadBindingsWorker::VisitBinding(SVal V) {
if (auto DepLCS = V.getAs<nonloc::LazyCompoundVal>())
SymReaper.markLazilyCopied(DepLCS->getRegion());
else
- VisitBinding(V);
+ visitBinding(V);
}
return;
@@ -3182,30 +3182,29 @@ void RemoveDeadBindingsWorker::VisitBinding(SVal V) {
// If V is a region, then add it to the worklist.
if (const MemRegion *R = V.getAsRegion()) {
- AddToWorkList(R);
+ addToWorkList(R);
SymReaper.markLive(R);
// All regions captured by a block are also live.
if (const BlockDataRegion *BR = dyn_cast<BlockDataRegion>(R)) {
for (auto Var : BR->referenced_vars())
- AddToWorkList(Var.getCapturedRegion());
+ addToWorkList(Var.getCapturedRegion());
}
}
-
// Update the set of live symbols.
for (SymbolRef Sym : V.symbols())
SymReaper.markLive(Sym);
}
-bool RemoveDeadBindingsWorker::UpdatePostponed() {
+bool RemoveDeadBindingsWorker::updatePostponed() {
// See if any postponed SymbolicRegions are actually live now, after
// having done a scan.
bool Changed = false;
for (const SymbolicRegion *SR : Postponed) {
if (SymReaper.isLive(SR->getSymbol())) {
- Changed |= AddToWorkList(SR);
+ Changed |= addToWorkList(SR);
SR = nullptr;
}
}
@@ -3218,14 +3217,16 @@ StoreRef RegionStoreManager::removeDeadBindings(Store store,
SymbolReaper &SymReaper) {
RegionBindingsRef B = getRegionBindings(store);
RemoveDeadBindingsWorker W(*this, B, SymReaper, SF, DeadBindingsClusters);
- W.GenerateClusters();
+ W.generateClusters();
// Enqueue the region roots onto the worklist.
for (const MemRegion *Reg : SymReaper.regions()) {
- W.AddToWorkList(Reg);
+ W.addToWorkList(Reg);
}
- do W.RunWorkList(); while (W.UpdatePostponed());
+ do
+ W.runWorkList();
+ while (W.updatePostponed());
// We have now scanned the store, marking reachable regions and symbols
// as live. We now remove all the regions that are dead from the store
More information about the cfe-commits
mailing list