Commit Graph

7436 Commits

Author SHA1 Message Date
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
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
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
Slava Pestov
422000a2f2 Sema: Remove isProtocolExtensionUsable()
It doesn't do anything that isExtensionApplied() doesn't do.
2017-12-12 21:12:46 -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
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
4a28744244 [AST] NFC: Assert that params are not dropped 2017-12-12 18:07:42 -05:00
David Zarzycki
b301d74b26 [AST] NFC: Repack misc AnyFunctionType bits 2017-12-12 17:50:10 -05:00
Slava Pestov
1f1fa3b91d AST: Remove NominalTypeDecl::hasDelayedMembers() 2017-12-12 14:01:55 -08:00
Slava Pestov
042d9e9a10 Sema: Nuke resolveExternalDeclImplicitMembers() 2017-12-12 14:01:55 -08:00
David Zarzycki
3af569cad2 [AST] NFC: Use llvm::TrailingObjects for ProtocolCompositionType member types
Also, fix a copy that should have been removed from the previous commit.
2017-12-12 16:29:30 -05:00
David Zarzycki
aa4d53e3dd [AST] NFC: Use llvm::TrailingObjects for BoundGenericType generic args 2017-12-12 15:47:07 -05:00
Rintaro Ishizaki
71f1040da7 [AST] Remove unused 'InOutLoc' field from 'TupleTypeReprElement' 2017-12-12 18:36:57 +09:00
David Ungar
c1f81867d7 Merge pull request #13268 from davidungar/PR3A-rb
FrontendInputs data structure redo, rebased.
2017-12-11 20:44:10 -08:00
Doug Gregor
beed602bdc [NFC] Fix new file headers 2017-12-11 17:03:07 -08:00
Doug Gregor
82dde17ef4 [Conformance checking] More refactoring of associated type inference.
Move the rest of associated type inference into the new source file,
and split RequirementEnvironment into its own AST-level header, because it
can be re-used and has no ties to the type checker.
2017-12-11 16:34:49 -08:00
David Zarzycki
58d1a57cf3 [AST] NFC: Repack misc SILBoxType bits 2017-12-11 12:34:38 -05:00
David Zarzycki
d6ea606535 [AST] NFC: Repack misc SILParameterInfo bits 2017-12-11 12:34:38 -05:00
David Zarzycki
f45b16574d [AST] NFC: Use llvm::TrailingObjects for TupleType elements 2017-12-11 10:31:16 -05:00
David Zarzycki
780f41b402 [AST] NFC: Repack misc TypeVariableType bits
1) This saves 16 bytes per type variable.
2) Please note that the 'ID' was "32 - NumTypeBaseBits" just a few weeks
   ago, so this isn't a real change.
2017-12-11 00:01:57 -05:00
David Zarzycki
c3ae67521f [AST] NFC: Repack misc ParenType bits 2017-12-10 23:03:42 -05:00
David Zarzycki
4d56dfcc31 [AST] NFC: Repack misc EnumCaseDecl bits 2017-12-10 20:38:02 -05:00
David Zarzycki
7bede89a9b [AST] NFC: Repack misc IterableDeclContext bits 2017-12-10 20:38:01 -05:00
David Zarzycki
045d996127 [AST] NFC: Repack misc ClassDecl bits 2017-12-10 20:38:01 -05:00
David Zarzycki
f3a8023059 [AST] NFC: Repack misc ProtocolDecl bits 2017-12-10 20:38:01 -05:00
David Zarzycki
67f30ac3ea [AST] NFC: Repack misc GenericTypeParamDecl bits 2017-12-10 20:38:01 -05:00
David Zarzycki
82e08ed3b7 [AST] NFC: Repack misc AbstractFunctionDecl bits 2017-12-10 20:38:01 -05:00
David Zarzycki
dd617aafa5 [AST] NFC: Repack misc ImportDecl bits 2017-12-10 20:38:01 -05:00
Xiaodi Wu
30d5e344b1 Rename the combine hashes function and use a common implementation 2017-12-10 02:13:25 -06:00
swift-ci
2514f7061f Merge pull request #13330 from DougGregor/where-clause-ref-typealias-in-protocol 2017-12-07 15:38:53 -08:00
Doug Gregor
879b1802f0 [GSB] Downgrade "neither type in same-type has a generic param" error to warning.
There is nothing specifically wrong with uttering a same-type
constraint in a where clause where both sides are concrete
types. Downgrade this to a warning; we'll check that the concrete
types match (of course), and such a well-formed constraint will simply
be canonicalized away.

This aids the migration of IndexDistance from an associated type to
Int.
2017-12-07 14:44:35 -08:00
Mark Lacey
7ffb1a4691 Merge pull request #13302 from rudkx/iuo-attr-on-param-decl
IUO: Add the IUO attr to function parameters declared with '!'
2017-12-06 19:58:19 -08:00
Mark Lacey
c23dd4435e IUO: Add the IUO attr to function parameters declared with '!' 2017-12-06 16:55:09 -08:00
Jordan Rose
7c707ce97c For 'lazy', make "cannot override with a stored property" a warning (#13304)
Previous versions of Swift accidentally treated lazy properties as
computed properties because of how they were implemented. Now that we
check this correctly, we've broken source compatibility. Downgrade the
error to a warning in this case.

(Arguably we could /allow/ overriding with a stored property. The
original concerns were that you could accidentally end up with extra
storage you didn't need, and that observing accessors would behave
differently based on whether or not the property was overriding. But
there's at least no ambiguity for 'lazy', which can't have observing
accessors today.)

rdar://problem/35870371
2017-12-06 13:41:07 -08:00
David Ungar
28b206008f FrontendInputs data structure redo.
- Outlaw duplicate input files, fix driver, fix tests, and add test.
- Reflect that no buffer is present without a (possibly pseudo) named file.
- Reflect fact that every input has a (possible pseudo) name.
- Break up CompilerInstance::setup.

Don't bail on dups.
2017-12-05 17:28:03 -08:00
David Zarzycki
8de981d2a9 [NFC] AST: Pack ParamDecl bits into intrusive bitfield 2017-12-05 16:41:58 -05:00
David Zarzycki
91f9f9d741 [AST] NFC: Pack FuncDecl bits into intrusive bitfield 2017-12-05 16:12:37 -05:00
David Zarzycki
9b9d1733d4 [AST] NFC: Pack Ctor bits into intrusive bitfield 2017-12-05 16:12:37 -05:00
David Zarzycki
392e33637a [AST] NFC: Make Decl bitfield be 64 bit 2017-12-05 16:12:37 -05:00
David Zarzycki
56febcb62a [AST] NFC: Fix bitfield compiler warning 2017-12-05 13:11:52 -05:00
David Zarzycki
fb7e0e682f Merge pull request #13205 from davezarzycki/nfc_typebase_layout_optimization
[AST] NFC: Shrink TypeKind size and optimize TypeBase layout
2017-12-05 08:27:42 -05:00
Mark Lacey
73a492dc4f For Swift 3/4 mode, do not treat IUOs in illegal positions as Optionals.
Instead, just emit a deprecation warning and suggest switching to Optionals.

The old behavior caused several projects to break, so before we change
the behavior here we need to investigate whether we can mitigate most
of those breaks.
2017-12-04 16:15:13 -08:00
Graydon Hoare
c6ce01280d [NamedLazyMemberLoading] Handle partial population from extensions better. 2017-12-02 02:19:29 -08:00
Graydon Hoare
7a9bc26fd9 [NamedLazyMemberLoading] Handle nominals with mix of added/lazy members. 2017-12-01 16:52:26 -08:00
Graydon Hoare
464dc1bcc1 [NamedLazyMemberLoading] Use per-IDC recursion-breaking flag, not sentinel.
The empty sentinel in the lookup table caused recursion-breaking to bottom
out in slightly different order than the old eager code, making certain
order-sensitive tests fail.
2017-12-01 16:52:25 -08:00
David Zarzycki
e8b50add46 [AST] NFC: Shrink TypeKind size and optimize TypeBase layout
1) TypeKind only needs six bits at the moment, so this leaves us with
   plenty of room for additional type kinds.
2) While the size of TypeBase does not change, there are many more bits
   available for subtypes to use.
2017-12-01 12:31:36 -05:00