Commit Graph

35577 Commits

Author SHA1 Message Date
swift-ci
bc76ac0f50 Merge remote-tracking branch 'origin/master' into master-next 2017-12-20 14:49:53 -08:00
swift-ci
02cabf1345 Merge pull request #13551 from lattner/nfc-sil-cleanups2 2017-12-20 14:42:55 -08:00
swift-ci
f4a551c03c Merge remote-tracking branch 'origin/master' into master-next 2017-12-20 12:49:47 -08: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
Chris Lattner
0c6e0c25a1 Two NFC changes:
- Add a DominanceInfo::dominates helper functions that takes two instructions,
  as analogues to the properlyDominates ones.
- Further generalize some SILBuilder code to be more defensive in the face
  of incorrect or partially constructed SIL instructions.

These are cleanups, NFC.
2017-12-19 20:18:24 -08:00
swift-ci
67df4b62fd Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 16:09:50 -08:00
Michael Gottesman
1209592421 Merge pull request #13536 from gottesmm/rdar_36032876
In SILCodeMotion, be sure to invalidate global enum tag dataflow state when deleting instructions
2017-12-19 16:09:16 -08:00
swift-ci
8b379cae0a Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 15:49:55 -08:00
swift-ci
ed1db5f73f Merge pull request #13540 from DougGregor/infer-from-concrete-sr-6640 2017-12-19 15:36:42 -08:00
swift-ci
d782c18cff Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 14:29:52 -08:00
Doug Gregor
f26d794495 [Conformance checking] Allow same-type constraints to infer associated types.
When a protocol closes off an associated type by tying it to a concrete
type (e.g., via a same-type constraint), allow associated type inference
to use that information to infer the associated type rather than
requiring the user to restate the obvious.

Fixes SR-6640.
2017-12-19 14:28:20 -08:00
Joe Shajrawi
20e291d399 Merge pull request #13535 from shajrawi/merge15
Lower the FunctionMergeThreshold from 30 to 15
2017-12-19 14:24:37 -08:00
swift-ci
6dd9ff7142 Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 13:49:50 -08:00
Devin Coughlin
88232d6e3b [Exclusivity] Look through block arguments to find noescape closures (#13497)
Update static enforcement to look through noescape blocks to find an underlying
noescape closure when a closure is converted to a block and passed as an
argument to a function. This fixes a false negative when the closure performs
an access that conflicts with an already in-progress access.

These new diagnostics are warnings for source compatibility but will
be upgraded to errors in the future.

rdar://problem/32912660
2017-12-19 13:38:09 -08:00
swift-ci
cb941b154b Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 13:30:00 -08:00
swift-ci
bd764ec848 Merge pull request #13537 from nkcsgexi/lib-syntax-pattern-binding-decl 2017-12-19 13:17:37 -08: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
Doug Gregor
82a8833ab0 [Associated type inference] Use defaults from overridden associated types.
During associated type inference, also look for default associated type
witnesses from overridden associated types, so that one need not
redeclare default associated types at every level in a protocol hierarchy.
2017-12-19 13:03:29 -08:00
Xi Ge
e0d167f1dd libSyntax: create syntax nodes for variable declarations.
Variable declarations are declarations led by either 'var' or 'let'. It
can contain multiple pattern bindings as children.

For patterns, this patch only creates syntax nodes for simple identifier
patterns, e.g. 'a = 3'. The rest of the pattern kinds are still left
unknown (UnknownPattern).
2017-12-19 12:25:51 -08:00
swift-ci
fc7b986bab Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 12:09:06 -08:00
Slava Pestov
476e41a4fc Merge pull request #13530 from slavapestov/class-resilience-part-7
Class resilience part 7
2017-12-19 11:51:52 -08:00
swift-ci
18fea54dd3 Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 11:29:13 -08:00
Michael Gottesman
af8d9b8c78 [silcodemotion] Instead of storing enum values directly into the block state structures, use a global "blotable" store to allow for invalidation without touching potentially free-ed pointers. Fix up all of the places where we violate this invariant.
rdar://36032876
2017-12-19 11:20:59 -08:00
Joe Shajrawi
91d763e5ac Lower the FunctionMergeThreshold from 30 to 15 2017-12-19 11:20:33 -08:00
swift-ci
adf83617ec Merge pull request #13526 from DougGregor/remove-conditional-conformances-flag 2017-12-19 11:17:44 -08:00
swift-ci
4a31d01a00 Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 11:09:52 -08:00
Michael Gottesman
269c5e86cd [silcodemotion] Now that we have sunk the context into each block state, we do not need to pass in the context to any routines on the block state.
rdar://36032876
2017-12-19 10:55:36 -08:00
Pavel Yaskevich
d3cd61d8eb Merge pull request #13291 from xedin/rdar-34920390
[Mangling/ABI] Mangle function names with parameter labels
2017-12-19 10:50:18 -08: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
00542951d2 [AST] NFC: Repack misc TupleExpr bits 2017-12-19 13:33:09 -05:00
Michael Gottesman
77441fcdd1 [silcodemotion] For now stash a pointer to EnumCaseDataflowContext in each of the block states that we are tracking.
In a subsequent commit, I will change this to use a trailing objects
implementation so we can just use pointer arithmetic to find the offset. But for
now I am going for simplicity since this is a bug fix.

rdar://36032876
2017-12-19 10:21:31 -08:00
Michael Gottesman
48bb2d16f1 [silcodemotion] Rename BBToDataflowStateMap -> EnumCaseDataflowContext.
rdar://36032876
2017-12-19 10:13:10 -08:00
Michael Gottesman
9cda9056b6 [silcodemotion] Add support for dumping BBEnumTagDataflowState.
rdar://36032876
2017-12-19 10:11:56 -08:00
Michael Gottesman
7819c4d41a [sil] Add const to int SILBasicBlock::getDebugId().
This is a read only function. This just allows one to call it in more places.

rdar://36032876
2017-12-19 10:10:12 -08:00
Michael Gottesman
42e1df166a [silcodemotion] Move generic code motion code below enum tag dataflow based code motion.
This gets rid of forward declaration issues in the file with some subsequent
changes I am going to be making.

rdar://36032876
2017-12-19 10:10:07 -08:00
swift-ci
81caca225a Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 07:09:51 -08:00
Arnold Schwaighofer
01d1c211c5 Merge pull request #13516 from aschwaighofer/fix_iou_cast_opt
DynamicCasts: Emit a direct copy if soure and target SIL types match
2017-12-19 07:08:41 -08:00
swift-ci
0d9c02b25b Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 02:09:53 -08:00
Slava Pestov
76499a3ce3 IRGen: Emit immediate class member offset global variable
Not used to access metadata members just yet.
2017-12-19 02:58:35 -07:00
swift-ci
dca213184a Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 00:49:53 -08:00
Slava Pestov
accec86e6c IRGen: Resilient classes require dynamic metadata initialization
An oversight. Has no effect until the next patch comes in.
2017-12-19 00:36:47 -08:00
Slava Pestov
354f4989e1 IRGen: Store type declaration in the NominalMetadataLayout 2017-12-19 00:36:47 -08:00
Slava Pestov
e65d3a7019 IRGen: Note metadata size offset in metadata layout 2017-12-19 00:36:47 -08:00
Slava Pestov
22ad20a5df TBDGen: Emit class method dispatch thunks 2017-12-18 23:28:33 -08:00
Slava Pestov
fa719f75bd SIL: SILVTableVisitor no longer needs a TypeLowering reference 2017-12-18 23:28:33 -08:00
Slava Pestov
c16c2c35bf SIL: Move getOverriddenVTableEntry() from TypeLowering to SILDeclRef
There's no reason for this to be an instance method on the TypeLowering
object, because it (no longer?) uses any type lowering operations.
2017-12-18 23:28:33 -08:00