Commit Graph

58361 Commits

Author SHA1 Message Date
Pavel Yaskevich
103630296d [Diagnostics] Add a getLoc method to FailureDiagnostic 2020-04-14 11:30:11 -07:00
Holly Borla
66e85721cb Merge pull request #30807 from hborla/property-wrapper-refactoring
[Property Wrappers] Refactor property wrappers so the synthesized backing init is only type checked once
2020-04-14 10:48:22 -07:00
AG
f9610de25b Merge pull request #31000 from bitjammer/acgarland/rdar-61178480-indirect-default-impls
[SymbolGraph] Look at inherited protocols for default implementations
2020-04-14 09:18:15 -07:00
Erik Eckstein
f1b4101295 MergeFunctions: use new LLVM API to create a call.
rdar://problem/61734317
2020-04-14 12:28:51 +02:00
Doug Gregor
674490aba5 Merge pull request #30944 from DougGregor/import-module-for-empty-extensions
Revert "[PrintAsObjC] Don't include the module for empty extensions"
2020-04-13 21:14:08 -07:00
Holly Borla
48b6bcd869 Merge pull request #31002 from hborla/property-wrapper-contextual-type
[Property Wrappers] Use the outermost wrapper attribute type as the contextual type for property wrapper initialization
2020-04-13 20:38:43 -07:00
swift-ci
c4b6f8912a Merge pull request #31003 from zoecarver/sil-parser/move-lib 2020-04-13 20:14:17 -07:00
Holly Borla
df7735e545 [Property Wrappers] Use the outermost wrapper attribute type as the
contextual type for property wrapper initialization
2020-04-13 18:17:40 -07:00
zoecarver
6f339f800d [SIL] [Parser] Move ParserSIL into SIL library.
Move the source files from ParserSIL into the SIL library and remove the
ParserSIL library. ParsersSIL doesn't need to be its own library and this change will
simplify our builds.
2020-04-13 17:23:08 -07:00
Rintaro Ishizaki
5d6298ad05 Merge pull request #30996 from rintaro/ide-completion-performcachedoperaiton
[CodeCompletion][NFC] Fix typo
2020-04-13 16:20:09 -07:00
AG
21eb60fc3c Merge pull request #30998 from bitjammer/acgarland/rdar-60963924-ignore-some-self-reqs
[SymbolGraph] Ignore some Self requirements
2020-04-13 15:48:27 -07:00
Ashley Garland
72dbdb097d [SymbolGraph] Look at inherited protocols for default implementations
rdar://61178480
2020-04-13 15:47:46 -07:00
swift-ci
9a0efcac2a Merge pull request #30548 from AnthonyLatsis/sr-7855 2020-04-13 13:20:27 -07:00
Ashley Garland
06d1d502a1 [SymbolGraph] Ignore some Self requirements
To ease the burden on the client, ignore some generic requirements involving
Self. For example, `Self: P` where we already know that `Self` conforms to `P`.

An example case:

```
public struct S: Equatable {
  public static func ==(lhs: S, rhs: S) -> Bool { ... }
}
```

`!=` is defined in terms of `Self` and the default implementation has a `Self:
Equatable`. For the purposes of documentation, it's not necessary to specify
that again on the page of documentation for `!=`.

rdar://60963924
2020-04-13 13:17:33 -07:00
Nathan Hawes
6f50aa4957 Merge pull request #30891 from nathawes/indent-enum-case-decl
[SourceKit/CodeFormat] Column-align enum element decls and the items in their parameter lists.
2020-04-13 12:08:05 -07:00
Rintaro Ishizaki
2bf9dde17b [CodeCompletion][NFC] Fix typo 2020-04-13 11:55:34 -07:00
Nathan Hawes
b3b7aa8ecf Merge pull request #30964 from nathawes/syntactic-rename-for-callAsFunction
[IDE][Refactoring] Handle 'callAsFunction' specially in syntactic rename
2020-04-13 11:36:53 -07:00
Nathan Hawes
e03e130f6a Merge pull request #30989 from CodaFi/of-no-avail
[Index][SR-9567] Allow unavailable decls to be walked
2020-04-13 11:26:54 -07:00
Bruno Rocha
160eb6cfd8 Update index test response to cover unavailable calls 2020-04-12 19:18:47 -07:00
Slava Pestov
ab45d517d5 Merge pull request #29931 from theblixguy/fix/SR-12178
[Typechecker] Fix _modify for wrapped properties with observers
2020-04-12 22:11:10 -04:00
Nathan Hawes
bce68fa4e5 [IDE][Refactoring] Handle 'callAsFunction' specially in syntactic rename.
This change makes us treat it exactly as we do 'init'. We don't allow renaming the base name,
and don't fail if the basename doesn't match for calls.

Also:
  - explicit init calls/references like `MyType.init(42)` are now reported with
    'init' as a keywordBase range, rather than nothing.
  - cursor info no longer reports rename as available on init/callAsFunction
    calls without arguments, as there's nothing to rename in that case.
  - Improved detection of when a referenced function is a call (rather than
    reference) across syntactic rename, cursor-info, and indexing.

Resolves rdar://problem/60340429
2020-04-12 17:14:15 -07:00
Dave Abrahams
e583f3a8c3 Add -sil-cross-module-serialize-all option. (#30816)
Thanks, Michael!
2020-04-11 19:35:41 -07:00
Owen Voorhees
cdd06d36de Merge pull request #30973 from enferex/explicit-stringref-to-string
[DiagnosticVerifier] Explicitly convert a StringRef into a std::string.
2020-04-11 17:56:33 -05:00
David Ungar
4c4bf088dc Merge pull request #30968 from davidungar/rdar-61461187-tolerate-nonempty-brace-in-brace
[ASTScope lookup] Tolerate non-empty braces in braces
2020-04-11 10:12:03 -07:00
Matt Davis
feb03ebcd7 [DiagnosticVerifier] Explicit convert a StringRef into a std::string.
The newer llvm StringRef library has removed the implicit StringRef to
std::string conversion.  (See: llvm/llvm-project@adcd026)

This patch also uses a StringRef to compare another StringRef
eliminating the need to perform a StringRef to std::string conversion.
I am concerned that StringRef's are being stored in
ExpectedEducationalNotes, but as long as the StringRef does not out live
the definition this is totally cool then.
2020-04-11 09:29:58 -07:00
Slava Pestov
1af01edbf0 Merge pull request #30965 from slavapestov/enable-dynamic-replacement-vs-library-evolution
Enable dynamic replacement with library evolution
2020-04-11 01:39:09 -04:00
eeckstein
628bf7beae Merge pull request #30957 from eeckstein/fix-large-string-arrays
Several compile time fixes related to large string arrays.
2020-04-11 06:55:00 +02:00
Slava Pestov
365f0c7af5 Merge pull request #30861 from slavapestov/outdated-fixme
IRGen: Type reconstruction supports opaque result types now
2020-04-10 23:32:43 -04:00
swift-ci
d02c1400a9 Merge pull request #30899 from nathawes/improve-enum-case-trailing-comma-recovery 2020-04-10 20:30:42 -07:00
Slava Pestov
23cac673ca IRGen: Enable dynamic replacement with library evolution
It looks like the only thing that fails is the linkage computation
for the dynamic replacement key of class methods. Even though
methods have hidden linkage to prevent them from being directly
referenced from outside a resilient module, we need to ensure
the dynamic replacement key is visible.

Fixes <rdar://problem/58457716>.
2020-04-10 22:53:36 -04:00
Rintaro Ishizaki
14fbb8286b Merge pull request #29854 from rintaro/ide-completion-keypathfunc-paramty
[CodeCompletion] Use AnyFunctionType::Param::getParameterType()
2020-04-10 19:26:15 -07:00
Nathan Hawes
13d5a8addb Merge pull request #30870 from nathawes/mutiple-catch-pattern-indentation
[SourceKit/CodeFormat] Column-align multiple patterns in catch clauses
2020-04-10 19:07:44 -07:00
Xi Ge
bae31467a3 Merge pull request #30962 from nkcsgexi/44777994
AST: making `export: true` in @_specialized attribute a no-operation
2020-04-10 18:39:22 -07:00
Nathan Hawes
8edeab75ce [Parse] Don't drop the EnumCaseDecl when it has a trailing comma.
This meant we weren't producing sema diagnostics for the case, and it didn’t
get full syntactic/semantic highlighting or indentation.

enum CasesWithMissingElement {
  case a(Int, String),
  case b(Int, String),
}

Resolves rdar://problem/61476844
2020-04-10 18:22:33 -07:00
David Ungar
5d5776b64d Tolerate non-empty braces in braces 2020-04-10 18:15:12 -07:00
Xi Ge
435d13496e AST: making export: true in @_specialized attribute a no-operation
The client code doesn't actually call into these specialized functions even
though they have public linkage. This could lead to TBD verification failure
shown in rdar://44777994.

This patch also warns users' codebase when `export: true` is specified.
2020-04-10 16:52:22 -07:00
Rintaro Ishizaki
315f65f962 [CodeCompletion] Use AnyFunctionType::Param::getParameterType()
instead of getOldType() in KeyPath as funtions completion.
Also, don't think keypath's are convertible to functions that receives
variadic parameters.
2020-04-10 15:55:32 -07:00
Bruno Rocha
ca74aca6d3 Allow unavailable decls to be walked 2020-04-10 15:34:41 -07:00
fredriss
503da8fa23 Merge pull request #30953 from adrian-prantl/deconstify-master
Convert a clang::Module to non-const to account for a clang API change
2020-04-10 15:16:06 -07:00
Artem Chikin
e3ce6f7b7e Merge pull request #30939 from artemcm/ImplOnlyPropertyWrappers
[Sema] Diagnose use of implementation-only property wrappers
2020-04-10 15:12:41 -07:00
Suyash Srijan
2fbd89dce5 [Typechecker] Simplify StorageImplInfo code in finishPropertyWrapperImplInfo and check for AccessorKind in synthesizeCoroutineAccessorBody 2020-04-10 21:31:23 +01:00
Rintaro Ishizaki
579e662362 Merge pull request #30954 from rintaro/ide-completion-prettystacktrace
[CodeCompletion] Add pretty stacktrace for completion operation
2020-04-10 13:14:54 -07:00
Hamish Knight
a61223a255 [CS] Visit all fixed bindings for constraint re-activation (#30886)
[CS] Visit all fixed bindings for constraint re-activation
2020-04-10 12:27:47 -07:00
Dan Zheng
486e667904 [AutoDiff] Support direct init reference differentiation. (#30946)
Support `@differentiable` function conversion for `init` references, in
addition to `func` references and literal closures. Minor usability improvement.

Resolves SR-12562.
2020-04-10 12:23:19 -07:00
Slava Pestov
cabb657caa Merge pull request #30937 from slavapestov/fix-property-wrapper-vtable-layout-with-subclass
Sema: Force property wrappers in EmittedMembersRequest::evaluate()
2020-04-10 15:15:23 -04:00
Slava Pestov
0724c47a8b IRGen: Fix simple_display(IRGenDescriptor) 2020-04-10 15:05:54 -04:00
Slava Pestov
f12b0d4977 IRGen: Type reconstruction supports opaque result types now 2020-04-10 15:05:54 -04:00
Slava Pestov
43ee8ae282 Serialization: Implement LocalDeclTableInfo::GetExternalKey()
This allows iterating over serialized decl tables, which is useful
for debugging.
2020-04-10 15:05:54 -04:00
Slava Pestov
41ccedc999 AST: Fix opaque type mangling used by type reconstruction
Make sure we mangle opaque types using the same settings as the
debugger mangling (with OptimizeProtocolNames = false) to ensure
that we can reconstruct those names again.
2020-04-10 15:05:54 -04:00
Slava Pestov
2b93b5b5e5 Sema: Force property wrappers in EmittedMembersRequest::evaluate()
Fixes <rdar://problem/61229365>.
2020-04-10 15:05:54 -04:00