Commit Graph

521 Commits

Author SHA1 Message Date
Michael Gottesman
5b88963e78 [SIL] Implement external SIL Witness Table declarations.
This will help with ensuring that we do not create multiple witness
table "definitions" one of which is null. That situtation yields an
IRGen assertion to be hit since the external declaration (in the guise
of a definition) has a different type from the actual deserialized
definition.

Swift SVN r14999
2014-03-13 19:52:59 +00:00
Dmitri Hrybenko
e50b52fa02 Serializer/Driver: serialize comments to separate .swiftdoc files
The driver infers the filename from the module file by replacing the extension,
and passes the explicit path to the swiftdoc file to the frontend.  But there
is no option in the driver to control emission of swiftdoc (it is always
emitted, and name is always inferred from the swiftmodule name).

The swiftdoc file consists of a single table that maps USRs to {brief comment,
raw comment}.  In order to look up a comment for decl we generate the USR
first.  We hope that the performance hit will not be that bad, because most
declarations come from Clang.  The advantage of this design is that the
swiftdoc file is not locked to the swiftmodule file, and can be updated,
replaced, and even localized.


Swift SVN r14914
2014-03-11 10:42:26 +00:00
Joe Groff
945fbaf167 SIL: Add a linkage specifier to SILWitnessTables.
In the short term, we need to be able to emit shared symbols for SILWitnessTables corresponding to Clang-imported modules, and soon, the generic specializer will need to be able to reference *_external witness tables deserialized from library modules.

Swift SVN r14887
2014-03-10 23:14:16 +00:00
Joe Groff
9f12e2e4a4 Enable same-type concrete constraints, e.g. <T: P where T.Assoc == Int>
Let ArchetypeType nested types and PotentialArchetypes be bound to concrete types in addition to archetypes. Constraints to outer context archetypes still suffer type-checker issues, but constraints to true concrete types should work now.

Swift SVN r14832
2014-03-08 17:18:17 +00:00
Joe Groff
9e5bc637ae Add __FUNCTION__ as a magic literal identifier.
Add __FUNCTION__ to the repertoire of magic source-location-identifying tokens. Inside a function, it gives the function name; inside a property accessor, it gives the property name; inside special members like 'init', 'subscript', and 'deinit', it gives the keyword name, and at top level, it gives the module name. As a bit of future-proofing, stringify the full DeclName, even though we only ever give declarations simple names currently.

Swift SVN r14710
2014-03-06 01:06:06 +00:00
Chris Lattner
d758e0dfe3 Eliminate more "DynamicLookup" in favor of "AnyObject", this is the
bulk of finishing rdar://13327098.


Swift SVN r14653
2014-03-04 22:15:46 +00:00
Doug Gregor
15be2159a2 Rename "abstract initializers" to "required initializers".
It's better than what we have.

Swift SVN r14620
2014-03-03 23:12:40 +00:00
Doug Gregor
b3cbbb6c4e Bump module format version for peer_method removal.
Swift SVN r14602
2014-03-03 18:48:53 +00:00
Doug Gregor
82c1ba2e29 Remove peer_method instruction; we're no longer using it.
Swift SVN r14599
2014-03-03 17:13:06 +00:00
Doug Gregor
5d8bd84dfa Introduce the SIL instruction alloc_ref_dynamic.
alloc_ref_dynamic allocates an instance of a class type based on the
value in its metatype operand. Start emitting these instructions for
the allocating constructor of a complete object initializer (not yet
tested) and for the allocating constructor synthesized for an imported
Objective-C init method.

Still missing:
  - IRGen still does the same thing as alloc_ref right now. That
  change will follow.
  - There are devirtualization opportunities when we know the value of
  the metatype that would turn an alloc_ref_dynamic into an alloc_ref;
  I'm not planning to do this optimization.



Swift SVN r14560
2014-03-01 21:55:50 +00:00
Joe Groff
179b101e6f Serialization: Serialize compound names of FuncDecls.
Store the name components as a BCArray, and push the asmname BCBlob into an optional trailing record layout.

Swift SVN r14556
2014-03-01 04:10:33 +00:00
Doug Gregor
9fe6d31639 Re-bump module version number for complete object initializer changes.
Swift SVN r14554
2014-03-01 00:51:23 +00:00
Doug Gregor
571ae697d5 Parsing and AST support for complete object initializers.
Enforce that complete object initializers always be delegating.

Swift SVN r14549
2014-03-01 00:51:18 +00:00
Joe Groff
61c9d1ab4d Bump module format because we removed SIL instructions.
Swift SVN r14521
2014-02-28 16:48:54 +00:00
Dmitri Hrybenko
cf82449090 Rename @IBLiveView to IBDesignable per request in rdar://16135911
Swift SVN r14462
2014-02-27 15:26:54 +00:00
Michael Gottesman
7091395c4b [sil-deserialization] Increment format minor version and move sil record info to SILFormat.h from ModuleFormat.h/DeclTypeRecordNodes.def.
Swift SVN r14367
2014-02-26 01:42:59 +00:00
Michael Gottesman
0aebf1f4a5 [sil-deserialization] Teach SIL how to deserialize generic outer parameters.
With this commit, we can deserialize the stdlib. Still running into
issues related to linking that requires a consultation with John. That
will come in a later commit.

Swift SVN r14365
2014-02-26 01:14:08 +00:00
Chris Lattner
7f4c0b981c rename the StoredObjC storage class to StoredWithTrivialAccessors since
we'll be using it for more general things soon.  NFC.


Swift SVN r14329
2014-02-25 01:08:27 +00:00
Joe Groff
c1919d3d32 AST: Know the Hashable and Comparable protocols.
So we will be able to derive conformances for them.

Swift SVN r14233
2014-02-21 22:50:01 +00:00
Doug Gregor
0da11a8b0b Implement semantic analysis for abstract initializers.
Swift SVN r14221
2014-02-21 19:41:14 +00:00
Michael Gottesman
9311672c33 Move ModuleFile.h, ModuleFormat.h, and DeclTypeRecordNodes.def to include/swift/Serialization.
This allows for a secondary tool to access the deserialized Module inside the SerializedASTFile's ModuleFile.

Swift SVN r14173
2014-02-20 22:03:55 +00:00