Skip to content

[silgen] Mark a bunch of functions that SILGen open-codeds as "auto-generated" and thus not user generated code. #33166

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

Conversation

gottesmm
Copy link
Contributor

This ensures that we do not emit diagnostics onto these functions. I noticed we
were doing this with my work on opt-remarks when I was hitting diagnostics in
these functions in a set of subsequent commits.

The way that I found these is that I went through this file and looked for any
cases where we were never calling emitStmt on a user provided function body.

I also eliminated two places where we were setting a new DebugScope even though
preEmitFunction already does that for us.

@gottesmm gottesmm requested review from slavapestov and jckarter July 28, 2020 20:29
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

@swift-ci test source compatibility

@gottesmm
Copy link
Contributor Author

Doing a bigger test to make sure nothing changes (in a paranoid sort of way)

@@ -1284,22 +1302,22 @@ void SILGenModule::emitDestructor(ClassDecl *cd, DestructorDecl *dd) {
if (dd->hasBody()) {
SILDeclRef destroyer(dd, SILDeclRef::Kind::Destroyer);
SILFunction *f = getFunction(destroyer, ForDefinition);
preEmitFunction(destroyer, dd, f, dd);
RegularLocation loc(dd);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems like NFC here (which would be correct). Just making sure, is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it to match the code all around to it.

Copy link
Contributor

@jckarter jckarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall.

@gottesmm gottesmm force-pushed the pr-824f03205dd43d5614f7605c3f3ae53ac78be8cb branch from 32532c7 to f3476ba Compare July 28, 2020 21:09
…enerated" and thus not user generated code.

This ensures that we do not emit diagnostics onto these functions. I noticed we
were doing this with my work on opt-remarks when I was hitting diagnostics in
these functions in a set of subsequent commits.

The way that I found these is that I went through this file and looked for any
cases where we were never calling emitStmt on a user provided function body.

I also eliminated two places where we were setting a new DebugScope even though
preEmitFunction already does that for us.
@gottesmm gottesmm force-pushed the pr-824f03205dd43d5614f7605c3f3ae53ac78be8cb branch from f3476ba to e3fa137 Compare July 28, 2020 21:11
@gottesmm
Copy link
Contributor Author

@swift-ci test

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

@swift-ci test source compatibility

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci test source compatibility

@gottesmm
Copy link
Contributor Author

@swift-ci test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 32532c7c8ffc14e2f8dbb5d7eeca65a0e4cd0544

@gottesmm
Copy link
Contributor Author

@swift-ci test windows platform

@gottesmm
Copy link
Contributor Author

Release did not fail b/c of this commit. Build error.

@gottesmm gottesmm merged commit 158eff1 into swiftlang:master Jul 29, 2020
@gottesmm gottesmm deleted the pr-824f03205dd43d5614f7605c3f3ae53ac78be8cb branch July 29, 2020 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants