diff --git a/crates/header-translator/src/main.rs b/crates/header-translator/src/main.rs index 031ad2ca3..bb5031a6f 100644 --- a/crates/header-translator/src/main.rs +++ b/crates/header-translator/src/main.rs @@ -387,7 +387,10 @@ fn get_translation_unit<'i: 'c, 'c>( "-Wextra", "-fobjc-arc", "-fobjc-arc-exceptions", + "-fexceptions", + "-fobjc-exceptions", "-fobjc-abi-version=2", // 3?? + "-fblocks", // "-fparse-all-comments", // TODO: "-fretain-comments-from-system-headers" "-isysroot", @@ -395,6 +398,10 @@ fn get_translation_unit<'i: 'c, 'c>( // See ClangImporter.cpp and Foundation/NSObjCRuntime.h "-D", "__SWIFT_ATTR_SUPPORTS_SENDABLE_DECLS=1", + "-D", + "__SWIFT_ATTR_SUPPORTS_SENDING=1", + // "-D", + // "__swift__=51000", // Enable modules. We do this by parsing the `.modulemap` instead // of a combined file containing includes, as the Clang AST from // dependent modules does not seem possible to access otherwise. @@ -409,10 +416,19 @@ fn get_translation_unit<'i: 'c, 'c>( // "-Xclang", // "-fmodule-format=raw", &format!("-fmodules-cache-path={}", tempdir.to_str().unwrap()), - // "-fsystem-module", "-Xclang", "-emit-module", &format!("-fmodule-name={module}"), + "-fsystem-module", + // "-fmodules-validate-system-headers", + // "-fmodules-search-all", + "-Xclang", + "-fno-modules-prune-non-affecting-module-map-files", + // "-Xclang", + // "-fmodule-feature", + // "-Xclang", + // "swift", + "-disable-objc-default-synthesize-properties", // Explicitly enable API notes (implicitly enabled by -fmodules). "-fapinotes", "-fapinotes-modules", diff --git a/crates/header-translator/src/unexposed_attr.rs b/crates/header-translator/src/unexposed_attr.rs index 8d836b1cf..53c5a76b4 100644 --- a/crates/header-translator/src/unexposed_attr.rs +++ b/crates/header-translator/src/unexposed_attr.rs @@ -126,6 +126,7 @@ impl UnexposedAttr { | "__TVOS_DEPRECATED" | "__WATCHOS_AVAILABLE" | "__WATCHOS_DEPRECATED" + | "_NS_SCANNER_DEPRECATED_FOR_SWIFT_ONLY_WITH_REPLACEMENT" | "API_AVAILABLE_BEGIN" | "API_AVAILABLE" | "API_DEPRECATED" @@ -134,6 +135,7 @@ impl UnexposedAttr { | "API_UNAVAILABLE_BEGIN" | "API_UNAVAILABLE" | "AUGRAPH_DEPRECATED" + | "AVF_DEPRECATED_FOR_SWIFT_ONLY" | "CF_AVAILABLE" | "CF_AVAILABLE_IOS" | "CF_AVAILABLE_MAC" @@ -146,8 +148,9 @@ impl UnexposedAttr { | "CI_GL_DEPRECATED_IOS" | "CI_GL_DEPRECATED_MAC" | "CIKL_DEPRECATED" - | "CK_UNAVAILABLE" | "CK_NEWLY_UNAVAILABLE" + | "CK_SWIFT_DEPRECATED" + | "CK_UNAVAILABLE" | "CT_AVAILABLE" | "CT_DEPRECATED" | "CT_DEPRECATED_WITH_REPLACEMENT"