Commit Graph

60538 Commits

Author SHA1 Message Date
swift-ci
d53f25c56d Merge pull request #12634 from gottesmm/pr-b3f1b87a0325e44b2300443db5fdaa81b8e38e8e 2017-10-26 12:04:13 -07:00
Michael Gottesman
71a8006615 [pred-memopt] Standardize function names in the file.
1/2 of the functions were CamelCase and the other half were camelCase. I
standardized on camelCase.
2017-10-26 11:39:09 -07:00
swift-ci
f54d890dff Merge pull request #12619 from gspiers/add-SE-0186-to-changelog 2017-10-26 10:45:16 -07:00
Graydon Hoare
cc5a356c10 Merge pull request #12625 from graydon/rdar-34913689-dead-function-elim-vs-foreign-declref-keypaths
[DeadFunctionElimination] Pass on keypaths to foreign DeclRef properties
2017-10-26 10:36:00 -07:00
swift-ci
ffd34239a1 Merge pull request #12633 from DougGregor/sr-6100 swift-DEVELOPMENT-SNAPSHOT-2017-10-26-a 2017-10-26 00:25:05 -07:00
Greg Spiers
340c7f20ea Add SE-0186 to changelog. 2017-10-26 08:08:40 +01:00
Graydon Hoare
3ef686bf92 [DeadFunctionElimination] Pass on keypaths to foreign DeclRef properties.
These show up specifically when someone forms a keypath to an ObjC
property in a category. They're no-ops from the perspective of
DFE but the code has to intentionally skip the case if it wants to
avoid the subsequent llvm_unreachable.

rdar://34913689
2017-10-25 23:21:56 -07:00
Doug Gregor
e1e0deca33 Reject unbound generic types in case patterns.
Fixes SR-6100 / rdar://problem/34898452.
2017-10-25 23:19:28 -07:00
Doug Gregor
5c5c9ac183 Merge pull request #12609 from DougGregor/suppress-eager-init-nscoding-availability
Suppress inference of @_staticInitializeObjCMetadata for "newer" classes
2017-10-25 22:03:15 -07:00
swift-ci
bea91f18a3 Merge pull request #12630 from gottesmm/pr-f848d01635a5311e3a96fafadd38f0d9b79380ae 2017-10-25 21:43:06 -07:00
Michael Gottesman
79f1774d47 [silgen] Update more tests for ownership.
rdar://29791263
2017-10-25 21:12:40 -07:00
swift-ci
24f9284008 Merge pull request #12628 from gottesmm/pr-d3746e9572b30917558d7cb78112ad2dec457f61 2017-10-25 20:06:44 -07:00
Greg Parker
8445bc6e63 [runtime] Fix a typo in Visibility.h on Cygwin. 2017-10-25 19:42:19 -07:00
Michael Gottesman
0d6f6a938f Merge pull request #12626 from gottesmm/some_silgen_test_updates
Some silgen ownership test updates
2017-10-25 19:22:02 -07:00
Michael Gottesman
fa4873ae74 [ome] Teach the eliminator how to lower destructure_{struct,tuple}.
I am doing this to ensure that parts of the optimizer that have not yet been
updated for such operations do not see said instructions. This will ensure no
surprise perf regressions from this work.

rdar://31521023
2017-10-25 19:21:24 -07:00
swift-ci
e1d4bb7c5f Merge pull request #12624 from gottesmm/pr-f201c2001378ff045429aa4bdb727759118d2d51 2017-10-25 19:08:13 -07:00
Xi Ge
57b077f971 libSyntax: Add convenient APIs to check the category of SyntaxKind. NFC (#12627) 2017-10-25 18:52:43 -07:00
Michael Gottesman
9e170ee942 [silgen] Now that we allow for objc_super_method to take a metatype, enable ownership verifier on test/SILGn/objc_super.swift.
rdar://29791263
2017-10-25 17:54:47 -07:00
Michael Gottesman
573655d46c [ownership] Allow for objc_super_method to take a metatype as well as a non-trivial object.
rdar://29791263
2017-10-25 17:53:09 -07:00
Nathan Hawes
2f3bb5f7ce Merge pull request #12621 from nathawes/rdar35016463-cannot-rename-conformed-protocol-generic-constraints
[ASTWalker] Walk NominalTypeDecl parts in source order
2017-10-25 17:49:45 -07:00
Michael Gottesman
f9b608281e [silgen] Update 6 more tests for ownership.
rdar://29791263
2017-10-25 17:31:17 -07:00
Michael Gottesman
af06156bd8 [silgen] Fix ownership when peepholing bridging and enable ownership verification on test/SILGen/objc_bridging_any.swift
The bridging function that we are calling here takes in the value to be bridged
at +0. We were storing that value via a normal store. This looks like a double
consume since we were destroying the value later. Now we use a store_borrow.

rdar://29791263
2017-10-25 17:08:57 -07:00
Michael Gottesman
f201c20013 [silgen] Fix ownership when peepholing bridging and enable ownership verification on test/SILGen/objc_bridging_any.swift
The bridging function that we are calling here takes in the value to be bridged
at +0. We were storing that value via a normal store. This looks like a double
consume since we were destroying the value later. Now we use a store_borrow.

rdar://29791263
2017-10-25 17:08:47 -07:00
Doug Gregor
587cd4e463 Suppress inference of @_staticInitializeObjCMetadata for "newer" classes.
If a class was introduced in an OS newer than the deployment target,
suppress the inference of @_staticInitializeObjCMetadata, because
the resulting eager initialization will crash when run on older OS's.
This is a stop-gap solution; we want the eager initialization code to
check availability before registering the class, but that requires more
effort.

Fixes the main part of SR-6203 / rdar://problem/35161939.
2017-10-25 17:05:11 -07:00
swift-ci
ec19cad4f8 Merge pull request #12620 from gottesmm/pr-c010e00095aace2de963e4c4a8612d52fe950c63 2017-10-25 15:01:32 -07:00
Nathan Hawes
708c55607c [ASTWalker] When walking a NominalTypeDecl, walk any generic param requirements after its inherited/conformed-to TypeLocs to maintain a source-order walk. 2017-10-25 14:57:12 -07:00
swift-ci
78f67934b6 Merge pull request #12612 from gottesmm/pr-ecca9752729a232b491c1343641f4e81a2a3262a 2017-10-25 14:28:45 -07:00
Michael Gottesman
696cd13cdb [sil-mode] Add highlighting for objc_protocol. 2017-10-25 14:25:47 -07:00
Jordan Rose
5f2eb82ebf [runtime] Use an unnamed bitfield to avoid -Wglobal-constructor (#12617)
(instead of an unused field that we'd rather not initialize)

constexpr can't be 100% enforced in a template, so instead it gets
silently dropped if the instantiated function doesn't fulfill all the
requirements of being constexpr. In this case, that was a constructor
not explicitly initializing all fields, even the one we marked
unavailable. This meant we were using a non-constexpr constructor to
instantiate a global, which semantically requires static
initialization.

(The actual initialization is still optimized away at the LLVM
level. But the Clang frontend doesn't know that.)

Note that the warning will still fire unless you update your Clang
build; I just today cherry-picked the change that handles unnamed
bitfields correctly.
2017-10-25 14:23:51 -07:00
Michael Gottesman
4c80c4d66f Address John's feedback.
Specifically to commits:

36a8d0d5c0
6df5462ee2

rdar://31521023
2017-10-25 13:48:51 -07:00
Michael Gottesman
f926ab5251 [silgen] Update 12 more tests to have ownership enabled. 2017-10-25 13:35:17 -07:00
Slava Pestov
74c6946d27 Merge pull request #12615 from slavapestov/yay-already-fixed
Add a regression test for rdar://problem/35088384
2017-10-25 13:14:45 -07:00
swift-ci
8e49722672 Merge pull request #12618 from gottesmm/pr-29538764be16548a944bd0968ff9731ba8069747 2017-10-25 11:38:53 -07:00
Michael Gottesman
3e6bb986d7 [silgen] Update closures.swift for ownership.
rdar://29791263
2017-10-25 10:12:18 -07:00
swift-ci
03cef65d75 Merge pull request #12570 from lattner/nfc-headers swift-DEVELOPMENT-SNAPSHOT-2017-10-25-a 2017-10-25 10:03:32 -07:00
Xi Ge
e861d51ccf libSyntax: implement the rule of five for OwnedString to ensure correct memory management. rdar://35116413 (#12610)
Thank you! @jrose-apple
2017-10-25 09:59:58 -07:00
Roman Levenstein
6d3fd90948 Merge pull request #12605 from swiftix/resilience-performance1
Address post-commit review comments on PR #11910
2017-10-25 01:27:26 -07:00
Slava Pestov
c5182e8b6b Add a regression test for rdar://problem/35088384 2017-10-24 22:47:07 -07:00
Slava Pestov
9de82004ea Merge pull request #12595 from slavapestov/impressive-endless-regressions
Fixing various regressions
2017-10-24 22:38:36 -07:00
Slava Pestov
93c80da77c Parse: __shared and __owned should be contextual keywords
This was a source compatibility regression, someone actually had
an identifier named __shared.
2017-10-24 20:45:50 -07:00
Slava Pestov
4970d7d7e8 AST: Don't include Token.h from Module.h 2017-10-24 20:45:50 -07:00
Slava Pestov
c25e41c34c AST: Fix a typo in a diagnostic 2017-10-24 20:45:49 -07:00
Slava Pestov
b39a6eda1d Sema: Coerce base to rvalue when calling a DeclViaBridging overload kind
This code path is only used for a special purpose hack to make
NSString members available on String. Since it is rarely
exercised, it was broken.
2017-10-24 20:45:49 -07:00
Slava Pestov
5cfd7b502a IRGen: Fix conversion of qualified Clang TypeDecls
... or something. This manifested as a crash when emitting an @objc thunk
for an NS_STRING_ENUM type.

Fixes <rdar://problem/35140812>.
2017-10-24 20:45:49 -07:00
Slava Pestov
f549f359d9 IRGen: Fix crash when emitting type nested inside constrained extension
getFormalTypeInContext() was using the context archetypes of the
original parent type, and not the extension.
2017-10-24 20:45:49 -07:00
Slava Pestov
7d41e79819 Serialization: Serialize FuncDecl::hasForcedStaticDispatch()
Otherwise, a protocol conformance where the witness was a dynamic
property in another module would trigger an assertion while building
the materializeForSet witness, or miscompile and fail at runtime
if asserts are off.
2017-10-24 20:45:48 -07:00
Slava Pestov
4bf4643868 Merge pull request #12611 from slavapestov/alloc-ref-dynamic-cleanup
SILGen: Use ManagedValue variant of createAllocRefDynamic(), NFC
2017-10-24 20:11:03 -07:00
Michael Gottesman
36a8d0d5c0 [sil] Add support for the destructure_{struct,tuple} instructions.
rdar://31521023
2017-10-24 18:36:37 -07:00
Michael Gottesman
6df5462ee2 [sil] Add support for multiple value instructions by adding MultipleValueInstruction{,Result}.
rdar://31521023
2017-10-24 18:36:37 -07:00
Slava Pestov
73311c61f8 SILGen: Use ManagedValue variant of createAllocRefDynamic(), NFC
Also, enable the SIL ownership verifier for test/SILGen/objc_protocols.swift.
2017-10-24 18:17:53 -07:00