@@ -130,24 +130,23 @@ void MemLocation::expand(MemLocation &Base, SILModule *M, MemLocationList &Locs,
130
130
}
131
131
}
132
132
133
- void MemLocation::reduce (MemLocation &Base, SILModule *Mod,
134
- MemLocationSet &Locs) {
133
+ void MemLocation::reduce (MemLocation &Base, SILModule *M, MemLocationSet &Locs) {
135
134
// First, construct the MemLocation by appending the projection path from the
136
135
// accessed node to the leaf nodes.
137
- MemLocationList ALocs ;
136
+ MemLocationList Nodes ;
138
137
ProjectionPathList Paths;
139
- ProjectionPath::expandTypeIntoLeafProjectionPaths (Base.getType (), Mod , Paths,
138
+ ProjectionPath::expandTypeIntoLeafProjectionPaths (Base.getType (), M , Paths,
140
139
false );
141
140
ProjectionPath &BasePath = Base.getPath ().getValue ();
142
141
for (auto &X : Paths) {
143
- ALocs .push_back (MemLocation (Base.getBase (), X.getValue (), BasePath));
142
+ Nodes .push_back (MemLocation (Base.getBase (), X.getValue (), BasePath));
144
143
}
145
144
146
145
// Second, go from leaf nodes to their parents. This guarantees that at the
147
146
// 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) {
149
148
MemLocationList FirstLevel;
150
- I->getFirstLevelMemLocations (FirstLevel, Mod );
149
+ I->getFirstLevelMemLocations (FirstLevel, M );
151
150
// Reached the end of the projection tree, this is a leaf node.
152
151
if (FirstLevel.empty ())
153
152
continue ;
@@ -160,9 +159,7 @@ void MemLocation::reduce(MemLocation &Base, SILModule *Mod,
160
159
// alive.
161
160
bool Alive = true ;
162
161
for (auto &X : FirstLevel) {
163
- if (Locs.find (X) != Locs.end ())
164
- continue ;
165
- Alive = false ;
162
+ Alive &= Locs.find (X) != Locs.end ();
166
163
}
167
164
168
165
// All first level locations are alive, create the new aggregated location.
0 commit comments