Commit Graph

816 Commits

Author SHA1 Message Date
John McCall
28c7ba900b Hack the linkage and visibility of witnesses so that the REPL
doesn't die if the same witness is required on multiple lines.
The right solution here is to find some way to re-use the
previous functions.

Swift SVN r1994
2012-05-25 17:58:00 +00:00
John McCall
30244a2f0d Do all the dancing necessary to get method calls through
protocols working.

Swift SVN r1969
2012-05-24 12:16:51 +00:00
John McCall
6a16a5aae4 Prepare some abstractions for calling through an existential type.
Swift SVN r1968
2012-05-24 12:16:47 +00:00
John McCall
872cd45dae Stub out the less-important implementations of ExistentialMemberRefExpr.
Swift SVN r1967
2012-05-24 12:16:44 +00:00
John McCall
95a8c35a36 Implement IR-generation for instance method witnesses.
Swift SVN r1966
2012-05-24 12:16:40 +00:00
Doug Gregor
74436a3120 Introduce the implicit 'This' type into protocols, which refers to the
type T that conforms to the given protocol. 'This' is modeled simply
as an associated type.



Swift SVN r1953
2012-05-23 14:45:55 +00:00
John McCall
3d5380045a Allocate space for function witnesses.
Swift SVN r1917
2012-05-21 20:01:39 +00:00
John McCall
a8e511d429 Expound a bit about the decisions we need to come to about protocol
resilience.

Swift SVN r1916
2012-05-21 20:01:38 +00:00
John McCall
d1ce608f17 Implement conversion to super-protocols.
Swift SVN r1915
2012-05-21 20:01:37 +00:00
John McCall
e231868a84 Add witnesses for base protocols. For now, these are always
out-of-line rather than prefixed.

Swift SVN r1914
2012-05-21 20:01:36 +00:00
John McCall
e98d38bb3c Set up the basic framework for building witness-table layouts in
both the abstract and concrete cases.

Swift SVN r1913
2012-05-21 20:01:34 +00:00
John McCall
72ebeee76f Try to optimize assignment a bit more, and fix assignment
of protocol types to correctly handle self-assignment.
This ends up creating such a large amount of code that it's
worth extracting into its own helper function.  Fortunately,
this can be the same helper function for every protocol type.

Swift SVN r1905
2012-05-19 06:46:05 +00:00
John McCall
90939b19c0 Provide a base class for implementing a single retainable object
pointer TypeInfo more conveniently.  Have this class return true for
isSingleRetainablePointer().  Further specialize the implementations
of the value witnesses so that we no longer ever require type-specific
witnesses for reference types.

Swift SVN r1900
2012-05-18 10:02:04 +00:00
John McCall
d461d72e85 Implement ErasureExpr in IR-gen, at least as far as generating
value witnesses goes.

There are three major remaining things to do to support protocols:
  - laying out the actual protocol members
  - emitting witnesse for the actual protocol members
  - detecting uses of the actual protocol members and funnelling
    them through the witnesses as appropriate
All this work was just to let us treat protocol types as
first-class values.

Swift SVN r1899
2012-05-18 10:02:01 +00:00
John McCall
cf6a1fd284 Implement assignment on protocol types.
Swift SVN r1896
2012-05-18 10:01:50 +00:00
John McCall
85acda32bb Implement basic functionality for protocol types, with the
exception of assign.

Swift SVN r1895
2012-05-18 10:01:46 +00:00