-
Notifications
You must be signed in to change notification settings - Fork 10.5k
More progress on uncurry level removal #12785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More progress on uncurry level removal #12785
Conversation
@swift-ci Please smoke test |
@gottesmm You might want to take a quick look at this one. Just mechanical changes, no effect on generated SIL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some requests for more documentation.
@@ -1327,7 +1327,7 @@ bool SILParser::parseSILDeclRef(SILDeclRef &Result, | |||
|
|||
// Construct SILDeclRef. | |||
Result = SILDeclRef(VD, Kind, expansion, /*isCurried=*/false, IsObjC); | |||
if (uncurryLevel < Result.getUncurryLevel()) | |||
if (uncurryLevel < Result.getParameterListCount() - 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a constant - 1 here, can you turn this into a method on Result with a descriptive name/comment.
if (kind == Kind::DefaultArgGenerator) | ||
return 0; | ||
return getNaturalUncurryLevel(getDecl()); | ||
unsigned SILDeclRef::getParameterListCount() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add more documentation here and use early-exits instead of else-if return?
What I want is for each case to say /why/ it has X amounts of parameters. For instance, why does ClassDecl have 2 parameters? It would also be nice to have a bigger comment explaining this methods use/importance in the larger world of SIL.
@@ -1777,7 +1777,7 @@ static bool isImporterGeneratedAccessor(const clang::Decl *clangDecl, | |||
return false; | |||
|
|||
// Must be a type member. | |||
if (constant.getUncurryLevel() != 1) | |||
if (constant.getParameterListCount() != 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here why you are checking against 2? Couldn't this be a method on SILDeclRef with a nice comment that explains what is happening here?
Almost gone!