Skip to content

IRGen: Only emit PragmaCommentDecls if building for Windows, or LTO is enabled [5.4] #35796

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

slavapestov
Copy link
Contributor

clang::DeclContext::decls_begin() deserializes all the pre-compiled headers
imported into the current translation unit, which is expensive.

Workaround this by disabling the emission of PragmaCommentDecls unless we're
building for a Windows target, or LTO is enabled.

A better fix would be to serialize a separate index for PragmaCommentDecls
so that they can be deserialized without deserializing everything else.
I filed rdar://problem/74036099 to track the longer-term fix.

Fixes rdar://problem/73951264.

…s enabled

clang::DeclContext::decls_begin() deserializes all the pre-compiled headers
imported into the current translation unit, which is expensive.

Workaround this by disabling the emission of PragmaCommentDecls unless we're
building for a Windows target, or LTO is enabled.

A better fix would be to serialize a separate index for PragmaCommentDecls
so that they can be deserialized without deserializing everything else.
I filed rdar://problem/74036099 to track the longer-term fix.

Fixes rdar://problem/73951264.
@slavapestov slavapestov requested a review from a team as a code owner February 5, 2021 20:38
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov changed the title IRGen: Only emit PragmaCommentDecls if building for Windows, or LTO is enabled IRGen: Only emit PragmaCommentDecls if building for Windows, or LTO is enabled [5.4] Feb 5, 2021
@airspeedswift
Copy link
Member

Original: #35747

@slavapestov slavapestov merged commit 57d601f into swiftlang:release/5.4 Feb 6, 2021
@AnthonyLatsis AnthonyLatsis added swift 5.4 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants