Skip to content

Revert "Revert "[cxx-interop] Import custom NS_OPTIONS correctly"" #68546

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

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

egorzhdan
Copy link
Contributor

@egorzhdan egorzhdan commented Sep 15, 2023

This re-lands #67865 after it got reverted in #68435 due to a regression when emitting a pch file.

rdar://112225263

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/reland-nsoptions branch from 0e32341 to 829b578 Compare September 15, 2023 16:27
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@zoecarver zoecarver left a comment

Choose a reason for hiding this comment

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

I think @DougGregor should look over this. But this LGTM. Moving getTypeDefForCXXCFOptionsDefinition into ASTContext is the fix we all discussed.

@@ -5732,6 +5732,48 @@ ASTContext::getClangTypeForIRGen(Type ty) {
return getClangTypeConverter().convert(ty).getTypePtrOrNull();
}

const clang::TypedefType *ASTContext::getTypedefForCXXCFOptionsDefinition(
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer not to have Clang-specific APIs on ASTContext. Can we keep this within the ClangImporter, e.g., by making it a static method there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, I made it a static method of ClangImporter

…ailable

This makes sure that we can emit a pch from a C++ header that uses `CF_OPTIONS`.

rdar://112225263
@egorzhdan egorzhdan force-pushed the egorzhdan/reland-nsoptions branch from 829b578 to 6a2f10a Compare September 18, 2023 20:54
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test macOS

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test Linux

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