Skip to content

PrintAsClang: Print #include to import headers used from @cdecl functions #81481

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xymus
Copy link
Contributor

@xymus xymus commented May 13, 2025

Start printing #include alternative to import modules and headers referenced from @cdecl function signatures. This adds on top of the existing tiered imports. We already print each module referenced from decls printed in the compatibility header with @import and an option to fallback on a #import. This change adds a third fallback to #include when the module is referenced from a @cdecl function signature. The bridging header is also be imported in a similar way with an #import with a fallback on a #include.

Followup to #80917 and #80744.

@xymus
Copy link
Contributor Author

xymus commented May 13, 2025

@swift-ci Please smoke test

@xymus xymus force-pushed the cdecl-includes branch 2 times, most recently from 12647d1 to b5cbdec Compare May 13, 2025 22:38
@xymus
Copy link
Contributor Author

xymus commented May 13, 2025

@swift-ci Please smoke test

xymus added 2 commits May 14, 2025 09:46
Start printing `#include` for headers referenced from `@cdecl` function
signatures. This adds on top of the existing tiered imports. We already
print each module referenced from decls printed in the compatibility
header. Previously we printed mostly `@import` with an option to
fallback on a `#import`. This change adds a third fallback to `#include`
when the module is referenced from a `@cdecl` function signature. The
bridging header can also be imported in a similar way.
@xymus xymus force-pushed the cdecl-includes branch from b5cbdec to b156851 Compare May 14, 2025 16:46
@xymus
Copy link
Contributor Author

xymus commented May 14, 2025

@swift-ci Please smoke test

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.

1 participant