Commit Graph

7436 Commits

Author SHA1 Message Date
David Zarzycki
408bf0d840 [AST] NFC: Migrate CompoundIdentTypeRepr to llvm::TrailingObjects 2017-12-30 10:56:37 -05:00
David Zarzycki
9c33f05f97 [AST] NFC: Migrate GenericIdentTypeRepr to llvm::TrailingObjects 2017-12-30 10:12:26 -05:00
David Zarzycki
5e0d60fe34 [AST] NFC: Micro-optimize TupleTypeRepr misc bits
TupleTypeRepr has "misc bits" to spare and x86 has a small bias against
8/16-bit logic (due to partial register updates, instruction length
modifying prefixes, etc.)
2017-12-30 09:47:39 -05:00
David Zarzycki
62795501d9 [AST] NFC: De-boilerplate "has ParenType sugar" 2017-12-29 11:37:20 -05:00
David Zarzycki
41a0553228 [AST] NFC: De-boilerplate TupleType "is paren like" checks
Also, make callers be explicit when they're ignoring the field name.
2017-12-29 08:32:28 -05:00
David Zarzycki
296d1b8195 [AST] NFC: Repack two Pattern bits 2017-12-28 14:20:21 -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
Karoy Lorentey
f481530a92 Merge pull request #13056 from xwu/much-of-a-muchness
[stdlib/Sema/AST] Adopt a commonly used implementation for combining hashes
2017-12-21 18:27:56 +01:00
David Zarzycki
1040d18227 [AST] NFC: Tail allocate TupleShuffleExpr data 2017-12-21 08:52:13 -05:00
David Zarzycki
37ff003517 [AST] NFC: ErrorType is effectively 'final'
The ErrorType optionally tail allocates the original type, therefore it
is 'final'.
2017-12-20 09:35:15 -05:00
David Zarzycki
362d801472 [AST] NFC: Tail allocate CaptureListExpr entries 2017-12-20 09:35:15 -05:00
David Zarzycki
5a4e96fcc2 [AST] NFC: Tail allocate UnresolvedSpecializeExpr TypeLocs 2017-12-20 09:35:15 -05:00
David Zarzycki
dbb421ba95 [AST] NFC: Tail allocate ErasureExpr conformances 2017-12-20 09:35:15 -05:00
David Zarzycki
3c128f3892 [AST] NFC: Minor performance tuning
1) Make AnyFunctionType::getParams() inline friendly (it compiles down
   to just a few instructions).
2) Byte align/size the embedded number of AnyFunctionType parameters.
   This was set to 10 bits back when the inline bitfields were 32 bits
   in size. Now with 64 bits to play with, we have room to spare.
2017-12-20 09:35:15 -05:00
David Zarzycki
af0ed2339b Merge pull request #13533 from davezarzycki/nfc_repack_expr_nodes
NFC: More Expr node layout optimization
2017-12-19 16:16:30 -05:00
swift-ci
adf83617ec Merge pull request #13526 from DougGregor/remove-conditional-conformances-flag 2017-12-19 11:17:44 -08:00
David Zarzycki
1341d111f7 [AST] NFC: Init accidentally dropped initializer 2017-12-19 13:40:38 -05:00
David Zarzycki
60d2f5586e [AST] QoI: Track DictionaryExpr commas and tail allocate CollectionExpr comma locs 2017-12-19 13:33:09 -05:00
David Zarzycki
c75912215e [AST] NFC: Tail allocate CollectionExpr elements 2017-12-19 13:33:09 -05:00
David Zarzycki
0da55934a4 [AST] NFC: Repack misc CollectionExpr bits 2017-12-19 13:33:09 -05:00
David Zarzycki
177b39afc5 [AST] NFC: Repack misc SequenceExpr bits 2017-12-19 13:33:09 -05:00
David Zarzycki
b6ba119c05 [AST] NFC: Repack misc ParenExpr bits 2017-12-19 13:33:09 -05:00
David Zarzycki
2d11d77712 [AST] NFC: Repack misc TupleElementExpr bits 2017-12-19 13:33:09 -05:00
David Zarzycki
00542951d2 [AST] NFC: Repack misc TupleExpr bits 2017-12-19 13:33:09 -05: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
Pavel Yaskevich
34b83306bf [Demangler] Teach node printer to use LabelList for entities 2017-12-18 15:44:24 -08:00
Jordan Rose
15f2161277 Move the fast path of TypeBase::getCanonicalType into the header (#13479)
I'm not sure how much benefit there'll be to inlining this, but a side
benefit is that crashes in optimized builds of the compiler are much
more likely to distinguish between "bug in getCanonicalType" (which
almost never happens) and "bug in the function calling
getCanonicalType".

Inspired by rdar://problem/35819975
2017-12-18 14:55:08 -08:00
David Zarzycki
af361c041e Merge pull request #13494 from davezarzycki/nfc_sil_repack_part1
NFC: SIL repack of misc node bits (part 1)
2017-12-16 23:10:23 -05:00
David Ungar
8c10c00c96 Merge pull request #13465 from davidungar/PR7-numThreads
NFC: Add predicates to SILOptions & do renaming in TBD generation.
2017-12-16 14:46:59 -08:00
David Ungar
51d3165874 NFC: Clarifying uses of NumThreads.
Add hasMultipleGMs predicate to SILOptions.
Rename parameters to TBD file handling to better reflect abstraction boundary.

fix
2017-12-16 13:58:01 -08:00
David Zarzycki
54ea315586 [Basic] NFC: Stop using transparent unions 2017-12-16 10:43:49 -05:00
swift-ci
f3f1efc6d2 Merge pull request #13487 from DougGregor/lazy-member-lookup-base-name 2017-12-16 00:47:17 -08:00
Doug Gregor
8c05278ef3 [Clang importer] Lazily load all named members with a matching base name.
When loading the named members for a given name, we want to load all
of the members with that base name... not only the ones that match the
full name, because the lookup table is indexed by base name and
filtering too early drops candidates.

Fixes rdar://problem/36085994.
2017-12-15 23:54:36 -08:00
Robert Widmann
3081c04327 Merge pull request #13486 from CodaFi/notational-clarification
[Shepherd] Fix SR-5615
2017-12-16 02:22:34 -05:00
Jeffrey MACKO
716457c135 Fix SR-5615 2017-12-16 01:23:36 -05:00
John McCall
ea05862e4a Fix accidental extra semicolon which is causing massive warning spam. 2017-12-16 01:10:14 -05:00
Pavel Yaskevich
b6dbafba29 Merge pull request #13471 from CodaFi/array-of-sunshine
[DiagnosticsQoI] Refactor ArrayExpr visitor for better QoI
2017-12-15 16:19:40 -08:00
swift-ci
e215924239 Merge pull request #13458 from rjmccall/get-with-ext-info 2017-12-15 16:02:11 -08:00
Robert Widmann
1d6f11ab54 Refactor ArrayExpr visitor for better QoI
Also remove mention of the word “contextual” type from the diagnostic
that rewrites array literals into dictionary literals and scale back
the scope of the diagnostic.  This method was catching and
mis-diagnosing too many errors that could better be handled by invalid
conversion diagnostics.
2017-12-15 18:20:36 -05:00
John McCall
b13f30ff30 Move a convenience API for changing a SILFunctionType into the AST. NFC. 2017-12-15 18:19:07 -05:00
David Zarzycki
15953e0bde [AST] NFC: Repack misc SwitchStmt bits 2017-12-15 16:08:26 -05:00
David Zarzycki
5e9d73125e [AST] NFC: Repack misc CaseStmt bits 2017-12-15 16:00:38 -05:00
David Zarzycki
6a6242ae7b [AST] NFC: Repack misc DoCatchStmt bits 2017-12-15 15:38:59 -05:00
David Zarzycki
23ee4374ec [AST] NFC: Repack misc BraceStmt bits 2017-12-15 15:17:05 -05:00
David Zarzycki
3bae703aa2 [AST] NFC: Convert Stmt to new inline bitfield logic 2017-12-15 15:04:20 -05: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
John McCall
dfe119f86e Compute the BuiltinInfo for a builtin call to IRGenSIL; NFC.
The intention here is to make it easier to do specialized lowering
for specific builtin arguments.
2017-12-15 00:21:21 -05:00
Robert Widmann
d2aa82de1f Merge pull request #12818 from CodaFi/cover-model
Stricter enforcement of the "large space" heuristic
2017-12-14 02:01:17 -05:00
Doug Gregor
b3b86d7a25 Merge pull request #13424 from DougGregor/canonicalize-conformance-access-path
[GSB] Canonicalize conformance access paths on-the-fly.
2017-12-13 22:57:02 -08:00