Commit Graph

2543 Commits

Author SHA1 Message Date
swift-ci
247fa21f19 Merge remote-tracking branch 'origin/master' into master-next 2017-06-07 00:08:33 -07:00
Michael Gottesman
a11fceb635 [gardening] Remove unneeded method addNodeToList on ilist_traits<SILBasicBlock>.
addNodeToList only needs to be implemented to override the default callback
behavior of ilist_trait_defaults<SILBasicBlock>.  This implmentation in
ilist_traits<SILBasicBlock> is exactly the same as the default callback so is
unnecessary.
2017-06-06 10:12:37 -07:00
swift-ci
19acfea4fc Merge remote-tracking branch 'origin/master' into master-next 2017-06-05 19:48:33 -07:00
Michael Gottesman
c3a5c51586 [gardening] Move SILInstruction::replaceAllUsesWithUndef onto ValueBase.
This allows this method to also be used on SILArguments.
2017-06-05 17:01:02 -07:00
swift-ci
d8272944da Merge remote-tracking branch 'origin/master' into master-next 2017-05-22 22:08:34 -07:00
Slava Pestov
9c7afa7bdd SILGen: Fix issues with types nested inside fully-concrete extensions
Add a new version of TypeConverter::getEffectiveGenericSignature()
which takes a DeclContext, which uses the same logic as the
AnyFunctionRef version, and use it when computing lowered types
for destructors, stored property initializers and ivar destroyers.

Also, canonicalize the interface type of 'Self' as part of building
these types, to fold away concrete generic parameters.

Fixes <rdar://problem/32120987>.
2017-05-22 19:49:53 -07:00
swift-ci
ef2dc2c423 Merge remote-tracking branch 'origin/master' into master-next 2017-05-12 12:48:31 -07:00
Roman Levenstein
58dab83350 Make maybeScopeless declaration unconditionally available 2017-05-12 12:33:49 -07:00
Max Moiseev
614bb13cbf Merge remote-tracking branch 'origin/master' into master-next 2017-05-11 11:29:22 -07:00
Huon Wilson
606a3cc679 Merge pull request #9313 from huonw/symbol-list-7
TBD: ivar init/destroy, materializeForSet callbacks
2017-05-11 20:13:22 +10:00
Roman Levenstein
3e7da65106 Merge pull request #9470 from swiftix/generic-specialization-fixes
[generic-specializer] Fixes for partial_apply instructions and for specialization of self-recursive functions
2017-05-10 21:04:54 -07:00
Jordan Rose
cbc35f03d3 Merge pull request #9451 from jrose-apple/protocols-have-tables-too
Handle missing members in protocols as well.
2017-05-10 17:02:52 -07:00
Jordan Rose
df26b25f3a Merge pull request #9360 from jrose-apple/VTablePlaceholder
Add a new MissingMemberDecl and use it to handle non-deserializable class members
2017-05-10 17:02:16 -07:00
Roman Levenstein
f78678a529 [sil-cloner] Improve handling of self-recursive apply instructions
- re-factor the code so that all kinds of applies can reuse it
- properly handle self-recursive generic functions

Fixes rdar://31899989 and rdar://31886854
2017-05-10 16:31:08 -07:00
Jordan Rose
aeb0fedad1 Handle missing members in protocols as well.
This means both not crashing when we deserialize the protocol but
also emitting correct offsets for dynamic dispatch through the
protocol's witness table.

Also fix a bug with vtable and witness table slots for
materializeForSet accessors for properties that can't be
imported. Because materializeForSet doesn't have the type of the
property in its signature, it was taking a different failure path from
everything else, and that failure path didn't properly set the name or
flags for the missing member.

Finishes rdar://problem/31878396
2017-05-10 13:43:33 -06:00
Roman Levenstein
946b1d4225 Fix issues with the AddressLowering pass
Override the current SILModuleConvention of the SILModule when we perform the address lowering.
2017-05-10 11:59:43 -07:00
Jordan Rose
384b2a674b Actually honor MissingMemberDecls in ClassMetadataScanner.
...which is sufficient to correctly invoke methods in a vtable
even when members have been deleted. 🎉
2017-05-10 12:41:22 -06:00
Roman Levenstein
45c2c4af0e Re-factoring: Get rid of useless arguments in "create*Apply" functions
Till now createApply, createTryApply, createPartialApply were taking some arguments like SubstCalleeType or ResultType. But these arguments are redundant and can be easily derived from other arguments of these functions. There is no need to put the burden of their computation on the clients of these APIs.

The removal of these redundant parameters simplifies the APIs and reduces the possibility of providing mismatched types by clients, which often happened in the past.
2017-05-10 08:03:37 -07:00
swift-ci
966ea67056 Merge remote-tracking branch 'origin/master' into master-next 2017-05-09 15:08:38 -07:00
swift-ci
4ebe4afe2a Merge remote-tracking branch 'origin/master' into master-next 2017-05-09 13:28:49 -07:00
practicalswift
8c40c65c80 [gardening] Fix typos. 2017-05-09 21:50:04 +02:00
Huon Wilson
890d348562 [SIL] ivar initializers & destroyers are never public. 2017-05-09 21:16:36 +10:00
Slava Pestov
edb1e97a35 SIL: Remove uncurryLevel from SILDeclRef
All we need to store is whether the SILDeclRef directly
references the declaration, or if it references a curry
thunk, and we already have an isCurried bit for that.
2017-05-09 00:56:35 -07:00
swift-ci
502bda365b Merge remote-tracking branch 'origin/master' into master-next 2017-05-05 13:48:34 -07:00
Michael Gottesman
86620aaa7e Merge pull request #9318 from practicalswift/redundant-types-in-casts
[gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
2017-05-05 13:37:12 -07:00
practicalswift
492f5cd35a [gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
Replace `NameOfType foo = dyn_cast<NameOfType>(bar)` with DRY version `auto foo = dyn_cast<NameOfType>(bar)`.

The DRY auto version is by far the dominant form already used in the repo, so this PR merely brings the exceptional cases (redundant repetition form) in line with the dominant form (auto form).

See the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names) for a general discussion on why to use `auto` to avoid redundant repetition of type names.
2017-05-05 09:45:53 +02:00
swift-ci
aeafbd7a07 Merge remote-tracking branch 'origin/master' into master-next 2017-05-04 20:28:58 -07:00
Jordan Rose
6c098033de Lift the decision of whether a method needs a vtable slot up to AST.
This lets us serialize that decision, which means we can conceivably
/change/ the decision in later versions of the compiler without
breaking existing code. More immediately, it's groundwork that will
eventually allow us to drop decls from the AST without affecting
vtable layout.

This isn't actually a great answer; what we really want is for SIL
vtables to be serialized consistently and treated as the point of
truth. But that would be more change than we're comfortable taking in
the Swift 4 timeframe.

First part of rdar://problem/31878396.
2017-05-04 17:49:47 -07:00
swift-ci
9495305b53 Merge remote-tracking branch 'origin/master' into master-next 2017-05-03 20:29:01 -07:00
Joe Groff
76b9f21f59 SIL: KeyPathInst has to have side effects, since it retains.
Fixes rdar://problem/31975279.
2017-05-03 19:25:27 -07:00
swift-ci
289827bbd4 Merge remote-tracking branch 'origin/master' into master-next 2017-05-02 17:08:57 -07:00
Joe Groff
6764072773 SILCloner: Map opened types using Type::subst instead of transform.
transform doesn't handle conformances properly, so it blows up on SILBoxTypes (and would eventually blow up on BoundGenericTypes if we ever model their arguments properly as substitution lists). Fixes rdar://problem/31941811.
2017-05-02 15:38:12 -07:00
swift-ci
f1539d0a2e Merge remote-tracking branch 'origin/master' into master-next 2017-05-02 08:08:58 -07:00
Joe Groff
e2fdea9709 Merge pull request #9174 from jckarter/keypath-dfe
SIL: Don't DFE functions referenced from KeyPath patterns.
2017-05-02 07:57:50 -07:00
swift-ci
9e1c63dc96 Merge remote-tracking branch 'origin/master' into master-next 2017-05-02 00:08:58 -07:00
Andrew Trick
195da33d1d [Exclusivity] Add deserialization callbacks from the optimizer.
AccessMarkerElimination now registers a callback so that any subsequently
deserialized function bodies will have access markers stripped for optimization.

rdar:31908496 Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of
              incompatible type!") in SILPerformanceInliner
2017-05-01 21:50:44 -07:00
Joe Groff
224120f54b SIL: Don't DFE functions referenced from KeyPath patterns.
Fixes rdar://problem/31776015.
2017-05-01 17:32:50 -07:00
swift-ci
1378be1c6d Merge remote-tracking branch 'origin/master' into master-next 2017-05-01 15:55:31 -07:00
Joe Shajrawi
4dc0801785 IRGen Mandatory Module Pass: Pass large loadable types by address instead of by value 2017-05-01 12:04:06 -07:00
Joe Shajrawi
0d0cac357a retain_value_addr and release_value_addr SIL instructions: take as an input an address, load the value inside it and call retain_value and release_value respectively 2017-04-30 10:23:55 -07:00
Joe Shajrawi
d17258cac7 @in_constant calling convention - part of passing large loadable types by address 2017-04-30 10:13:02 -07:00
swift-ci
eb6f0906c2 Merge remote-tracking branch 'origin/master' into master-next 2017-04-28 12:08:34 -07:00
Roman Levenstein
1731250dac [sil-open-archetypes-tracker] Add type dependent operands to more instructions
The following instructions were enhanced with type dependent operands:
- convert_function
- pointer_to_thin_function
- upcast_inst
- thin_to_thick_function

Fixes rdar://31879356
2017-04-28 09:35:06 -07:00
swift-ci
cdde06ac25 Merge remote-tracking branch 'origin/master' into master-next 2017-04-27 15:56:02 -07:00
swift-ci
962c71a2f1 Merge pull request #9056 from atrick/access 2017-04-26 18:10:28 -07:00
Andrew Trick
087a1a956e Fix SIL serialization for access markers. 2017-04-26 17:11:30 -07:00
Michael Gottesman
e11daa8ddf [upstream-update] Do not use succ_iterator in GraphTraits. Use succblock_iterator instead.
rdar://31790907
2017-04-26 16:50:57 -07:00
swift-ci
b853412307 Merge pull request #9037 from gottesmm/small_succ_updates 2017-04-26 14:03:15 -07:00
Michael Gottesman
913920c93b [sil] Rename SILSuccessorIterator -> SILSuccessor::pred_iterator.
This iterator is not actually a SILSuccessorIterator since it is not iterating
over the "successors" of a block. Instead it is used to given the head of a CFG
edge, iterate over the CFG edge's predecessors using the double linked list
stored inside SILSuccessor.

This rename/refactor ties SILSuccessor closer to SILSuccessorIterator and makes
it clear what we are actually iterating over.
2017-04-26 13:32:59 -07:00
Michael Gottesman
3ab6604a67 [gardening] Add more comprehensive comments to SILSuccessor.h.
This just makes it clearer what this class really does and also makes it clear
that this is really representing a CFGEdge more than a specific successor. I may
rename it to SILCFGEdge at some point to make the name match its usage.
2017-04-26 13:15:51 -07:00