Create a new capturing substitution for adding a rpath to a target
library. This is needed as Windows doesn't really support the concept
of a rpath. This also makes it possible to remove the parameter from
the command line on windows.
Thanks to @jrose for the hint about the substitution ordering, the new
substitution now works even inside the capture group. Replace the
remaining uses to the new macro.
The naming convention is different on Windows than on Unix-like
environments. In order to follow the convention we need to substitute
the prefix and the suffix. Take the opportunity to rename the
`target-dylib-extension` to the CMake-like variable
`target-shared-library-suffix` and introduce
`target-shared-library-prefix`. This helps linking the test suite
binaries on Windows.
If a protocol witness table requires instantiation, the runtime
needs to call the witness table accessor when looking up the
conformance in swift_conformsToProtocol().
We had a bit of code for this already, but it wasn't fully
hooked up. Change IRGen to emit a reference to the witness table
accessor rather than the witness table itself if the witness
table needs instantiation, and add support to the runtime for
calling the accessor.
Now that we apply the callback with the correct generic signature, the
assert can go away. It was being triggered if the protocol extension was
defined in a different resilience domain; otherwise we prefer direct
access anyway.
Note that materializeForSet now has to be able to re-abstract Self when
invoking the callback, since we might have to go from a thin metatype
to a thick metatype.