Commit Graph

2062 Commits

Author SHA1 Message Date
swift-ci
0d8e3e1d71 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-07-29 09:14:39 -07:00
Doug Gregor
41817229d5 Merge pull request #33147 from DougGregor/async-function-types
[Concurrency] Add `async` to the Swift type system.
2020-07-29 08:59:34 -07:00
Nathan Hawes
498e767765 Manually merge remote-tracking branch 'upstream/master' into merge-m-to-mr 2020-07-27 22:41:53 -07:00
Doug Gregor
f6e9f352f0 [Concurrency] Add async to the Swift type system.
Add `async` to the type system. `async` can be written as part of a
function type or function declaration, following the parameter list, e.g.,

  func doSomeWork() async { ... }

`async` functions are distinct from non-`async` functions and there
are no conversions amongst them. At present, `async` functions do not
*do* anything, but this commit fully supports them as a distinct kind
of function throughout:

* Parsing of `async`
* AST representation of `async` in declarations and types
* Syntactic type representation of `async`
* (De-/re-)mangling of function types involving 'async'
* Runtime type representation and reconstruction of function types
involving `async`.
* Dynamic casting restrictions for `async` function types
* (De-)serialization of `async` function types
* Disabling overriding, witness matching, and conversions with
differing `async`
2020-07-27 18:18:03 -07:00
Varun Gandhi
aeda622298 [NFC] Rename ExtInfo::Uncommon to ExtInfo::ClangTypeInfo.
The previous name was poorly chosen (by me). Time to fix that.
2020-07-27 13:40:32 -07:00
Varun Gandhi
a174e5714b [Gardening] Update clang-function-type-serialization comments.
We have landed support for serialization Clang function types, but there is
still work to be done here.

Moreover, we should use a consistent style with `[(FIXME|TODO|NOTE): label]`,
instead of using different styles throughout the code.
2020-07-25 23:27:18 -07:00
Nathan Hawes
9d4ed5f39c Manually merge remote-tracking branch 'upstream/master' into manually-merge-master-to-master-rebranch 2020-07-20 16:09:55 -07:00
Michael Gottesman
d2f986739c Merge pull request #32940 from gottesmm/pr-8414ddbc369ed5bb8c0622162de920b962426cf1
[ast] Rename VarPattern -> BindingPattern.
2020-07-18 20:47:21 -07:00
Michael Gottesman
092edd6621 [ast] Rename VarPattern -> BindingPattern.
VarPattern is today used to implement both 'let' and 'var' pattern bindings, so
today is already misleading. The reason why the name Var was chosen was done b/c
it is meant to represent a pattern that performs 'variable binding'. Given that
I am going to add a new 'inout' pattern binding to this, it makes sense to
give it now a better fitting name before I make things more confusing.
2020-07-16 18:56:01 -07:00
Brent Royal-Gordon
acc01aea03 [NFC] Add MagicIdentifierKinds.def
Extracts the list of magic identifier literal kinds into a separate file and updates a lot of code to use macro metaprogramming instead of naming half a dozen cases manually. This is a complicated change, but it should be NFC.
2020-07-13 14:05:13 -07:00
Alexis Laferrière
de2774799e Merge pull request #32211 from xymus/fix-invalid-spi-attr
[ModuleInterface] Don't print SPI attributes on unsupported decls
2020-07-09 13:04:15 -07:00
swift_jenkins
63f5e3401f Merge remote-tracking branch 'origin/master' into master-next 2020-07-01 08:39:15 -07:00
David Zarzycki
fae2c19edb NFC: Make SILType.h and SILDeclRef.h not depend on SIL/*.h
SILType and SILDeclRef do not actually need anything from SIL/*.h. Also,
a few dependencies can be pushed out of the headers into cpp files to
speed up incremental rebuilds.
2020-07-01 08:05:58 -04:00
swift_jenkins
d2679a4228 Merge remote-tracking branch 'origin/master' into master-next 2020-06-19 22:58:11 -07:00
Robert Widmann
90cb347cd9 Merge pull request #32466 from martinboehme/pass-print-options-by-const-ref
Pass PrintOptions by const reference instead of by value.
2020-06-19 22:44:13 -07:00
swift_jenkins
6665a14f22 Merge remote-tracking branch 'origin/master' into master-next 2020-06-19 14:18:51 -07:00
Anthony Latsis
01e6cb35a9 Merge pull request #31812 from AnthonyLatsis/substitution-revolution-pre-1
[NFC] AST: Define SubstitutionMap::getInnermostReplacementTypes
2020-06-20 00:11:07 +03:00
Martin Boehme
0f7eb02559 Pass PrintOptions by const reference instead of by value.
`PrintOptions` likely started as a small type that made sense to pass by
value, but it's become big enough that passing by const reference is
more efficient now.
2020-06-19 14:27:39 +02:00
swift_jenkins
532f7d849a Merge remote-tracking branch 'origin/master' into master-next 2020-06-10 19:38:48 -07:00
Robert Widmann
426d930d10 Merge pull request #32301 from CodaFi/location-location-location
Strip TypeLoc out of Patterns
2020-06-10 19:25:56 -07:00
swift_jenkins
341070e163 Merge remote-tracking branch 'origin/master' into master-next 2020-06-10 14:58:36 -07:00
Nathan Hawes
41758c047c Merge pull request #32148 from nathawes/doc-info-underscored-protocol-synthesised-extensions
[IDE][SourceKit/DocSupport] Add members of underscored protocol extensions in extensions of conforming types.
2020-06-10 14:49:18 -07:00
Robert Widmann
fc9070c072 Strip TypeLoc from IsPattern 2020-06-10 13:29:39 -07:00
Karoy Lorentey
57ea964f2c Merge commit '3eb82c183662945687f48e11c09828f551b34858' into master-next
# Conflicts:
#	include/swift/Frontend/FrontendInputsAndOutputs.h
2020-06-08 16:58:37 -07:00
Karoy Lorentey
68351d2110 Revert "Merge remote-tracking branch 'origin/master-next'"
This reverts commit 1c9b0908e6, reversing
changes made to 3eb82c1836.
2020-06-08 16:48:38 -07:00
Karoy Lorentey
1c9b0908e6 Merge remote-tracking branch 'origin/master-next'
# Conflicts:
#	include/swift/Frontend/FrontendInputsAndOutputs.h
2020-06-08 16:43:40 -07:00
AG
aef3464e73 Merge pull request #32187 from bitjammer/acgarland/rdar-63338507-show-non-underscored-attrs
[SymbolGraph] Print non-underscored attributes in declarations
2020-06-05 18:11:36 -07:00
Dan Zheng
d3b6b89de6 [AutoDiff] Support multiple differentiability result indices in SIL. (#32206)
`DifferentiableFunctionInst` now stores result indices.
`SILAutoDiffIndices` now stores result indices instead of a source index.

`@differentiable` SIL function types may now have multiple differentiability
result indices and `@noDerivative` resutls.

`@differentiable` AST function types do not have `@noDerivative` results (yet),
so this functionality is not exposed to users.

Resolves TF-689 and TF-1256.

Infrastructural support for TF-983: supporting differentiation of `apply`
instructions with multiple active semantic results.
2020-06-05 16:25:17 -07:00
Ashley Garland
dd7a7f7c89 [SymbolGraph] Print non-underscored attributes in declarations
rdar://63338507
2020-06-05 13:36:22 -07:00
Alexis Laferrière
ead9bc3ce3 [ModuleInterface] Don't print SPI attributes on unsupported decls
When emitting the private swiftinterface, the compiler prints the
attribute explicitly even when it is deduced from the context. This can
lead to unparsable private swiftinterface files.

As a narrow fix, check if the decl type is supported before printing the
attribute.

rdar://64039069
2020-06-05 12:25:43 -07:00
Ashley Garland
a72231128e [SymbolGraph] Don't print inherited list in declaration fragments
Add a new `PrintInherited` flag to `PrintOptions` to support this.

rdar://63033669
2020-06-04 11:52:51 -07:00
Nathan Hawes
51bace649b [IDE][SourceKit/DocSupport] Add members of underscored protocol extensions in extensions of conforming types.
We would previously hide the protocol, its extensions and members, but the '_'
prefix really just means the protocol itself isn't intended for clients, rather
than its members.

This also adds support for 'fully_annotated_decl' entries in doc-info for
extensions to be consistent with every other decl, and removes the
'fully_annotated_generic_signature' entry we supplied as a fallback.

Also fixes several bugs with the synthesized extensions mechanism:
- The type sustitutions applied to the extension's requirements were computed
  using the extension itself as the decl context rather than the extension's
  nominal. The meant the extension's requirements themselves were assumed to
  hold when determining the substitutions, so equality constraints were always
  met. Because of this extension members were incorrectly merged with the base
  nominal or its extensions despite having additional constraints.
- Types within the requirements weren't being transformed when printed (e.g.
  'Self.Element' was printed rather than 'T') both in the interface output and
  in the requirements list. We were also incorrectly printing requirements
  that were already satisfied once the base type was subsituted in.
- If both the protocol extension and 'enabling' extension of the base nominal
  that added the protocol conformance had conditional requirements, we were
  only printing the protocol extension's requirements in the synthesized
  extension.
- The USR and annotated decl output embedded in the 'key.doc.full_as_xml'
  string for synthesized members were printed to match their original context, rather than
  the synthesized one.

Resolves rdar://problem/57121937
2020-06-02 15:38:34 -07:00
Anthony Latsis
267e32dcd8 Merge pull request #32118 from AnthonyLatsis/post-increment-cleanup
[NFC] Pre- increment and decrement where possible
2020-06-02 20:10:29 +03:00
adrian-prantl
09a5c7d148 Merge pull request #32099 from adrian-prantl/astprinter-qualify-imported
ASTPrinter: Add an option to qualify ClangImported types.
2020-06-02 09:53:51 -07:00
Anthony Latsis
9fd1aa5d59 [NFC] Pre- increment and decrement where possible 2020-06-01 15:39:29 +03:00
Adrian Prantl
2cb2760ed9 ASTPrinter: Add an option to qualify ClangImported types.
This part of a series of patches to bring ASTPrinter and Swift Demangler to
feature parity, which is needed by LLDB, which depends on using the strings
produced by either interchangibly.

rdar://problem/63700540
2020-05-29 19:04:22 -07:00
swift_jenkins
e9646cfcc2 Merge remote-tracking branch 'origin/master' into master-next 2020-05-28 14:18:42 -07:00
Nathan Hawes
79247b22e2 [SourceKit][InterfaceGen] Don't print clang decls marked with the swift_private attribute.
This attribute is intended to mean there's a replacement declaration that
should be used instead in Swift code. We already filter out decls with this
attribute in code completion, but were still exposing them in generated
interfaces.

Resolves rdar://problem/62464954
2020-05-27 15:23:50 -07:00
Anthony Latsis
dfbbd727bf [NFC] AST: Rename TypeAliasType::getInnermostGenericArgs to getDirectGenericArgs 2020-05-15 14:07:40 +03:00
swift_jenkins
58b8fa77aa Merge remote-tracking branch 'origin/master' into master-next 2020-05-13 18:18:22 -07:00
Robert Widmann
ea2084e097 Remove an Unnecessary Workaround
Now that the parser no longer constructs invalid TypeReprs for if-lets,
printing the annotation here will always reflect what the user actually
wrote.

rdar://62894516
2020-05-13 12:34:24 -07:00
swift_jenkins
0cf8f30cd4 Merge remote-tracking branch 'origin/master' into master-next 2020-05-12 20:58:50 -07:00
Argyrios Kyrtzidis
b4baf420b4 [ASTPrinter] Fix issue where printing if-let variables shows their type as optional
Fixes
https://bugs.swift.org/browse/SR-12631
rdar://62894516
2020-05-12 16:39:09 -07:00
swift_jenkins
f6a6621414 Merge remote-tracking branch 'origin/master' into master-next 2020-04-28 20:39:18 -07:00
Nathan Hawes
a9aba54b42 [ASTPrinter][SourceKit] Print 'Any' as a keyword.
It's treated as a keyword by syntactic highlighting, but wasn't annotated as a
keyword by code completion, cursor info, or doc info.

Resolves rdar://problem/61114942
2020-04-28 13:35:06 -07:00
swift_jenkins
2cfbe58545 Merge remote-tracking branch 'origin/master' into master-next 2020-04-24 22:38:14 -07:00
Ashley Garland
d4e5c6f438 [SymbolGraph] Add navigator declaration fragments
Only print the type name for a type's navigator fragments.

Don't print where clauses for navigator or subHeading fragments.

rdar://62353465
2020-04-24 20:20:19 -07:00
swift_jenkins
71686f9984 Merge remote-tracking branch 'origin/master' into master-next 2020-04-24 12:58:09 -07:00
Anthony Latsis
74252028ca AST: Rename getFullName -> getName on ValueDecl & MissingMemberDecl 2020-04-23 05:16:55 +03:00
swift_jenkins
88d5c0a16e Merge remote-tracking branch 'origin/master' into master-next 2020-04-17 07:19:05 -07:00