Commit Graph

1582 Commits

Author SHA1 Message Date
David Zarzycki
77a29c9551 [AST] Perf: Improve getDesugaredType() efficiency
Make getDesugaredType() as fast as possible for now. With the old way:

1) Switching over the sugared types turned into a frequently
   mispredicted branch because the sugar in the type system is random
   as far as the processor is concerned.
2) Storing the underlying/singlely-desugared type at different offsets
   in memory adds more code bloat and misprediction.

Short of a major redesign to avoid pointer chasing, this is probably as
fast as the method will get.
2018-01-03 09:45:48 -05:00
Slava Pestov
6af8d18a00 IRGen: Remove -enable-class-resilience staging flag 2018-01-03 00:26:10 -08:00
Doug Gregor
7e6f52308d [Runtime] Move conformance kind into low bits of witness table reference.
Move the 2-bit conformance reference kind from the conformance flags (which
is meant to go away) into the lower two bits of the witness table offset.
2018-01-02 12:34:06 -08:00
swift-ci
c448c55676 Merge remote-tracking branch 'origin/master' into master-next 2018-01-02 09:29:04 -08:00
David Zarzycki
2c840a9a22 [AST] Perf: targeted use of __builtin_assume() in dyn_cast wrappers
Workaround:
https://bugs.llvm.org/show_bug.cgi?id=35790
See also:
https://bugs.llvm.org/show_bug.cgi?id=28430
2018-01-02 07:22:55 -05:00
swift-ci
00cf2a4070 Merge remote-tracking branch 'origin/master' into master-next 2017-12-28 08:49:22 -08:00
swift-ci
d2dc653420 Merge pull request #13637 from davezarzycki/sil_nfc_remove_boilerplate3 2017-12-28 08:46:48 -08:00
swift-ci
ea5116e40b Merge remote-tracking branch 'origin/master' into master-next 2017-12-28 08:29:21 -08:00
David Zarzycki
68c696dbc1 [SIL] NFC: Replace boilerplate projection with swift::ArrayRefView 2017-12-28 09:51:29 -05:00
David Zarzycki
da238539f5 [Basic] NFC: Inline bitfield cleanup
1) Remove SWIFT_INLINE_BITS boilerplate. Now that we're not using anonymous/transparent unions, we don't need the
SWIFT_BITFIELD_BITS macro.
2) Refine the the bitfield size check to better support templated bitfields.
3) Refine the SIL templated bitfields to not be prematurely "full".
2017-12-28 09:20:31 -05:00
swift-ci
b5050ce5ac Merge remote-tracking branch 'origin/master' into master-next 2017-12-22 01:09:43 -08:00
Greg Parker
c677a5dc11 [IRGen][runtime] Prepare to change the is-Swift bit in class metadata. (#13595)
Swift class metadata has a bit to distinguish it from non-Swift Objective-C
classes. The stable ABI will use a different bit so that stable Swift and
pre-stable Swift can be distinguished from each other.

No bits are actually changed yet. Enabling the new bit needs to wait for
other coordination such as libobjc.

rdar://35767811
2017-12-22 00:52:00 -08:00
swift-ci
18fea54dd3 Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 11:29:13 -08:00
swift-ci
adf83617ec Merge pull request #13526 from DougGregor/remove-conditional-conformances-flag 2017-12-19 11:17:44 -08:00
Doug Gregor
5c831a71ee Revert "[SE-0143] Put conditional conformances behind an "experimental" flag."
This reverts commit b59c30c1af.
2017-12-18 22:54:31 -08:00
swift-ci
fd21243bd6 Merge remote-tracking branch 'origin/master' into master-next 2017-12-18 17:08:54 -08:00
Ben Langmuir
122df2b00d Merge pull request #13510 from benlangmuir/cc-call-pattern-option
[code-complete] Try to make call-pattern completions usable again
2017-12-18 17:03:12 -08:00
swift-ci
0302515cf0 Merge remote-tracking branch 'origin/master' into master-next 2017-12-18 12:48:55 -08:00
David Zarzycki
54ea315586 [Basic] NFC: Stop using transparent unions 2017-12-16 10:43:49 -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
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
3bd7e85d51 Merge remote-tracking branch 'origin/master' into master-next 2017-12-10 18:29:46 -08:00
Mark Lacey
d8f492e5d7 Squelch some warnings.
Fix up some dead code warnings as well as a warning for testing
whether an unsigned number is non-negative (which it always is).
2017-12-10 15:21:19 -08:00
swift-ci
31d959475d Merge remote-tracking branch 'origin/master' into master-next 2017-12-04 01:10:39 -08:00
Graydon Hoare
3726e69852 [NamedLazyMemberLoading] Flip flag polarity: on by default, optionally off. 2017-12-01 16:52:25 -08:00
swift-ci
75e5e6e1bd Merge remote-tracking branch 'origin/master' into master-next 2017-12-01 07:30:21 -08:00
Arnold Schwaighofer
eba12a7c3e Revert "Finish and default-enable named lazy member loading" 2017-12-01 07:25:54 -08:00
swift-ci
77e50e08da Merge remote-tracking branch 'origin/master' into master-next 2017-12-01 02:32:31 -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
3de4297c91 [NamedLazyMemberLoading] Flip flag polarity: on by default, optionally off. 2017-11-30 22:01:05 -08:00
swift-ci
4815c1a745 Merge remote-tracking branch 'origin/master' into master-next 2017-11-28 19:50:29 -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
70a330ff22 Merge remote-tracking branch 'origin/master' into master-next 2017-11-28 17:09:44 -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
3807b3fa1e [Parse] Add platform conditional targetEnvironment(simulator) 2017-11-28 13:51:01 -08:00
swift-ci
d3b8ffc42a Merge remote-tracking branch 'origin/master' into master-next 2017-11-14 12:09:04 -08:00
Erik Eckstein
90c21be191 Unify the implementation of optimization mode in various option classes.
This commit is mostly refactoring.

*) Introduce a new OptimizationMode enum and use that in SILOptions and IRGenOptions
*) Allow the optimization mode also be specified for specific SILFunctions. This is not used in this commit yet and thus still a NFC.

Also, fixes a minor bug: we didn’t run mandatory IRGen passes for functions with @_semantics("optimize.sil.never")
2017-11-14 11:25:02 -08:00
swift-ci
84a54bd654 Merge remote-tracking branch 'origin/master' into master-next 2017-11-09 11:09:14 -08:00
Alex Hoppen
746bfc6d59 [Refactoring] Add refactoring action to move type members to extension (#12795)
This implements SR-6297.
2017-11-09 11:08:34 -08:00
swift-ci
6f7b08c188 Merge remote-tracking branch 'origin/master' into master-next 2017-11-08 22:09:40 -08:00
Graydon Hoare
173e702da2 [Stats] Add a pair of counters to track failed processes. 2017-11-08 19:53:36 -08:00
swift-ci
a55239afad Merge remote-tracking branch 'origin/master' into master-next 2017-11-03 18:50:01 -07:00
Xi Ge
6af5d3c0bf libSyntax: rename KeepTokensInSourceFile to KeepSyntaxInfoInSourceFile. 2017-11-03 18:39:01 -07:00
swift-ci
de952fc5d1 Merge remote-tracking branch 'origin/master' into master-next 2017-11-01 18:28:59 -07:00
Doug Gregor
6007783fa5 [AST Verifier] Eliminate “sharding” of AST verification.
The only client of this (the parse_stdlib) tests didn’t need it and
are no longer using it.
2017-11-01 16:07:25 -07:00
swift-ci
f766bc3396 Merge remote-tracking branch 'origin/master' into master-next 2017-10-25 10:09:25 -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
swift-ci
9b151cf5b3 Merge remote-tracking branch 'origin/master' into master-next 2017-10-24 14:29:54 -07:00