Commit Graph

14 Commits

Author SHA1 Message Date
Alexis Laferrière
94113f4a83 SE-496: Remove references to features CDecl and CImplementation 2025-10-29 17:31:20 -07:00
Alexis Laferrière
659692e834 Tests: Update all uses of @c to use the identifier format 2025-10-24 11:55:34 -07:00
Alexis Laferrière
9ec824c20b Parser: Rename the experimental attribute @cdecl to @c
There's no users of `@cdecl` yet so we can do a direct rename. The
legacy `@_cdecl` remains unaffected.
2025-09-19 11:55:07 -07:00
Alexis Laferrière
beb980b1f3 AST: Support @cdecl enums without an explicit C name
Accept `@cdecl` enums without an explicit C name. The C name defaults to
the Swift one. It is printed using the `SWIFT_ENUM` macro instead of
`SWIFT_ENUM_NAMED`.
2025-07-01 14:10:53 -07:00
Alexis Laferrière
529cc3ccb6 Merge pull request #82039 from xymus/cdecl-enum
PrintAsClang: Introduce `@cdecl` enums
2025-06-30 09:56:28 -07:00
Alexis Laferrière
89f7ebfb18 Sema: @cdecl functions C name defaults to the Swift name 2025-06-11 12:42:38 -07:00
Alexis Laferrière
2601ff44d4 Parser: Accept @cdecl with an indentifier for the C name
Begin accepting the attribute in the form of `@cdecl(cName)`, using an
identifier instead of a string.

For ease of landing this change we still accept the string form. We
should stop accepting it before making this feature available in
production.
2025-06-11 12:42:38 -07:00
Alexis Laferrière
138e2daa3e PrintAsClang: Print @cdecl enums in the compatibility header
Print @cdecl enums in the C section of the compatibility header. Use and
extend the macros to support C compiler clients.

The macro is adapted to the features supported by the client compiler.
It uses an Objective-C style macro with raw type when available and
fallbacks to a simple typedef for C compatibility.
2025-06-09 11:54:13 -07:00
Alexis Laferrière
f6dd432450 PrintAsObjC Test: Test pointer types with @cdecl 2025-05-08 11:31:51 -07:00
Alexis Laferrière
0f98021708 PrintAsObjC Test: Don't use modules for C compatibility header tests 2025-05-06 16:18:49 -07:00
Alexis Laferrière
5e7887de64 PrintAsObjC Test: Don't use blocks in the @cdecl test 2025-05-06 16:18:49 -07:00
Alexis Laferrière
a55b190be2 PrintAsObjC Test: Extract what needs Objective-C out of cdecl-official 2025-04-18 15:23:23 -07:00
Alexis Laferrière
bcbdfeeb43 PrintAsObjC Test: Don't use -fobjc-arc when targeting the C language 2025-04-18 15:23:23 -07:00
Alexis Laferrière
02933b5b28 PrintAsClang: Print @cdecl in their own block in compatibility headers
Add a block for C clients in the compatibility header. This block
contains only the `@cdecl` functions that are printed using only C
types.

This C block is printed above the Objective-C and C++ blocks as if we
add support for `@cdecl` types other languages should be able to
reference them in function signatures. Other languages block don't
duplicate printing the `@cdecl` functions either as they are already
accessible to them.
2025-04-18 15:23:23 -07:00