Commit Graph

463 Commits

Author SHA1 Message Date
Doug Gregor
e9fdec95fe Put specialized and inherited conformances into an appropriate arena.
This is infrastructure toward allowing us to construct conformances
where there are type variables <rdar://problem/15168483>, which keeps
tripping up library work.

Swift SVN r12899
2014-01-24 04:13:17 +00:00
Joe Groff
0776c4b6b8 SIL: Reorient function type lowering toward interface types.
Lower types for SILDeclRefs from the interface types of their referents, dragging the old type along for the ride so we can still offer the context to clients that haven't been weaned off of it. Make SILFunctionType's interface types and generic signature independent arguments of its  Derive the context types of SILFunctionType from the interface types, instead of the other way around. Do a bunch of annoying inseparable work in the AST and IRGen to accommodate the switchover.

Swift SVN r12536
2014-01-18 19:42:02 +00:00
Doug Gregor
df4d42ec47 Scaffolding for lazy witness resolution.
No functionality change yet.

Swift SVN r11676
2013-12-27 21:26:16 +00:00
Joe Groff
1690f5265c IRGen: Emit witness tables as exported symbols in -emit-sil-protocol-witness-tables mode.
SILGen eagerly produces witness tables for all of the conformances defined in the module, which is what we want in order to make them runtime-unique. Have IRGen follow suit. This should address a ton of radars about breakage with non-unique conformances once SIL witnesses are turned on. We will need some runtime machinery to handle witness tables with dependent fields, but since we currently ignore the associated type fields of witnesses, we can get away with emitting direct references to all witness tables for now.

Swift SVN r11608
2013-12-23 20:31:49 +00:00
Joe Groff
41276a6d04 AST: Make ProtocolConformance::getGenericParams handle generic params from a generic parent of a nongeneric local nominal type.
Swift SVN r11574
2013-12-22 22:37:50 +00:00
Doug Gregor
be3463f32d Store a file-level DeclContext* in protocol conformances rather than a module.
We'll need to perform name lookup based on the file-level
DeclContext*, so the module no longer suffices. No functionality
change here yet.


Swift SVN r11523
2013-12-20 22:53:21 +00:00
Doug Gregor
b9696e1c01 Create protocol conformances and then, separately, fill in the witnesses.
This is a structural baby step toward lazily filling in protocol
conformances. We always build a ProtocolConformance, then mark it
either "complete" (when it's well-formed) or "invalid" (when it's
ill-formed). At present, the only benefit to this is that it slows
diagnostic cascades from invalid conformances.


Swift SVN r11492
2013-12-20 00:29:00 +00:00
Doug Gregor
2d75ca2adf Add a LazyResolver to ProtocolConformance::getWitness().
Swift SVN r11331
2013-12-15 19:40:49 +00:00
Doug Gregor
07c0793e30 Construct the type witnesses of SpecializedProtocolConformance lazily.
A SpecializedProtocolConformance intentionally contains all of the
information we need to synthesize the type witnesses from the
underlying (generic) conformance. Do so lazily rather than eagerly,
because we won't always need all of them.

As a nice side effect, we no longer need to serialize the witnesses of
these specialized protocol conformances, so we can save some space in
the Swift module file.


Swift SVN r11303
2013-12-14 06:20:44 +00:00
Doug Gregor
1b161ff043 Eliminate ProtocolConformance::getTypeWitnesses().
Swift SVN r11301
2013-12-14 05:19:18 +00:00
Doug Gregor
8aa7eaa150 Remove ProtocolConformance::getWitnesses().
Swift SVN r11278
2013-12-13 23:55:37 +00:00
Joe Groff
1f3c29b86c Give ProtocolConformance a getGenericParams() method.
It's useful to know what the open type variables in a generic protocol conformance are. For now, make the somewhat shaky assumptions that a NormalProtocolConformance for a bound generic type is for the DeclaredTypeInContext of its originating nominal type, that all type variables of the nominal type are open, and that specialized and inherited conformances bind all of the generic parameters.

Swift SVN r11274
2013-12-13 22:59:34 +00:00
Doug Gregor
82a2cc19fe Add missing file from prior commit.
Swift SVN r6866
2013-08-02 23:14:54 +00:00