Commit Graph

1043 Commits

Author SHA1 Message Date
Alex Hoppen
4f43c8e93c [SourceKit] Make the NameLength of EnumElements take argument labels into account 2018-05-10 11:27:49 -07:00
swift-ci
40a72602ba Merge remote-tracking branch 'origin/master' into master-next 2018-05-08 03:09:13 -07:00
David Zarzycki
995dec5d82 [Sema] Error if ObjC interop is needed when disabled 2018-05-07 14:43:04 -04:00
swift-ci
6fc15527f8 Merge remote-tracking branch 'origin/master' into master-next 2018-05-02 19:29:35 -07:00
swift-ci
d037d29944 Merge pull request #16329 from nkcsgexi/doc-info-std-lib 2018-05-02 19:18:19 -07:00
Xi Ge
714775eb0a DocSupport: don't assume we've printed the first extension when merging several together. rdar://39887195
When printing the content of several extensions into a
synthesized one, we shouldn't assume the first extension in the
group always gets printed.
2018-05-02 17:46:41 -07:00
swift-ci
7056b65bf5 Merge remote-tracking branch 'origin/master' into master-next 2018-05-02 15:09:04 -07:00
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
c197010436 Merge remote-tracking branch 'origin/master' into master-next 2018-04-27 00:09:00 -07:00
Slava Pestov
392a5c2bcb AST: @usableFromInline and @inlinable are no longer user inaccessible 2018-04-26 22:58:56 -07:00
swift-ci
2160984b6f Merge remote-tracking branch 'origin/master' into master-next 2018-04-25 10:09:08 -07:00
Ben Langmuir
9496c63edc Merge pull request #15918 from johnfairh/typealias-where
[ASTPrinter] Print typealias generic requirements
2018-04-25 09:57:05 -07:00
swift-ci
385c223177 Merge remote-tracking branch 'origin/master' into master-next 2018-04-20 14:49:40 -07:00
Ben Langmuir
8ea2d0dded [BatchMode] Avoid spurious warnings in sourcekitd and indexing
Explicitly disable batch mode in createCompilerInvocation, since it uses
-force-single-frontend-invocation.  Previously we were getting spurious
warnings.  Also add a test that -disable-batch-mode will allow commands
that use -index-file to avoid the same warning, since that is likely
what they want to do as well.

rdar://39581506
2018-04-20 11:28:13 -07:00
swift-ci
6cc68b46e7 Merge remote-tracking branch 'origin/master' into master-next 2018-04-19 22:09:52 -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
Ben Langmuir
fc7db4d24b Merge pull request #16036 from benlangmuir/sourcekitd-test-enhancements
[sourcekitd-test] A few minor enhancements to support timing requests
2018-04-19 11:48:57 -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
swift-ci
b24860cb3e Merge remote-tracking branch 'origin/master' into master-next 2018-04-19 09:07:10 -07:00
Rintaro Ishizaki
7c7a7ab47c [ASTMangler] Allow to mangle any generic decl type
More specifically, generic `typealias` type.
For instance:

    typealias Pair<T, T> = (T, T)
    typealias PairAlias = Pair

Interface type of `PairAlias` is `Pair.Type`, not `(T, T).Type`
Fixes crash in sourcekit cursorinfo.

rdar://problem/34348776
2018-04-19 18:10:25 +09:00
John Fairhurst
6e38a636aa [ASTPrinter] Print typealias where clause 2018-04-14 12:04:29 +01:00
swift-ci
4d13553260 Merge remote-tracking branch 'origin/master' into master-next 2018-04-12 19:25:34 -07:00
Argyrios Kyrtzidis
0682756a72 Merge pull request #15743 from nathawes/rdar38231888-sourcekit-error-when-parsing-the-compiler-arguments
[Driver] Add -driver-filelist-threshold to set the number of inputs beyond which filelists are used
2018-04-12 19:10:40 -07:00
Nathan Hawes
0a4204e99f [Driver] Add -driver-filelist-threshold to set the number of inputs beyond which filelists are used
When generating a compiler invocation in driver::createCompilerInvocation()
we end up using filelists if the number of inputs is > 128 (to work around
command line arg limits). We never actually write them out though, and so
fail when parsing the frontend arguments that reference them.

As this function is called frequently by SourceKit and command line limits
aren't a concern here, this patch makes the 128 threshold value configurable
via a new -driver-filelist-threshold option. This is set to its maximum value
in driver::createCompilerInvocation() to ensure filelists aren't used. This
new option makes the existing -driver-use-filelists (that forces filelists to
be used) redundant as it's now equivalent to -driver-filelist-threshold=0.

Resolves rdar://problem/38231888
2018-04-12 05:24:03 -07:00
swift-ci
c34d9349ca Merge remote-tracking branch 'origin/master' into master-next 2018-04-11 22:53:54 -07: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
dda9241ea7 Merge remote-tracking branch 'origin/master' into master-next 2018-04-10 11:31:48 -07:00
Jordan Rose
6d30272bfd Merge pull request #14382 from jrose-apple/unknown-case
Implementation for `@unknown default`
2018-04-10 11:19:53 -07:00
swift-ci
cf6faba497 Merge remote-tracking branch 'origin/master' into master-next 2018-04-08 04:08:05 -07:00
David Zarzycki
d9f7d1414e Merge pull request #15818 from davezarzycki/nfc_metaprogram_contextual_decl_keywords
[Parsing] NFC: metaprogram contextual decl keywords into Attr.def
2018-04-08 06:52:03 -04:00
swift-ci
d7744cc9c1 Merge remote-tracking branch 'origin/master' into master-next 2018-04-07 16:10:18 -07:00
David Zarzycki
7174d14dad [Parsing] NFC: metaprogram contextual decl keywords into Attr.def 2018-04-07 18:00:12 -04:00
John McCall
7815892a76 Add unique typo corrections to the main diagnostic with a fix-it.
Continue to emit notes for the candidates, but use different text.
Note that we can emit a typo correction fix-it even if there are
multiple candidates with the same name.

Also, disable typo correction in the migrator, since the operation
is quite expensive, the notes are never presented to the user, and
the fix-its can interfere with the migrator's own edits.

Our general guidance is that fix-its should be added on the main
diagnostic only when the fix-it is highly likely to be correct.
The exact threshold is debateable.  Typo correction is certainly
capable of making mistakes, but most of its edits are right, and
when it's wrong it's usually obviously wrong.  On balance, I think
this is the right thing to do.  For what it's worth, it's also
what we do in Clang.
2018-04-07 16:01:39 -04:00
Michael Gottesman
dd7720a024 Disable two failing tests.
rdar://39260564
2018-04-07 10:15:02 -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
Jordan Rose
701975ad1d Add parsing support for @unknown (SE-0192)
This is our first statement attribute, made more complicated by the
fact that a 'case'/'default' isn't really a normal statement. I've
chosen /not/ to implement a general statement attribute logic like we
have for types and decls at this time, but I did get the compiler
parsing arbitrary attributes before 'case' and 'default'. As a bonus,
we now treat all cases within functions as being switch-like rather
than enum-like, which is better for recovery when not in a switch.
2018-04-05 16:35:14 -07:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -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
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
Nathan Hawes
73ac297736 Merge pull request #15630 from nathawes/rdar39011293-range-resolver-assertion-hit
[IDE] Fix imbalanced walkToDeclPre/Post calls in SemaAnnotator for IfConfigDecls
2018-03-30 15:45:27 -07:00
Nathan Hawes
8fab22f124 [IDE] Fix imbalanced walkToDeclPre/Post calls in SemaAnotator for IfConfigDecls.
Resolves rdar://problem/39011293.
2018-03-30 13:03:49 -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
Robert Widmann
b49c43d2bd Merge pull request #15562 from CodaFi/param-reset
Add a parameter list to EnumElementDecl
2018-03-28 00:56:37 -04:00
Robert Widmann
03580d2fe5 Add a parameter list to EnumElementDecl
This models, but does not plumb through, default arguments.
2018-03-28 00:05:56 -04:00
Davide Italiano
b4a19cc6ac [Mangler] Fix mangling for associated types. 2018-03-27 11:06:15 -07:00
Harlan
527cce409a [Syntax] Don't pretty-print -emit-syntax JSON output (#15380) 2018-03-27 10:55:59 -04:00
Doug Gregor
9cfbd30215 Update SourceKit test's expected output for sugaring changes. 2018-03-25 21:35:16 -07:00