Also fix Edit::intersectsOrTouchesRange check only returning true when the
ranges overlapped, rather than when they overlapped or 'touched'.
Resolves rdar://problem/45108439
SourceKit's build is now ammenable to building for Windows. Generalize the path
to enable building it for Windows as well as Linux. The libdispatch build for
the compiler is needed for all non-Darwin targets currently.
In the case that a system update temporarily breaks the command, the output may
be empty, and this can cause CMake to fail in a weird manner. Quote the
variable to be more resilient to the transient failure.
Internal.h must be included before sourcekitd.h to ensure that we get the
correct definition for Windows targets. The inclusion of `sourcekitd.h` is not
needed after the inclusion of `Internal.h` so simply remove the inclusion.
On Darwin platforms, libdispatch and libBlocksRuntime are re-exported from
libSystem (via LC_REEXPORT_DYLIB). Other platforms do not have libdispatch and
libBlocksRuntime in their C runtime, so we need to explicitly link against them.
Now that we are building BlocksRuntime with hidden visibility, we do not
accidentally get the symbols from libdispatch.
sourcekitd_variant_t is only safe to use while the sourcekitd_response_t it was
retrieved from is still alive, so keep a strong reference to SourceKitdResponse
(the Swift wrapper of sourcekitd_response_t) in each Variant (the Swift wrapper
of sourcekitd_variant_t).
Fill in some of the Windows codepaths that were previously missing. This allows
us to at least compile the SourceKit sources. More changes are required to the
build system to use the correct compiler when cross-compiling to get the
dependencies correct.
Not all targets (CMAKE_SYSTEM_NAME) use `lib` and `.a` for the static library
name. Adjust the name properly for the host that we are building for. This
repairs the build when performing a cross-compile from Linux to Windows.
When building libdispatch for SourceKit, only enable the swift overlay
components if the swift standard library is being built. This allows building
just the compiler and SourceKit.
The decision to whether build InProc or as an XPC service is needed for the
test tools as well. Rather than recompute it for the tests as well, hoist it to
the top level for the SourceKit project. This repairs the build of the
SourceKit tests on non-Darwin hosts.
Module references get indexed as a 'module' symbol; they get USRs similar to how clang would assign a USR for a module reference.
JIRA: https://bugs.swift.org/browse/SR-8677