Skip to content

Commit eba7853

Browse files
committed
Rename ALocs to Nodes and Mod to M in MemLocation
1 parent 6c600d1 commit eba7853

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lib/SIL/MemLocation.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,24 +130,23 @@ void MemLocation::expand(MemLocation &Base, SILModule *M, MemLocationList &Locs,
130130
}
131131
}
132132

133-
void MemLocation::reduce(MemLocation &Base, SILModule *Mod,
134-
MemLocationSet &Locs) {
133+
void MemLocation::reduce(MemLocation &Base, SILModule *M, MemLocationSet &Locs) {
135134
// First, construct the MemLocation by appending the projection path from the
136135
// accessed node to the leaf nodes.
137-
MemLocationList ALocs;
136+
MemLocationList Nodes;
138137
ProjectionPathList Paths;
139-
ProjectionPath::expandTypeIntoLeafProjectionPaths(Base.getType(), Mod, Paths,
138+
ProjectionPath::expandTypeIntoLeafProjectionPaths(Base.getType(), M, Paths,
140139
false);
141140
ProjectionPath &BasePath = Base.getPath().getValue();
142141
for (auto &X : Paths) {
143-
ALocs.push_back(MemLocation(Base.getBase(), X.getValue(), BasePath));
142+
Nodes.push_back(MemLocation(Base.getBase(), X.getValue(), BasePath));
144143
}
145144

146145
// Second, go from leaf nodes to their parents. This guarantees that at the
147146
// point the parent is processed, its children have been processed already.
148-
for (auto I = ALocs.rbegin(), E = ALocs.rend(); I != E; ++I) {
147+
for (auto I = Nodes.rbegin(), E = Nodes.rend(); I != E; ++I) {
149148
MemLocationList FirstLevel;
150-
I->getFirstLevelMemLocations(FirstLevel, Mod);
149+
I->getFirstLevelMemLocations(FirstLevel, M);
151150
// Reached the end of the projection tree, this is a leaf node.
152151
if (FirstLevel.empty())
153152
continue;
@@ -160,9 +159,7 @@ void MemLocation::reduce(MemLocation &Base, SILModule *Mod,
160159
// alive.
161160
bool Alive = true;
162161
for (auto &X : FirstLevel) {
163-
if (Locs.find(X) != Locs.end())
164-
continue;
165-
Alive = false;
162+
Alive &= Locs.find(X) != Locs.end();
166163
}
167164

168165
// All first level locations are alive, create the new aggregated location.

0 commit comments

Comments
 (0)