Commit Graph

2331 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
92377cc145 [CMake] Move cross-platform dispatch/blocks support to the tools level, in preparation for the syntax parser library 2018-12-05 22:41:39 -08:00
Xi Ge
5da65ac704 Merge pull request #21013 from nkcsgexi/doc-support
Sourcekit/DocSupport: include fully annotated generic signatures for extension decls.
2018-12-05 18:31:29 -08:00
swift-ci
39161d5b36 Merge pull request #20600 from adrian-prantl/36032653 2018-12-05 17:01:58 -08:00
Adrian Prantl
d63debeb60 Experimental: Extend ClangImporter to import clang modules from DWARF
When debugging Objective-C or C++ code on Darwin, the debug info
collected by dsymutil in the .dSYM bundle is entirely
self-contained. It is possible to debug a program, set breakpoints and
print variables even without having the complete original source code
or a matching SDK available. With Swift, this is currently not the
case. Even though .dSYM bundles contain the binary .swiftmodule for
all Swift modules, any Clang modules that the Swift modules depend on,
still need to be imported from source to even get basic LLDB
functionality to work. If ClangImporter fails to import a Clang
module, effectively the entire Swift module depending on it gets
poisoned.

This patch is addressing this issue by introducing a ModuleLoader that
can ask queries about Clang Decls to LLDB, since LLDB knows how to
reconstruct Clang decls from DWARF and clang -gmodules producxes full
debug info for Clang modules that is embedded into the .dSYM budle.

This initial version does not contain any advanced functionality at
all, it merely produces an empty ModuleDecl. Intertestingly, even this
is a considerable improvement over the status quo. LLDB can now print
Swift-only variables in modules with failing Clang depenecies, and
becuase of fallback mechanisms that were implemented earlier, it can
even display the contents of pure Objective-C objects that are
imported into Swift. C structs obviously don't work yet.

rdar://problem/36032653
2018-12-05 13:54:13 -08:00
Adrian Prantl
ff63eaea6f Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

      for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
2018-12-04 15:45:04 -08:00
Xi Ge
d620dfae5e Sourcekit/DocSupport: include fully annotated generic signatures for extension decls. rdar://40906297 2018-12-04 14:29:28 -08:00
Xi Ge
7f7a756ea4 sourcekit: avoid evaluating pound conditions while perform syntactic parsing. rdar://46143404 2018-12-03 14:56:25 -08:00
swift-ci
cf1be5e644 Merge pull request #20427 from rockbruno/sourcekit-operators 2018-11-30 09:02:57 -08:00
Karoy Lorentey
36f048402f [SourceKit] SourceKitdUID: Implement hash(into:) rather than hashValue 2018-11-29 17:57:13 +00:00
Harlan Haskins
245109d909 Merge pull request #20250 from harlanhaskins/accessorizing
[ParseableInterface] Standardize printing for accessors
2018-11-27 10:31:17 -08:00
Harlan Haskins
a64a4e1940 [Sema] Add implicit @_hasStorage attribute for printing 2018-11-26 18:42:02 -08:00
Jordan Rose
6afe77ae98 [CMake] Clean up (somewhat) the generated Xcode project (#20586)
Still to do: have command-only targets that present sources, for things
like copy_shim_headers.
2018-11-26 11:31:41 -08:00
Nathan Hawes
2964b58699 Merge pull request #20055 from nathawes/r45273748-speculative-fix-for-asan-bot-sourcekit-failures
[sourcekit] Fix for Ubuntu 16.04 Swift ASAN bot sourcekitd-test failures
2018-11-08 22:29:27 -08:00
Bruno Rocha
6f1f1bda92 [SourceKit] Recognize static method operators 2018-11-08 12:33:06 -02:00
Nathan Hawes
15dd6f920a [sourcekit] Fix for Ubuntu 16.04 Swift ASAN bot failures
Don't mix and match between the just-built clang and the host clang when
ASAN is enabled.

rdar://problem/45273748
2018-11-07 17:29:13 -08:00
Nathan Hawes
23d461d652 [SourceKit] Expose the data variant sourcekitd apis in the SwiftLang wrapper
These were recently added to support returning the SyntaxTree in the bytetree
from SourceKit but were never added in SwiftLang (the Swift layer wrapping
SourceKit).
2018-11-06 14:27:00 -08:00
Nathan Hawes
fd2c35e757 [SourceKit] Make each Variant keep a strong reference to its SourceKitdResponse context
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).
2018-11-06 13:19:34 -08:00
Argyrios Kyrtzidis
4d7ee807da [sourcekitd] Make sure to put '-resource-dir' argument in front to allow overriding it by the passed in arguments
Otherwise, passing a custom '-resource-dir' option will be ignored.
rdar://45764554
2018-11-03 21:55:50 -07:00
Slava Pestov
9c50867370 Move RemoteAST's RemoteASTTypeBuilder to lib/AST/ASTDemangler.cpp 2018-11-02 18:19:40 -04:00
Michael Gottesman
3f17bb6ddf Carefully split the build's invocation of add_swift_library into host/target variants.
The key thing here is that all of the underlying code is exactly the same. I
purposely did not debride anything. This is to ensure that I am not touching too
much and increasing the probability of weird errors from occurring. Thus the
exact same code should be executed... just the routing changed.
2018-10-27 12:58:51 -07:00
Saleem Abdulrasool
2f8a4dbf4a Merge pull request #19933 from compnerd/micro-opt
SourceKit: micro-optimization of CMake (NFC)
2018-10-19 14:58:20 -07:00
Saleem Abdulrasool
13c83b121e SourceKit: always install headers
Ensure that we install the client header for the InProc sourcekitd. This is
needed to actually make it usable. With this, it is now possible to develop
against SourceKit on Linux and Windows.
2018-10-17 15:01:27 -07:00
Saleem Abdulrasool
8395e355e5 SourceKit: micro-optimization of CMake (NFC)
Set all the target properties in a single shot.  This avoids the multiple string
parsing within CMake.  Although this makes no noticable differnce, it is
slightly more efficient and also colocates all the target properties.
2018-10-17 14:53:24 -07:00
Ben Langmuir
98ceebe6e8 Add dependency on the libdispatch-install step
Libraries in sourcekitd depending on the external libdispatch project
appear to only depend on the *build* step, but really need the install
to happen as well since we are linking to the installed location.
2018-10-16 15:56:00 -07:00
Saleem Abdulrasool
c20a7550d4 build: correct case for compiler id
The STREQUAL would fail as the C in Clang for the compiler ID is capital.
Correct the case.
2018-10-15 16:20:59 -07:00
Saleem Abdulrasool
ed3cb02475 build: use the host compiler if possible (#19888)
Attempt to use the host compiler when building libdispatch for SourceKit.  This
is needed for cross-compiling scenarios (e.g. building the Windows toolchain on
Linux).  However, unfortunately, the Ubuntu 14.04 build bots are using an
ancient compiler, so we cannot use that for building libdispatch.  Add a
fallback to the just built clang.  Ensure that the fallback only activates when
compiling on the same host as the target.
2018-10-15 15:13:45 -07:00
Argyrios Kyrtzidis
f913a239f8 [SourceKit] Avoid the 'error: no input files' diagnostic notification for syntactic-only requests
rdar://44989868
2018-10-13 09:48:00 -07:00
Argyrios Kyrtzidis
feffd2c5d4 [sourcekitd] In the fatal error handler, don't call abort() if gen_crash_diag is false
rdar://44046820
2018-10-13 07:34:56 -07:00
Nathan Hawes
b1c8013701 Merge pull request #19782 from nathawes/incremental-parsing-bug
[incrParse] Fix bug mapping a node's location back to its location in the cached syntax tree
2018-10-12 15:43:11 -07:00
Ross Bayer
c1f17f00c2 Changed the external project build for libdispatch in tools/SourceKit to use the just-build clang and clang++ rather than the system versions (rdar://45148295). (#19845) 2018-10-12 14:53:04 -07:00
Erik Eckstein
7f988f86d7 fix a linker error on the benchmark bot
It looks like removing this dependency (https://github.com/apple/swift/pull/19798) caused the linker error on https://ci.swift.org/view/Pull%20Request/job/swift-PR-osx-perf/
2018-10-11 12:37:27 -07:00
Doug Gregor
264b680e96 Merge branch 'master' into immortal-type-checker 2018-10-10 20:36:23 -07:00
Doug Gregor
599e07e5d9 [Type checker] Keep the type checker alive as long as the ASTContext is.
It is possible for the SIL optimizers, IRGen, etc. to request information
from the AST that only the type checker can provide, but the type checker
is typically torn down after the “type checking” phase. This can lead to
various crashes late in the compilation cycle.

Keep the type checker instance around as long as the ASTContext is alive
or until someone asks for it to be destroyed.

Fixes SR-285 / rdar://problem/23677338.
2018-10-10 16:44:42 -07:00
swift-ci
2fedf28c64 Merge pull request #19800 from compnerd/repackage 2018-10-09 16:51:49 -07:00
Saleem Abdulrasool
0295a83237 SourceKit: re-package libdispatch, BlocksRuntime
The SourceKit component requires libdispatch and BlocksRuntime to run.
We build the libraries as part of the build and use it via imported
targets.  Ensure that the dependencies get installed for use at runtime.
2018-10-09 13:23:24 -07:00
Saleem Abdulrasool
db7b7a7010 SourceKit: the swift-lang requires the standard library
The swift-lang swift module requires the standard library to be built and is
part of the standard library component.  Ensure that this is taken into
consideration when we attempt to build it.
2018-10-09 12:14:11 -07:00
Nathan Hawes
5c568af436 [incrParse] Fix bug mapping a node's location back to its location in the cached syntax tree
Also fix Edit::intersectsOrTouchesRange check only returning true when the
ranges overlapped, rather than when they overlapped or 'touched'.

Resolves rdar://problem/45108439
2018-10-08 15:44:38 -07:00
Saleem Abdulrasool
0df7b2f4be SourceKit: enable builds for Windows
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.
2018-10-04 16:44:54 -07:00
Saleem Abdulrasool
6ab8389ecf Merge pull request #19674 from compnerd/shared-blocks-are-back
SourceKit: use shared BlocksRuntime
2018-10-04 15:31:57 -07:00
Nathan Hawes
b5b1d9ab23 Revert "[SourceKit] Make each Variant keep a strong reference to its SourceKitdResponse context" 2018-10-04 10:36:17 -07:00
Saleem Abdulrasool
a140c41ce0 build: be a bit more resilient
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.
2018-10-03 18:24:17 -07:00
Saleem Abdulrasool
7c9b6f03bf Merge pull request #19668 from compnerd/explicit-BlocksRuntime
SourceKit: explicitly link against BlocksRuntime as well
2018-10-03 18:13:36 -07:00
swift-ci
ebd4d9f67c Merge pull request #19680 from compnerd/exports 2018-10-03 16:43:33 -07:00
Nathan Hawes
700384aed4 Merge pull request #19689 from nathawes/keep-sourcekitd-response-alive-while-variant-lives
[SourceKit] Make each Variant keep a strong reference to its SourceKitdResponse context
2018-10-03 16:11:20 -07:00
Saleem Abdulrasool
309e4dafc1 SourceKit: correct header include order
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.
2018-10-03 13:56:40 -07:00
Saleem Abdulrasool
e7bc37b748 SourceKit: explicitly link against BlocksRuntime as well
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.
2018-10-03 13:36:18 -07:00
Nathan Hawes
88b1ae9d50 [SourceKit] Make each Variant keep a strong reference to its SourceKitdResponse context
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).
2018-10-03 11:07:04 -07:00
Saleem Abdulrasool
3469797df5 SourceKit: use shared BlocksRuntime
Adjust the SourceKit's embedded libdispatch build to use the shared build of
BlocksRuntime now that we can generate that.
2018-10-03 09:27:49 -07:00
Saleem Abdulrasool
2493b11f27 sourcekitd-test: be more error resilient
Ensure that we handle the error case as well.  Fix up the type mismatches in the
process.
2018-10-02 15:45:53 -07:00
Saleem Abdulrasool
33e9037f64 SourceKit: handle Windows codepaths better
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.
2018-10-01 21:35:14 -07:00