Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions lib/SIL/Projection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,20 +599,7 @@ ProjectionPath::expandTypeIntoLeafProjectionPaths(SILType B, SILModule *Mod,

LLVM_DEBUG(llvm::dbgs() << "Visiting type: " << Ty << "\n");

// Get the first level projection of the current type.
Projections.clear();
Projection::getFirstLevelProjections(Ty, *Mod, Projections);

// Reached the end of the projection tree, this field can not be expanded
// anymore.
if (Projections.empty()) {
LLVM_DEBUG(llvm::dbgs() << " No projections. "
"Finished projection list\n");
Paths.push_back(PP);
continue;
}

// If this is a class type, we also have reached the end of the type
// If this is a class type, we have reached the end of the type
// tree for this type.
//
// We do not push its next level projection into the worklist,
Expand All @@ -635,6 +622,19 @@ ProjectionPath::expandTypeIntoLeafProjectionPaths(SILType B, SILModule *Mod,
continue;
}

// Get the first level projection of the current type.
Projections.clear();
Projection::getFirstLevelProjections(Ty, *Mod, Projections);

// Reached the end of the projection tree, this field can not be expanded
// anymore.
if (Projections.empty()) {
LLVM_DEBUG(llvm::dbgs() << " No projections. "
"Finished projection list\n");
Paths.push_back(PP);
continue;
}

// Keep expanding the location.
for (auto &P : Projections) {
ProjectionPath X(B);
Expand Down