Commit Graph

55 Commits

Author SHA1 Message Date
John McCall
a8ed3dae12 Deserialize generic contexts by mapping their archetypes
to the archetypes of their generic parameter declarations.

This was a major inconsistency that was causing a lot of
problems with deserialized generic functions in the presence
of chained module files.  In particular, what would happen is
that all the deserialized uses of the archetype would be
mapped to a freshly-created archetype, but the GenericParamList
would refer to GenericTypeParamDecls deserialized from
(potentially) a different ModuleFile and therefore using a
different archetype (since the deserializer assumes that
different modules never share archetypes).

The fix relies on processing a generic parameter list before
any references to the archetypes.  Unfortunately, we have
bogus references to archetypes in substitution lists scattered
everywhere in SIL and the AST.  I've introduced a really
gross hack where we allow archetypes to be created in that
way but just drop them (in favor of the parameter's archetype)
after processing the generic parameter list; this should
work as long as all the decontextualized references are
basically pointless, but like I said, it's gross, and I've
filed rdar://16240384 to clean it up.

Swift SVN r14694
2014-03-05 22:41:28 +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
Jordan Rose
9a45a563ea Load Swift modules from framework bundles.
Swift can now find modules inside framework bundles matching this layout:

Foo.framework/
  Foo.swiftmodule/
    ARCH.swiftmodule

Currently, ARCH is the architecture name used by build configurations (#if),
but this was more done out of convenience than anything else (there's
currently no access to the current target from the ASTContext). We'll need
to revisit this if/when we decide to support architecture subtypes (armv7s
vs. armv7 vs. arm), at which point we'll also have to deal with fallback
architectures.

Framework search paths are specified using -F. Like bare import paths, there
are currently no "built-in framework search paths".

The master plan for Swift frameworks is in <rdar://problem/16062602>.

<rdar://problem/16155907>

Swift SVN r14363
2014-02-26 01:12:18 +00:00
Argyrios Kyrtzidis
9873694a88 [Serialization] A module that shadows a system module, should be considered a system one as well.
Fixes rdar://16092932

Swift SVN r14263
2014-02-22 18:56:04 +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