Commit Graph

9 Commits

Author SHA1 Message Date
Sam Pyankov f8c6174578 ClangImporter: Suppress warnings from system modules during pcm generation
Suppress Swift warnings (unresolvable_clang_decl) when generating
precompiled modules for system frameworks.

rdar://170174282
2026-02-13 10:26:22 -08:00
Doug Gregor 50ac566cca Use pure C headers with newtype 2026-01-05 17:53:29 -08:00
Mads Odgaard c92e5b47f3 Merge pull request #84574 from madsodgaard/android-availability 2025-10-20 10:40:37 +09:00
Yuta Saito 3f96cef3a4 [wasm] Add support for __builtin_va_list type mapping (#84029)
Cover all va_list family of types just aliased by __builtin_va_list, including __isoc_va_list from wasi-libc. This enables proper C interop for variable argument functions on WASI targets.

Close https://github.com/swiftlang/swift/issues/72398
2025-09-02 14:36:33 +01:00
Saleem Abdulrasool e4a6190fd4 tests: add a new test for the ClangImporter
Add a test case for shadowing definitions that are often used for
retraoctive aliasing and forward compatibility.
2025-06-09 14:46:30 -07:00
Saleem Abdulrasool c66d43e1c5 ClangImporter: enhance the importer to alias declarations
Import simple CPP macro aliases as aliases in Swift. Extend the macro
importer to import the following construct:

  ```
  #define alias aliasee
  ```

as the following Swift construct:

  ```
  @_transparent @inline(__always)
  var alias: type(of: aliasee) {
    aliasee
  }
  ```

This improves the QoI for Windows where there is a universal define
(`UNICODE`) which normally is used for translating APIs between ANSI and
Unicode variants, e.g.:

  ```
  #if defined(UNICODE)
  #define MessageBox MessageBoxW
  #else
  #define MessageBox MessageBoxA
  #endif
  ```

Global variables which are non-const also have a setter synthesized:

  ```
  @_transparent @inline(__always)
  var alias: type(of: aliasee) {
    get { return aliasee }
    set { aliasee = newValue }
  }
  ```
2025-06-08 12:45:40 -07:00
Tony Allevato 329261593e Add a test importing a Clang module with non-identifier characters.
This requires no additional work beyond just parsing the identifier because Clang module maps already support such names in quotes.
2025-03-11 17:18:43 -04:00
Becca Royal-Gordon fd84e7273d Rename module.map -> module.modulemap in tests
The legacy `module.map` spelling of module map files was deprecated by llvm/llvm-project#75142 and clang expects to remove support for them in the future. Switch all tests to use the supported spelling.

Fixes rdar://128431478.
2024-08-12 17:47:26 -07:00
Michael Spencer b2640e15e4 [test] Rename all module.map files to module.modulemap
`module.map` as a module map name has been discouraged since 2014, and
Clang will soon warn on its usage. This patch renames all instances of
`module.map` in the Swift tests to `module.modulemap` in preparation
for this change to Clang.

rdar://106123303
2023-08-21 15:58:59 -07:00