Commit Graph

58978 Commits

Author SHA1 Message Date
Arnold Schwaighofer
e9bc7b6e63 IRGen: Set the proper return type of the casted function type of copy functions 2017-09-15 15:48:35 -07:00
Arnold Schwaighofer
d008e37b13 Merge pull request #11950 from aschwaighofer/runtime_return_dest_2
runtime: Also return the destination argument of the unknownWeak- and…
2017-09-15 14:54:44 -07:00
Andrew Trick
c1b9ff7fd9 [sil-opaque-values] Fix FunctionSigOpts for opaque owned-to-guaranteed.
Do not create destroy_addr for opaque values.

Do not create strong_retain/release for opaque types.
2017-09-15 14:08:58 -07:00
Andrew Trick
30e3062bf2 [sil-opaque-values] Allow ClosureSpecializer to handle @in captures. 2017-09-15 14:08:58 -07:00
Andrew Trick
8cccaddd70 [sil-opaque-values] fix an assert in LowerAggregates. 2017-09-15 14:08:58 -07:00
Andrew Trick
c5f226f9ff [sil-opaque-values] Add UnconditionalCheckedCastValue to SILInstruction::mayRelease. 2017-09-15 14:08:58 -07:00
Andrew Trick
3871a54402 Fix SILLoop::canDuplicate to handle all kinds of open_existential instructions. 2017-09-15 14:08:58 -07:00
Andrew Trick
a7bd3136b6 [sil-opaque-values] fix an assert in LowerAggregates. 2017-09-15 14:08:58 -07:00
Andrew Trick
658bdad4f5 [sil-opaque-values] Disable an obsolete assert in EagerSpecializer. 2017-09-15 14:08:58 -07:00
Nathan Hawes
aa7dbaf4fc Merge pull request #11942 from nathawes/syntaxmap-changes
[syntax-coloring] Upstream recent syntax map changes
2017-09-15 13:13:26 -07:00
Joe Groff
1e256d5c13 Merge pull request #11730 from jckarter/key-path-subscripts
Key path subscripts
2017-09-15 13:10:55 -07:00
Arnold Schwaighofer
8b2fa67799 Fix test case 2017-09-15 13:01:11 -07:00
Joe Groff
2ba8f57514 Remove staging flag for unimplemented key path components.
All the originally-planned component kinds are now implemented.
2017-09-15 11:55:35 -07:00
Arnold Schwaighofer
90f51f2599 runtime: Also return the destination argument of the unknownWeak- and unknownUnownedInit/Assign functions
rdar://18172130
2017-09-15 11:28:27 -07:00
Nathan Hawes
82d8ad2b55 [test] Update syntaxmap test to account for upstream changes 2017-09-15 10:56:01 -07:00
Joe Groff
b7566dacdb IRGen: Lowering for key paths with indices. 2017-09-15 10:24:28 -07:00
George Karpenkov
a9942acaf7 Disable TSan support under 32bit. (#11904)
Refactor slightly the relevant LIT code.
2017-09-15 10:24:08 -07:00
Joe Groff
78d75428d6 SILGen: Lower key path subscript indexes.
And fill out SIL support for parsing, printing, and serializing key path
patterns with captured indexes.
2017-09-15 10:00:32 -07:00
Joe Groff
a67f9ca3e5 Sema: Require indexes in key path subscript components to be Hashable.
And save the conformance to be captured when we form the KeyPath object.
2017-09-15 09:59:51 -07:00
Slava Pestov
768fb5d1de Merge pull request #11943 from slavapestov/reapply-preserve-sil-when-merging-modules
Re-apply "Preserve SIL when merging modules"
2017-09-15 08:09:53 -07:00
Ross Bayer
695ded24d4 Move legacy argparser (#11872)
* Implemented a (mostly) comprehensive test suite for the argument parser (ab)using metaclasses to dynamically generate unit-tests for each valid argument and preset.

* Fixed failing defaults test for build_ninja.

* Added new HelpOption and IgnoreOption classes for generating tests.

* Converted default value test into individual generated tests which should give better output in case the default tests fail.
swift-DEVELOPMENT-SNAPSHOT-2017-09-15-a
2017-09-15 01:05:06 -07:00
Slava Pestov
86d241b38e Driver: Pass the new -sil-merge-partial-modules flag
Also pass flags to disable SIL optimization passes when merging
modules, since that's completely unnecessary.

An evolution test that used to fail with WMO disabled now passes
with this change.

FIxes <rdar://problem/18913977>.
2017-09-15 00:24:52 -07:00
Slava Pestov
da2fb2ff30 Add test case for imported conformance usage after Sema tear-down
This test used to fail because we would look up an associated type
in an incomplete conformance after Sema was torn down, causing a
crash.

Now, the ClangImporter is able to correctly complete the conformance.
2017-09-15 00:24:52 -07:00
Slava Pestov
9c6cd08a9b IRGen: Fix lowering of alloc_ref for resilient classes
We were inlining the size and alignment, which was not correct.
This was the cause of a long-standing ASAN failure in some
library evolution tests.

Fixes <rdar://problem/24540778>.
2017-09-15 00:24:52 -07:00
Slava Pestov
6bb5b7ebcc SIL: Serialize conformances synthesized by the ClangImporter
The witness table had shared linkage, but we weren't serializing them,
which would cause linking errors if we emitted a reference to such a
witness table from a different module than the one where it was first
defined, as a result of deserializing and optimizing SIL.

This issue was introduced when SIL witness table serialization was
made conditional on the -sil-serialize-witness-tables flag, which is
normally only enabled for the standard library.

When the flag was added, existing tests were updated to pass the
flag, which masked the issue. Remove the flag from existing tests,
ensure that imported witness tables are still [serialized], and add
a new test specifically for the behavior enabled by this flag.
2017-09-15 00:24:52 -07:00
Slava Pestov
f2547d0e33 AST: Use getSuperclassForDecl() in one spot 2017-09-15 00:24:52 -07:00
Slava Pestov
a102341c9c Merge pull request #11640 from gibachan/fixit-nested-static-value
[Qol]Fixit nested static value
2017-09-14 22:56:19 -07:00
Slava Pestov
b92966978b Merge pull request #11941 from dcci/globclean
[GlobalPropertyOpt] Simplify the code a little bit. NFCI.
2017-09-14 22:12:42 -07:00
Nathan Hawes
d12d7c1b12 [SyntaxColoring] Address review feedback for rdar://problem/33463141 NFC 2017-09-14 21:36:22 -07:00
Davide Italiano
76f21eab11 [GlobalPropertyOpt] Simplify the code a little bit. NFCI.
Use getFunction() instead of recursive calls to getParent() and
return early.
2017-09-14 21:36:22 -07:00
Nathan Hawes
5b82a25240 [SyntaxColoring] Fix losing syntax highlighting for a type or function declaration following an incomplete function decl missing a closing parenthesis
If an edit didn't intersect with an existing highlighted tokens but caused a
later highlighted token to change kind, syntax highlighting would be lost
between the edit and that token.

Resolves rdar://problem/33463141.
2017-09-14 21:36:13 -07:00
Nathan Hawes
c0ee62be93 [syntax-coloring|test] Update test cases for new behaviour and address review comments 2017-09-14 21:34:22 -07:00
Nathan Hawes
f64a19bbbe [syntax-coloring] Relax the requirement that the reported affected range extends to line boundaries
The editor is now assumed to handle affected ranges that don't fall on line boundaries.
2017-09-14 21:34:22 -07:00
Nathan Hawes
13874d3f12 [syntax-coloring] Remove early exit from delta logic when there are no new highlighted tokens but are removed ones, and take account of the range of the mismatching token in the previous syntax map
We still need to adjust the affected range to the line boundaries and return all
tokens on the line when there are no new tokens, as the client will clear all
tokens on that line in its copy of the syntax map leaving the other tokens
unhighlighted. We also need to extend the affected range to include the ranges
of the mismatched tokens from the previous syntaxmap, so their highlighting will
be cleared.

Also add more comments to better document the new syntax map structure and
behaviour.
2017-09-14 21:34:22 -07:00
Nathan Hawes
391b0d860d [syntax-coloring] Add test with nested tokens 2017-09-14 21:34:22 -07:00
Nathan Hawes
77d502cb39 [syntax-coloring] Fix incorrectly reporting a no-op when a token is removed 2017-09-14 21:34:21 -07:00
Nathan Hawes
90cc29bb2c [syntax-coloring] Highlight unterminated regular and multi-line strings as strings
Also add tests for syntax map deltas when editing multi-line strings
2017-09-14 21:34:21 -07:00
Nathan Hawes
6b9690ac5c [syntax-coloring] Rework the syntax map to use offset+length rather than start/end line+column and simplify the delta logic
This patch changes the syntax map data structure it uses to be offset based
rather than line/col based in order to avoid calling getLineAndColumn for the
start and end offset of every token. This removes the 30% of time spent in
getLineAndColumn for this request in large files (rdar://problem/28965123).

The logic for returning the affected range and the token ranges to highlight
following an edit also made several assumptions that no longer hold. This
patch changes it to compare the syntax maps from before and after the edit,
find the first mismtaching tokens from the start and end of the syntax maps
and return the tokens in that range (adjusted to line boundaries). This fixes
syntax highlighting issues with interpolated multi-line strings
(rdar://problem/32148117) and block comments.

With the above changes the per-keystroke time spent for syntax highlighting
(with sematic info disabled) dropped from ~80ms to just under 50ms for a
12KLOC file.
2017-09-14 21:34:21 -07:00
swift-ci
10f327461e Merge pull request #11938 from apple/revert-8388-preserve-sil-when-merging-modules 2017-09-14 19:36:01 -07:00
Slava Pestov
7ea93d9ed0 Revert "Preserve SIL when merging modules" 2017-09-14 19:04:18 -07:00
Xi Ge
2ba1ca2d8f IDE: simplify some code. NFC (#11935)
* IDE: simplify some code. NFC

* add assert.
2017-09-14 18:19:48 -07:00
swift-ci
2a582c4867 Merge pull request #11931 from DougGregor/reexported-modules 2017-09-14 17:59:30 -07:00
Slava Pestov
ecf8f53afa Merge pull request #8388 from slavapestov/preserve-sil-when-merging-modules
Preserve SIL when merging modules
2017-09-14 17:19:38 -07:00
Doug Gregor
8c10bbb338 Add missing REQUIRES: objc_interop 2017-09-14 16:45:19 -07:00
swift-ci
6cf42ae70f Merge pull request #11932 from rudkx/fix-let-binding 2017-09-14 15:55:06 -07:00
Slava Pestov
cf9e26606e AST: Use getSuperclassForDecl() in one spot 2017-09-14 15:54:06 -07:00
Slava Pestov
ef583499a9 Driver: Pass the new -sil-merge-partial-modules flag
Also pass flags to disable SIL optimization passes when merging
modules, since that's completely unnecessary.

An evolution test that used to fail with WMO disabled now passes
with this change.

FIxes <rdar://problem/18913977>.
2017-09-14 15:54:06 -07:00
Slava Pestov
07fe6ae4c9 Add test case for imported conformance usage after Sema tear-down
This test used to fail because we would look up an associated type
in an incomplete conformance after Sema was torn down, causing a
crash.

Now, the ClangImporter is able to correctly complete the conformance.
2017-09-14 15:54:06 -07:00
Mark Lacey
5770748b56 Eliminate name duplication in test case. 2017-09-14 15:22:11 -07:00
Doug Gregor
27c8c4a8a1 [Serialization] Rewrite cross-references to private frameworks.
When serializing cross-references to a (private) module that is
re-exported through another (public) module, record the
cross-reference as if the entity were found in named public module.

Finishes rdar://problem/34438586.
2017-09-14 15:09:18 -07:00