Commit Graph

15024 Commits

Author SHA1 Message Date
Robert Widmann
1d6f11ab54 Refactor ArrayExpr visitor for better QoI
Also remove mention of the word “contextual” type from the diagnostic
that rewrites array literals into dictionary literals and scale back
the scope of the diagnostic.  This method was catching and
mis-diagnosing too many errors that could better be handled by invalid
conversion diagnostics.
2017-12-15 18:20:36 -05:00
John McCall
b13f30ff30 Move a convenience API for changing a SILFunctionType into the AST. NFC. 2017-12-15 18:19:07 -05:00
swift-ci
fbcb731ec1 Merge remote-tracking branch 'origin/master' into master-next 2017-12-15 13:49:31 -08:00
Ben Langmuir
93956eb34b [code-complete] Put call-pattern heuristics under a flag
The original hope was we could make these heuristics really good, but
since that is not currently in sight (and may never be), we want to be
able to turn them off.  For now, just plumb through an internal flag to
control the behaviour.  A future change will customize the behaviour in
SourceKit.

rdar://31113161
2017-12-15 13:23:44 -08:00
David Zarzycki
15953e0bde [AST] NFC: Repack misc SwitchStmt bits 2017-12-15 16:08:26 -05:00
David Zarzycki
5e9d73125e [AST] NFC: Repack misc CaseStmt bits 2017-12-15 16:00:38 -05:00
David Zarzycki
6a6242ae7b [AST] NFC: Repack misc DoCatchStmt bits 2017-12-15 15:38:59 -05:00
David Zarzycki
23ee4374ec [AST] NFC: Repack misc BraceStmt bits 2017-12-15 15:17:05 -05:00
David Zarzycki
3bae703aa2 [AST] NFC: Convert Stmt to new inline bitfield logic 2017-12-15 15:04:20 -05:00
David Zarzycki
68a846e761 [AST] NFC: Do not hard code bit size of 'Kind' field
Also, give each class hierarchy at least 8 bits for the 'Kind' field.
In practice, no class hierarchy has more than 256 nodes, so this
optimizees code generation to make isa/dyn_cast faster.
2017-12-15 14:45:38 -05:00
David Zarzycki
97541e0d1e [Basic] NFC: Standardize and simplify inline bitfields
Inline bitfields are a common design pattern in LLVM and derived
projects, but the associated boilerplate can be demotivating and
brittle. This new header makes it easier to define and use inline
bitfields in Swift.

This also reorders some fields for better code generation.
2017-12-15 14:14:59 -05:00
swift-ci
f13573ec63 Merge remote-tracking branch 'origin/master' into master-next 2017-12-14 23:09:32 -08:00
swift-ci
0e52ad45c8 Merge pull request #13454 from DougGregor/sr-6522-deserialize-conformance 2017-12-14 23:03:48 -08:00
swift-ci
5702105cb2 Merge remote-tracking branch 'origin/master' into master-next 2017-12-14 22:10:05 -08:00
Doug Gregor
3042e1f5ed [Serialization] Deserialize type witnesses before value witnesses.
The deserialization of the type witnesses for a normal protocol conformance
is crucial to the usability of said conformance. Deserializing the
value witnesses first can fail if they somehow rely on the type
witnesses (e.g., through a recursive conformance).

As a stop-gap, deserialize and record type witnesses *first*, then
deserialize value witnesses afterward. A longer-term solution would
make deserialization of the normal protocol conformance far more
lazy.

Fixes SR-6522 / rdar://problem/35830641, a merge-modules crasher in a
nontrivial project.
2017-12-14 22:07:23 -08:00
John McCall
dfe119f86e Compute the BuiltinInfo for a builtin call to IRGenSIL; NFC.
The intention here is to make it easier to do specialized lowering
for specific builtin arguments.
2017-12-15 00:21:21 -05:00
swift-ci
25e48f7e28 Merge remote-tracking branch 'origin/master' into master-next 2017-12-14 14:29:35 -08:00
Arnold Schwaighofer
5117241111 Merge pull request #13389 from aschwaighofer/remove_unused_option
Remove unused frontend option
2017-12-14 14:22:54 -08:00
swift-ci
6349dc9aa0 Merge remote-tracking branch 'origin/master' into master-next 2017-12-14 08:29:34 -08:00
Rintaro Ishizaki
79e224c8da [Syntax] Use SyntaxKind APIs for getUnknownKind() (#13429) 2017-12-14 08:11:57 -08:00
swift-ci
c920a92bb1 Merge remote-tracking branch 'origin/master' into master-next 2017-12-14 01:09:50 -08:00
Rintaro Ishizaki
e618ae5a5a Merge pull request #13412 from rintaro/syntax-type-tuple
[Syntax] Parse: add support for TupleType and FunctionType
2017-12-14 17:49:38 +09:00
swift-ci
2f62fadb66 Merge remote-tracking branch 'origin/master' into master-next 2017-12-13 23:09:39 -08:00
Robert Widmann
d2aa82de1f Merge pull request #12818 from CodaFi/cover-model
Stricter enforcement of the "large space" heuristic
2017-12-14 02:01:17 -05:00
Doug Gregor
b3b86d7a25 Merge pull request #13424 from DougGregor/canonicalize-conformance-access-path
[GSB] Canonicalize conformance access paths on-the-fly.
2017-12-13 22:57:02 -08:00
Rintaro Ishizaki
fc5f31c6d9 [Syntax] Decompose TupleType when it turns out to be a part of FunctionType 2017-12-14 14:55:27 +09:00
Doug Gregor
e10ecbd80e [GSB] Only check protocol requirements not generated from the signature.
If we used the requirement signature to create a protocol requirement
element in a requirement source, there's no need to verify that it's
from the requirement signature (duh).
2017-12-13 20:17:18 -08:00
swift-ci
0136c84a59 Merge remote-tracking branch 'origin/master' into master-next 2017-12-13 16:09:36 -08:00
swift-ci
a24121af65 Merge pull request #13417 from DougGregor/override-objc-diag 2017-12-13 16:06:23 -08:00
Doug Gregor
cabdf84179 Suggest @objc for overrides of declarations from/in extensions.
The Swift class model does not support overriding declarations where either
the overridden declaration or the overriding declaration are in an extension.
However, the Objective-C class model does, so marking the declaration as
@objc (when possible) will work around the limitation.

Customize the "cannot override declaration in extension" diagnostic to
suggest adding @objc to the overridden declaration in cases where
@objc is permitted. Fixes SR-6512 / rdar://problem/35787914.
2017-12-13 14:54:32 -08:00
swift-ci
fdf3f4b8d1 Merge remote-tracking branch 'origin/master' into master-next 2017-12-13 14:49:40 -08:00
David Ungar
676c396b7d Merge pull request #13397 from davidungar/PR5-setBuffer-rb2
Eliminate InputFile::setBuffer()
2017-12-13 14:48:26 -08:00
swift-ci
cdb1bd28e7 Merge remote-tracking branch 'origin/master' into master-next 2017-12-13 13:49:37 -08:00
David Ungar
ec5c7ae9a5 Merge pull request #13400 from davidungar/PR6-primaryFileList-rb
Add -primary-filelist option to Frontend.
2017-12-13 13:45:41 -08:00
Robert Widmann
43f06afef2 Defer analysis of large switch bodies
This presents a regression in diagnostic quality that is definitely
worth it not to lie to SILGen about whether a switch is covered or not.

At the same time, disable SIL’s unreachable diagnostic for ‘default’
clauses which would previously cause a warning to be emitted if the
default was proven to be unreachable.  This analysis is incomplete
anyways and can be done by Sema in the future if we desire.
2017-12-13 16:22:48 -05:00
David Zarzycki
528a28ef7e [Sema] NFC: Remove redundant parameter type matching
The for loop above already handled this.
2017-12-13 15:30:28 -05:00
David Ungar
9c78480bdf Enforce exclusivity between -primary-file and -primary-filelist. 2017-12-13 09:45:53 -08:00
David Ungar
c3c9e90865 Add primary file list. 2017-12-13 04:03:37 -08:00
swift-ci
f3afbf8419 Merge remote-tracking branch 'origin/master' into master-next 2017-12-12 23:30:50 -08:00
Slava Pestov
422000a2f2 Sema: Remove isProtocolExtensionUsable()
It doesn't do anything that isExtensionApplied() doesn't do.
2017-12-12 21:12:46 -08:00
swift-ci
b3c06162ae Merge remote-tracking branch 'origin/master' into master-next 2017-12-12 17:49:40 -08:00
Slava Pestov
5836ea4d11 Merge pull request #13385 from slavapestov/remove-unnecessary-external-members-thingy
Remove TypeChecker::forceExternalDeclMembers() and friends
2017-12-12 17:41:31 -08:00
swift-ci
6d1f3c7eca Merge remote-tracking branch 'origin/master' into master-next 2017-12-12 17:29:39 -08:00
Thomas Roughton
f10ef1ab9a [runtime] Always use SwiftCC (#13311) 2017-12-12 17:11:38 -08:00
swift-ci
111d0ee36c Merge remote-tracking branch 'origin/master' into master-next 2017-12-12 16:29:13 -08:00
Rintaro Ishizaki
35248205fc Merge pull request #13387 from rintaro/parse-typetupleelement
[Parse] Slightly refactor TypleTypeRepr element parsing
2017-12-13 09:25:33 +09:00
David Zarzycki
251282a4a9 Merge pull request #13395 from davezarzycki/nfc_repack_AnyFunctionType_bits
[AST] NFC: Repack misc AnyFunctionType bits
2017-12-12 19:22:07 -05:00
swift-ci
9d4974a73f Merge remote-tracking branch 'origin/master' into master-next 2017-12-12 15:09:40 -08:00
David Zarzycki
4a28744244 [AST] NFC: Assert that params are not dropped 2017-12-12 18:07:42 -05:00
David Ungar
c0b0b5c5da Eliminate InputFile::setBuffer by having SwiftASTManager create new InputFile's with the buffer set or not as needed. 2017-12-12 15:06:26 -08:00