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.
- Unapplied functions: `if #_hasSymbol(foo(_:))`
- Member references: `if #_hasSymbol(a.x)`
- `.self` expressions on static metatypes: `if #_hasSymbol(SomeEnum.self)`
- Dot syntax call expressions with unapplied functions: `if #_hasSymbol(SomeType.init(_:)`
Additionally, we diagnose when the concretely referenced declaration is not weak linked since this likely indicates that the programmer misidentified the declaration they wish to check or the build is not configured in a way such that the check will be meaningful.
Resolves rdar://99826340
Introduce the compiler directive `#_hasSymbol` which will be used to detect whether weakly linked symbols are present at runtime. It is intended for use in combination with `@_weakLinked import` or `-weak-link-at-target`.
```
if #_hasSymbol(foo(_:)) {
foo(42)
}
```
Parsing only; SILGen is coming in a later commit.
Resolves rdar://99342017