Commit Graph

6 Commits

Author SHA1 Message Date
Allan Shortlidge
164ac421d6 Sema: Lift restriction preventing use of #_hasSymbol on non-Darwin platforms.
An early approach to codegen for `#_hasSymbol` relied on the Darwin platfom SDK, but now that the feature lowers directly to NULL checks in LLVM IR a platform restriction is no longer needed.

However, the tests for `#_hasSymbol` remain unsupported on Windows since that OS does not support weak linking.
2022-11-30 14:58:28 -08:00
Allan Shortlidge
3da18b6e68 SIL: Serialize and deserialize has_symbol instructions. 2022-11-16 16:07:59 -08:00
Allan Shortlidge
7e85fd0245 Test: Disable Interpreter/has_symbol.swift for device_run in addition to remote_run. 2022-11-12 10:46:35 -08:00
Allan Shortlidge
8b84752969 Test: Add UNSUPPORTED: remote_run to Interpreter/has_symbol.swift.
This test involves dylib manipulation so it doesn't support device testing.
2022-11-10 14:01:27 -08:00
Allan Shortlidge
936debde40 IRGen: Disable Interpreter/has_symbol.swift for optimized builds. 2022-11-09 14:21:51 -08:00
Allan Shortlidge
7f20380f0b IRGen: Generate #_hasSymbol query functions.
For each decl that needs a `#_hasSymbol()` query function, emit the corresponding helper function body during IRGen. Use `IRSymbolVisitor` to collect linkable symbols associated with the decl and return true from the helper function if the address of every associated symbol is non-null.

Resolves rdar://101884587
2022-11-04 11:19:29 -07:00