Skip to content

Conversation

DougGregor
Copy link
Member

Deferred code generation only produces symbols when they are needed.
Expand this out to cover more of the cases where we need them:

  • @c/@_cdecl with and without @implementation
  • @_expose(Cxx) and @_expose(Wasm)
  • @_section and @_used
  • (already present) the main entry point

Part of the Embedded Swift linkage model. Also fixes #74328 /
rdar://147207945 along the way.

…tation

@c @implementation relies on matching the original C declaration. The
lookup for the original C declaration was doing the wrong kind of
lookup, meaning that it could only find the C declaration if it came
through a bridging header, and not through a normal module import.
Using unqualified lookup here finds the name appropriately.

Clarify the diagnostics here as well to not talk about umbrella and
bridging headers.

Fixes rdar://161909754.
…de generation

Deferred code generation only produces symbols when they are needed.
Expand this out to cover more of the cases where we need them:
* @c/@_cdecl with and without @implementation
* @_expose(Cxx) and @_expose(Wasm)
* @_section and @_used
* (already present) the main entry point

Part of the Embedded Swift linkage model. Also fixes swiftlang#74328 /
rdar://147207945 along the way.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@rauhul rauhul added the embedded Embedded Swift label Oct 3, 2025
@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

@DougGregor DougGregor merged commit cd7924a into swiftlang:main Oct 4, 2025
3 checks passed
@DougGregor DougGregor deleted the embedded-deferred-code-gen-external-symbols branch October 4, 2025 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedded Embedded Swift
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

@_cdecl doesn’t work in emdedded dependency
2 participants