Commit Graph

7266 Commits

Author SHA1 Message Date
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
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
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
Arnold Schwaighofer
eba12a7c3e Revert "Finish and default-enable named lazy member loading" 2017-12-01 07:25:54 -08:00
swift-ci
7e6f7e1c04 Merge pull request #12843 from graydon/force-on-named-lazy-member-loading 2017-12-01 02:32:10 -08:00
Graydon Hoare
9e1859469c [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-11-30 22:18:25 -08:00
Rintaro Ishizaki
d28d4073b1 Merge pull request #13173 from rintaro/parse-specifier-typesimple
[Parse] Skip type specifiers in middle of composition types
2017-12-01 12:10:32 +09:00
Jordan Rose
8f8f00012a Merge pull request #12834 from jrose-apple/restrict-cross-module-struct-initializers-2
Implementation of SE-0189 "Restrict cross-module struct initializers to be delegating"

rdar://problem/34777878
2017-11-30 13:32:45 -08:00
Rintaro Ishizaki
e7be78b84d [Parse] Skip type specifiers in middle of composition types
Like `P & inout P2`.
Don't bother to construct wrapped TypeRepr for them.
2017-11-30 15:59:35 +09:00
Harlan Haskins
9732442628 [Syntax] Remove LegacyASTTransformer
As it is no longer ever instantiated, and since Syntax nodes are being
plumbed through the parser, the LegacyASTTransformer no longer needs to
exist.
2017-11-29 17:51:57 -05:00
Slava Pestov
1f2a49bf75 Merge pull request #13133 from slavapestov/who-cares-about-speling
Remove TypeBase::isSpelledLike()
2017-11-28 21:08:23 -08:00
swift-ci
b39c337285 Merge pull request #13129 from gottesmm/pr-a501646b040ec5fb99039cd0689b4468acdd0d23 2017-11-28 21:06:20 -08:00
Slava Pestov
a23d1fa0d7 AST: Remove TypeBase::isSpelledLike() 2017-11-28 20:25:22 -08:00
Michael Gottesman
566f3d1cae [sil] Move determining if two SILFunctionTypes are ABI compatible from the verifier onto SILFunctionType itself.
Right now if convert_function is used incorrectly by SILGen, we get an error via
the SILVerifier after we have finished building the entire function. This is a
pain in the butt to track down. Using this refactor, I am able to just assert in
the SILBuilder itself.

On another note, down the line we should just separate the dataflow checker part
of the verifier from specific SILInstruction verification. This would allow for
SILBuilder to perform the SILInstruction verification upon creation giving the
same effect. Such a change is a much larger change though and this is just a
commit chopped off a larger commit.

rdar://34222540
2017-11-28 20:10:37 -08:00
Ted Kremenek
e04c7fd00a Merge pull request #12964 from graydon/if-target-environment
#if targetEnvironment(simulator)
2017-11-28 19:39:44 -08:00
swift-ci
cdab55a202 Merge pull request #13124 from DougGregor/se-0143-experimental-flag 2017-11-28 16:59:27 -08:00
Doug Gregor
b59c30c1af [SE-0143] Put conditional conformances behind an "experimental" flag.
Conditional conformances aren't quite ready yet for Swift 4.1, so
introduce the flag `-enable-experimental-conditional-conformances` to
enable conditional conformaces, and an error when one declares a
conditional conformance without specifying the flag.

Add this flag when building the standard library (which will vend
conditional conformances) and to all of the tests that need it.

Fixes rdar://problem/35728337.
2017-11-28 16:01:51 -08:00
Graydon Hoare
94988a253e [Parse] Add suggestion to targetEnvironment diagnostic. 2017-11-28 15:55:12 -08:00
Graydon Hoare
d31bad45b8 [Parse] Add fixit for targetEnvironment(simulator) 2017-11-28 13:51:01 -08:00
swift-ci
e482bcb947 Merge pull request #13079 from davezarzycki/nfc_ExtInfo_feedback 2017-11-28 07:12:18 -08:00
David Zarzycki
5cc0d83db0 [AST] NFC: Use NumExtInfoBits instead of the magic value 2017-11-28 08:45:06 -05:00
David Ungar
83ee8cb7f0 Merge pull request #12920 from davidungar/Move-input-conversion
Move input conversion
2017-11-27 17:13:48 -08:00