Commit Graph

2331 Commits

Author SHA1 Message Date
Jordan Rose
df2e63d07d Diagnose modules with circular dependencies (#16075)
This can't arise from a clean build, but it can happen if you have
products lingering in a search path and then either rebuild one of
the modules in the cycle, or change the search paths.

The way this is implemented is for each module to track whether its
imports have all been resolved. If, when loading a module, one of its
dependencies hasn't resolved all of its imports yet, then we know
there's a cycle.

This doesn't produce the best diagnostics, but it's hard to get into
this state in the first place, so that's probably okay.

https://bugs.swift.org/browse/SR-7483
2018-05-02 15:01:09 -07:00
swift-ci
6cc68b46e7 Merge remote-tracking branch 'origin/master' into master-next 2018-04-19 22:09:52 -07:00
Ben Langmuir
773cd93812 Merge pull request #16042 from benlangmuir/sourcekitd-warnings
[sourcekitd] Fix some compiler warnings
2018-04-19 22:00:43 -07:00
Ben Langmuir
0aa11cb6b2 [sourcekitd] Fix some compiler warnings
* remove nullability attribute from a non-pointer argument
* const-correctness on custom buffer casts
* remove statically unreachable code
2018-04-19 14:27:08 -07:00
Ben Langmuir
23ab43c941 [sourcekitd] Change compile notifications to pass a single args string
... instead of an array of compiler arguments. This is good enough
for seeing what's going on, and it saves significant time for long
argument strings, because it doesn't create and destroy so many
xpc strings, and more of the string copying that happens is on a large
contiguous string instead of many small strings.

rdar://39538847
2018-04-19 13:59:27 -07:00
swift-ci
d5083722b2 Merge remote-tracking branch 'origin/master' into master-next 2018-04-19 13:48:19 -07:00
Ben Langmuir
31eae3675b [sourcekitd] Remove XPCTracing
This code was an experiment in how to collect information after a crash,
that did not end up being used.  It's unclear how much it has bitrotted
at this point, since it has no tests and was not designed with automated
testing in mind.  Parts of it interfere with some changes I want to make
to the underlying tracing mechanism, so I am finally removing it.  This
also lets us remove the buffer copying in the parts of tracing used by
the compile notifications, improving performance.

For rdar://39538847
2018-04-19 11:52:38 -07:00
swift-ci
17596b9329 Merge remote-tracking branch 'origin/master' into master-next 2018-04-19 11:47:13 -07:00
Ben Langmuir
b78daf5959 [sourcekitd-test] Add options to repeat a request and ignore its output
This provides a very rudimentary way to check the end-to-end performance
of simple sourcekitd requests. A sample invocation might be

```
sourcekitd-test -time-request -repeat-request=10 -dont-print-response -req= ...
```
2018-04-19 10:46:07 -07:00
Ben Langmuir
94140763da [sourcekitd-test] Add a flag -time-request
Allows simple timing of request. Includes only the time to make the
request and receive the reply, but not any additional deserialization
etc.
2018-04-19 10:43:46 -07:00
Ben Langmuir
a30ba5e4ab [sourcekitd-test] Print requests more consistently
Fixes request printing for format and syntax-map+edit requests.
2018-04-17 13:28:28 -07:00
swift-ci
999d8ba4bb Merge remote-tracking branch 'origin/master' into master-next 2018-04-13 14:42:44 -07:00
Ben Langmuir
e08c31759e [sourcekit] Remove dead UID value
This was renamed at some point and the usage in complete-test has become
dead anyway, so clean it up.
2018-04-13 13:49:57 -07:00
swift-ci
c34d9349ca Merge remote-tracking branch 'origin/master' into master-next 2018-04-11 22:53:54 -07:00
Rintaro Ishizaki
ad3e6b9471 [SourceKit] Make sourcekitd-test -req=demangle STDIN mode actually work
This didn't work at all because it didn't advance cursor after regex
matching.
Align regex with swift-demangle.
2018-04-11 20:08:52 +09:00
Rintaro Ishizaki
e9988589fb [SourceKit] Update demangle for new mangling
Use 'swift::Demangle::isSwiftSymbol()' instead of homemade function

rdar://problem/39286958
2018-04-11 20:08:27 +09:00
swift-ci
26651895b2 Merge remote-tracking branch 'origin/master' into master-next 2018-04-10 12:31:11 -07:00
Argyrios Kyrtzidis
3156180c08 [SourceKit] For the XPC service identifier, also include the platform name
This is useful because the embedded platforms may have the same toolchain version but they contain
different stdlibs. We need to make sure the XPC service name is unique between them, otherwise we may load
and use the incorrect toolchain service.

rdar://39077520
2018-04-10 11:24:55 -07:00
swift-ci
46b8a35b7a Merge remote-tracking branch 'origin/master' into master-next 2018-04-06 12:50:53 -07:00
Ben Langmuir
969f0f41f4 [sourcekitd] Capture diagnostics with invalid locations for compile notifications
Stop filtering out diagnostics with invalid locations in the editor
diagnostic consumer, and instead capture them separately so that we can
include them in did-compile notifications.

rdar://39225000
2018-04-06 11:36:01 -07:00
Ben Langmuir
cc51a8778f [sourcekitd] Remove dead method for checking invalid loc diagnostics 2018-04-05 16:02:32 -07:00
swift-ci
c21089ff19 Merge remote-tracking branch 'origin/master' into master-next 2018-03-30 17:29:07 -07:00
Ben Langmuir
10f21c77f3 Merge pull request #15641 from benlangmuir/compile-note-diags
[sourcekit] Add diagnostics to compile notification callback
2018-03-30 17:20:32 -07:00
swift-ci
77b3c53402 Merge remote-tracking branch 'origin/master' into master-next 2018-03-30 16:49:02 -07:00
Ben Langmuir
8c4c1863fc [sourcekit] Include diagnostics from code-completion in notification
The only interesting change here is that I stopped filtering out
non-note diagnostics from outside the "inputs".  This matches better how
code-completion gets inputs, and shouldn't hurt anything else since only
the tracing code will look at diagnostics that aren't in specific
buffers anyway.

rdar://38438512
2018-03-30 16:33:19 -07:00
Ben Langmuir
b78987a8c5 [sourcekit] Add diagnostics to compile notification callback
Compilations can now pass captured diagnostics as part of the
did-compile notification, and this was added to the SwiftASTManager.

rdar://38438512
2018-03-30 16:07:51 -07:00
Ben Langmuir
d8bb7d1c44 [sourcekitd-test] Synchronize notification printing
Notifications that we want to print for testing (e.g. with FileCheck)
are now buffered and drained explicitly from the queue that performs
requests.  This should prevent output intervleaving and ensure that we
actually print all the notifications that have been posted before
exiting (observed as rare test failures).

rdar://39048773
2018-03-30 15:31:33 -07:00
Ben Langmuir
8c78533e57 [sourcekit] Factor out common code for serializing diagnostics
Other than the extra field for the diagnostic stage in the editor
diagnostic handler, this code was byte-for-byte identical.
2018-03-30 10:19:29 -07:00
swift-ci
a597ade11b Merge remote-tracking branch 'origin/master' into master-next 2018-03-29 16:49:12 -07:00
Ben Langmuir
79d641d89b [sourcekit] Add optional compile notifications
When enabled, send a notification before/after every "compilation",
which for now means `performSema`. This piggy-backs and modifies some
existing code that we had for "tracing" operations in sourcekitd that
unfortunately was untested.  At least now some of the basic parts are
tested via the new notifications.

Part of rdar://38438512
2018-03-29 14:59:30 -07:00
Ben Langmuir
38963ce883 [sourcekit] Tweak traced operation to be single-operator per RAII object
This is how it was used in all but one place anyway, and makes it easier
to understand.  It also aligns better with some further refactoring I
want to do...
2018-03-29 14:05:57 -07:00
swift-ci
a2243aeb9c Merge remote-tracking branch 'origin/master' into master-next 2018-03-27 08:07:18 -07:00
Harlan
527cce409a [Syntax] Don't pretty-print -emit-syntax JSON output (#15380) 2018-03-27 10:55:59 -04:00
swift-ci
29011402dd Merge remote-tracking branch 'origin/master' into master-next 2018-03-26 09:11:11 -07:00
Doug Gregor
b2b69e8abf Rename BoundNameAliasType to NameAliasType.
NameAliasType is dead! Long live NameAliasType!
2018-03-25 21:35:17 -07:00
Doug Gregor
c43f96a855 [AST] Remove now-unused NameAliasType. 2018-03-25 21:35:16 -07:00
swift-ci
77ebdb3f51 Merge remote-tracking branch 'origin/master' into master-next 2018-03-23 10:30:51 -07:00
Argyrios Kyrtzidis
4dcfae7d39 Merge pull request #15440 from akyrtzi/sourcekitd-swift-version-as-string
[SourceKit] For the swift header interface request, accept the swift version as a string
2018-03-23 10:16:21 -07:00
Argyrios Kyrtzidis
455e87bd96 [SourceKit] For the swift header interface request, accept the swift version as a string
This is so we can pass the version as "4.2".

rdar://38673625
2018-03-22 16:32:24 -07:00
swift-ci
4c1d212192 Merge remote-tracking branch 'origin/master' into master-next 2018-03-22 13:29:26 -07:00
Doug Gregor
253bd10bd3 Cope with BoundNameAliasType in more places that handle NameAliasType. 2018-03-21 23:49:33 -07:00
swift-ci
2c0e422cc6 Merge remote-tracking branch 'origin/master' into master-next 2018-03-19 11:56:44 -07:00
Ray Fix
ac1f785b5f [SourceKit] Use WriteableMemoryBuffer to do the const_cast dirty work.
Based on PR feedback from @CodaFi
2018-03-19 00:05:51 -07:00
Ray Fix
055fa926be [SourceKit] Fix compiler warning.
Use const_cast instead of C style cast.
2018-03-18 18:09:56 -07:00
swift-ci
b8c1245d7e Merge remote-tracking branch 'origin/master' into master-next 2018-03-16 14:48:10 -07:00
Nathan Hawes
60a6c02328 Merge pull request #15301 from nathawes/rdar38550117-range-info-on-comment-mark-crashing
[refactoring] fix RangeInfo crash inside comment, due to unhandled invalid CharSourceRange
2018-03-16 14:46:10 -07:00
Nathan Hawes
ff76c265f3 [refactoring] fix RangeInfo crash inside comment, due to unhandled invalid CharSourceRange.
Resolves rdar://problem/38550117
2018-03-16 11:24:44 -07:00
swift-ci
d80ce649ed Merge remote-tracking branch 'origin/master' into master-next 2018-03-16 03:09:03 -07:00
Slava Pestov
34fd4ae512 AST: Use DeclBaseName::Kind::Constructor
Fixes <rdar://problem/35852727>, <https://bugs.swift.org/browse/SR-1660>,
<https://bugs.swift.org/browse/SR-6557>.
2018-03-16 00:25:56 -07:00
swift-ci
851b5679a0 Merge remote-tracking branch 'origin/master' into master-next 2018-03-15 01:49:32 -07:00