Commit Graph

32761 Commits

Author SHA1 Message Date
Rintaro Ishizaki
c0014838ca [CodeCompletion] Added test case for polymorphic type keywords 2019-05-21 17:25:53 -07:00
Rintaro Ishizaki
e2a4621b14 [CodeCompletion] Suggest #selector and #keyPath after # only if applicable
Also, add type annotation, and make it `TypeRelation[Identical]`.
'ExprSpecific' is too strong.
2019-05-21 17:25:53 -07:00
Rintaro Ishizaki
83084e2b5f [CodeCompletion] Suggest 'file', 'line', et al. after #
rdar://problem/47169238
2019-05-21 17:24:59 -07:00
Pavel Yaskevich
fc0ab61888 Merge pull request #24937 from xedin/rdar-50909555
[Diagnostics] Add known member declaration to `invalid member ref` di…
2019-05-21 16:34:38 -07:00
Doug Gregor
af7b461db2 Merge pull request #24959 from DougGregor/non-objc-dynamic-everywhere
Allow non-@objc ‘dynamic’ in all language modes.
2019-05-21 15:05:52 -07:00
Doug Gregor
19cc42bdee Merge pull request #24913 from DougGregor/property-delegates-generic-delegate-value-crash
[Property delegates] Fix crash involving generic uses of delegateValue.
2019-05-21 14:57:30 -07:00
Slava Pestov
6363961e90 Split up a couple more tests into stable and pre-stable ABI deployment target versions 2019-05-21 17:30:13 -04:00
Joe Groff
81c7f84ec9 IRGen: Work around JIT bug with GOT equivalents.
SR-10590 | rdar://problem/50968433 appears to be caused by an LLVM JIT bug where GOT-equivalent
globals get emitted with incorrect alignment. Not marking the GOT equivalent as unnamed_addr
(which prevents it from getting folded into the GOT, or other equivalent constants) appears
to work around the issue.
2019-05-21 14:17:07 -07:00
Doug Gregor
22c0995046 Allow non-@objc ‘dynamic’ in all language modes.
Non-‘@objc’ ‘dynamic’ has been allowed since Swift 5, but there’s no
reason to tie it to the language mode (Swift >= 5).

Fixes rdar://problem/50348013.
2019-05-21 13:40:04 -07:00
Michael Gottesman
17213f79f1 Merge pull request #24955 from gottesmm/pr-e299d5c0fc06f6cf982d906b63ebe334df110585
[ownership] Convert SILOptimizer/cast_folding_objc_generics.swift to …
2019-05-21 12:22:37 -07:00
Michael Gottesman
3a3e409e7a Merge pull request #24952 from gottesmm/pr-6da93287e2d5c030e12989e4f935266c72a63b91
[test] Make sure to ship over the dylib over for the switch_resilienc…
2019-05-21 12:04:44 -07:00
swift-ci
a96890c7ae Merge pull request #24929 from eeckstein/optimize-keypath 2019-05-21 11:20:29 -07:00
swift-ci
b170ad72a8 Merge pull request #24953 from gottesmm/pr-71990c28f613fe44d9bf454eeb0b89a4356c8f91 2019-05-21 10:40:51 -07:00
Erik Eckstein
da38e3ac81 SILCombine: optimize keypath instructions.
If the keypath argument of a keypath access function is a keypath literal instruction, generate the projection inline and remove the access function.
For example, replaces (simplified SIL):
   %kp = keypath ... stored_property #Foo.bar
   apply %keypath_runtime_function(%root_object, %kp, %addr)
with:
   %addr = struct_element_addr %root_object, #Foo.bar
   load/store %addr

Currently this only handles stored property patterns.

rdar://problem/36244734
2019-05-21 09:44:59 -07:00
Bob Wilson
2e12ac8d74 Merge pull request #24836 from bob-wilson/rdar50173830
[Test] Conditionalize KVOKeyPaths tests that only work with Swift 5.1
2019-05-21 09:38:24 -07:00
Michael Gottesman
b48bcd9085 [ownership] Convert SILOptimizer/cast_folding_objc_generics.swift to work with ownership serializing after serialization at -Onone.
I added an extra run with the relevant flag enabled for this purpose.
2019-05-21 09:24:37 -07:00
Michael Gottesman
748bf88bbe [ownership] Convert SILOptimizer/cast_folding.swift to work with ownership and fix all issues exposed. 2019-05-21 09:07:13 -07:00
Michael Gottesman
25c4183dbf [test] Make sure to ship over the dylib over for the switch_resilience test. 2019-05-21 08:35:55 -07:00
David Goldman
1c819820fa Comment and sourcekitd-test fixes 2019-05-21 10:40:22 -04:00
Mike Ash
6746911dde [Test] Add availability to the GenericMangled test in objc_getClass.swift
This is a new test in Swift 5.1 that is not expected to pass when running
with the Swift 5.0 runtime library.

rdar://problem/50175915
2019-05-21 10:26:02 -04:00
Arnold Schwaighofer
528fe42bfb Merge pull request #24923 from aschwaighofer/dynamically_replaceable_closure_fixes
Fix capture promotion and closure scope analysis' handling of dynamically_replaceable functions
2019-05-21 05:56:41 -07:00
Andrew Trick
6e3f56fa92 Fix exclusivity diagnostics to be aware of [dynamically_replaceable].
Previously, any function marked [dynamically_replaceable] that was
partially applied and captured by address would not be diagnosed.

This is a rare thing. For example:

struct S {
  var x = 0
  public mutating func testCallDynamic() {
    dynamic func bar(_ i: inout Int) {
      i = 1
      x = 2
    }
    bar(&x)
  }
}

Fixes <rdar://problem/50972786> Fix exclusivity diagnostics to be
aware of [dynamically_replaceable].
2019-05-20 21:46:30 -07:00
Slava Pestov
93293c7e16 Merge pull request #24912 from slavapestov/drop-inherited-clause-entries
Serialization: Recover from failure to deserialize inheritance clause entries
2019-05-20 23:16:11 -04:00
Joe Groff
deea9b1ee2 Merge pull request #24933 from jckarter/keypath-class-access
IRGen: Map type into context before asking for class layout.
2019-05-20 19:58:13 -07:00
Xi Ge
e8588672da Merge pull request #24939 from nkcsgexi/doc-support-issue
Sourcekit/DocSupport: fix an assertion when generating documentation for extensions with attributes
2019-05-20 18:59:53 -07:00
Daniel Rodríguez Troitiño
33573aa05a Merge pull request #24935 from drodriguez/android-mark-executable-mandatory-inlining
[test] Mark mandatory_inlining.swift as executable.
2019-05-20 18:33:28 -07:00
Daniel Rodríguez Troitiño
84565dd999 Merge pull request #24931 from drodriguez/windows-source-locs
[win] Fix path separators for Windows.
2019-05-20 18:02:07 -07:00
Xi Ge
1ca8e83aa3 Sourcekit/DocSupport: fix an assertion when generating documentation for extensions with attributes
When sanitizing the documentation comments for synthesized extensions,
we expect some text like "<declaration>extension". This isn't the case
when use-facing attributes are present.

rdar://50913510
2019-05-20 17:43:29 -07:00
Pavel Yaskevich
48688241c3 [Diagnostics] Add known member declaration to invalid member ref diagnostic
This is useful for `CSDiag` when it detects that all
overload choices have the same problem. Since there
are going to be no solutions, choice declaration could
be supplied to `invalid ref` diagnostic directly.

Resolves: rdar://problem/50467583
Resolves: rdar://problem/50682022
Resolves: rdar://problem/50909555
2019-05-20 17:29:15 -07:00
Daniel Rodríguez Troitiño
9d22cbb13e [test] Mark mandatory_inlining.swift as executable.
Otherwise the Android CI will fail this test, since no device is
actually attached.
2019-05-20 17:10:55 -07:00
Pavel Yaskevich
7511e0a4d0 Merge pull request #24926 from xedin/rdar-50668864
[CSDiag] Adjust assert to account for changes in `filterContextualMem…
2019-05-20 16:30:59 -07:00
Pavel Yaskevich
464761e770 Merge pull request #24924 from xedin/rdar-50679161
[Diagnostics] Fix incorrect metatype check which leads to crashes
2019-05-20 16:30:12 -07:00
Joe Groff
b896361d88 IRGen: Map type into context before asking for class layout.
Asking for the layout of the interface type apparently gives the wrong answer,
causing key paths to access stored properties of generic classes using the wrong
strategy.

Fixes SR-10167 | rdar://problem/49230751.
2019-05-20 16:08:38 -07:00
Michael Gottesman
ef1ad0613c Merge pull request #24102 from gottesmm/pr-cdde379c40f94a6fd49361a2b347388665705682
[constant-prop] When replacing uses of destructure_tuple, only RAUW i…
2019-05-20 15:15:20 -07:00
Daniel Rodríguez Troitiño
d6c3d922d3 [win] Fix path separators for Windows. 2019-05-20 15:00:54 -07:00
Michael Gottesman
1db75d6430 Merge pull request #24920 from gottesmm/pr-1ce3bba234b68150bc0675d364f95465bb26344d
[mandatory-inlining] When using the linear lifetime checker to insert…
2019-05-20 14:53:41 -07:00
Slava Pestov
5b2211dde7 Serialization: Recover from failure to deserialize inheritance clause entries
... by dropping them.

Fixes <rdar://problem/50473619>.
2019-05-20 17:38:30 -04:00
Pavel Yaskevich
31d001cc67 [CSDiag] Adjust assert to account for changes in filterContextualMemberList.
Originally `filterContextualMemberList` would only return a limited
set of closeness kinds `CC_GeneralMismatch`, `CC_Argument{Label, Count}Mismatch`,
and unavailable/inaccessible. At some point later it also started
matching almost everything besides `CC_SelfMismatch` and logic in
`visitUnresolvedMemberExpr` needs to get adjusted to account for that.

Resolves: rdar://problem/50668864
2019-05-20 13:39:39 -07:00
marcrasi
ad79bbaf86 Merge pull request #22591 from apple/marcrasi-repl-code-completion-diags
handle diags that happen during repl code completion
2019-05-20 13:28:24 -07:00
Arnold Schwaighofer
6c0baaee85 Fix closurescope analysis
rdar://50949761
2019-05-20 13:20:23 -07:00
Arnold Schwaighofer
4912e6aa85 CapturePromotion: Disable for dynamically_replaceable sil functions
rdar://50949761
2019-05-20 13:20:10 -07:00
David Ungar
6cf09fa9bb Merge pull request #24905 from davidungar/interpolated-string-literal-trailing-quote-loc
[NameLookup: ASTScope] Add trailing quote location to interpolated string literal.
2019-05-20 12:57:44 -07:00
Pavel Yaskevich
1499811add [Diagnostics] Fix incorrect metatype check which leads to crashes
Incorrect member reference diagnostic tailed for protocols
should cover existential metatypes as well.

rdar://problem/50679161
2019-05-20 12:52:53 -07:00
Michael Gottesman
3b029010b9 [mandatory-inlining] When using the linear lifetime checker to insert compensating releases, if we find a double use due to a loop, do not insert an apply at that call site.
Otherwise, one will get use after frees. I added an interpreter test as wlel as
an end to end test.

rdar://50884462
2019-05-20 12:12:13 -07:00
Xi Ge
d05a7481a8 Merge pull request #24850 from nkcsgexi/syntax-tree-with-condition
Parser: avoid skipping inactive code if we are building syntax trees.
2019-05-20 12:01:23 -07:00
David Ungar
d37fd2f85d Revised test. 2019-05-20 11:33:53 -07:00
Jordan Rose
7963529da1 Merge pull request #24819 from jrose-apple/when-everyone-is-super-no-one-will-be
[Serialization] Drop a class if the superclass can't be found
2019-05-20 11:30:08 -07:00
Jordan Rose
e0658a3726 Merge pull request #24774 from theblixguy/fix/duplicate-tuple-labels
[Typechecker] Ban tuples with duplicate labels
2019-05-20 11:28:46 -07:00
Marc Rasi
fb268e5234 handle diags that happen during repl code completion 2019-05-20 11:10:44 -07:00
Doug Gregor
d86907e095 [Property delegates] Fix crash involving generic uses of delegateValue.
Fixes rdar://problem/50873275.
2019-05-20 10:15:12 -07:00