Skip to content

Commit 1a08f52

Browse files
authored
Merge pull request #4441 from trentxintong/EnumProj
Small comment fix in FSO
2 parents 56595b3 + 7842e5c commit 1a08f52

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/swift/SIL/Projection.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,9 @@ class ProjectionTree {
870870
bool isSingleton() const {
871871
// If we only have one root node, there is no interesting explosion
872872
// here. Exit early.
873+
//
874+
// NOTE: In case of a type unable to be exploded, e.g. enum, we treated it
875+
// as a singleton.
873876
if (ProjectionTreeNodes.size() == 1)
874877
return true;
875878

include/swift/SILOptimizer/Utils/FunctionSignatureOptUtils.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ struct ArgumentDescriptor {
107107
// See if the projection tree consists of potentially multiple levels of
108108
// structs containing one field. In such a case, there is no point in
109109
// exploding the argument.
110+
//
111+
// Also, in case of a type can not be exploded, e.g an enum, we treat it
112+
// as a singleton.
110113
if (ProjTree.isSingleton())
111114
return false;
112115

0 commit comments

Comments
 (0)