Commit Graph

14 Commits

Author SHA1 Message Date
Adrian Prantl
ada9ebb7a9 [CLANG UPDATE!] Update uses of OnDiskChainedHashTable to the
OnDiskIterableChainedHashTable interface introduced in CFE 206189.

Thanks to Justin for guiding me through this!

Swift SVN r16337
2014-04-14 22:33:12 +00:00
Dmitri Hrybenko
68b609d7af Remove a kludge from deserialization that does not seem to be needed anymore
Swift SVN r16113
2014-04-09 13:42:17 +00:00
Jordan Rose
646952defd [serialization] Write substitution conformances as references when possible.
More importantly, when writing substitution conformances /within the same
module/, use an "incomplete" form of the NormalProtocolConformance layout
that doesn't include any of the substitutions or defaulted definitions.
This avoids a serialization cycle when the witness for a protocol itself
ends up conforming to the protocol.

I couldn't come up with a reduced test cases, but both cases filed by Dave
now work.

<rdar://problem/16468715>

Swift SVN r15912
2014-04-04 01:17:55 +00:00
Jordan Rose
aa6aa72ba1 Add lazy conformances to nominals and extensions.
...and deserialize conformances lazily.

No intended user-visible change.

Swift SVN r15911
2014-04-04 01:17:54 +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
Jordan Rose
b9d1e14dd6 [serialization] Break a cyclic dependency involving associated types.
The standard library likes to have default definitions for associated types,
which is good. Often the /choice/ of default type, however, is a type that
(indirectly) conforms to the very protocol containing the associated type.
Rather than try to make sure everything is present all at once, just delay
the deserialization of the default definition until it's actually requested.

This does swell the size of AssociatedTypeDecl by two words. I've filed
<rdar://problem/16266669> to remind myself to try to reduce this.

Part of <rdar://problem/16257259>

Swift SVN r14809
2014-03-08 00:07:29 +00:00
Joe Groff
96c09d7179 Renovate name lookup to prepare for compound name lookup.
Make the name lookup interfaces all take DeclNames instead of identifiers, and update the lookup caches of the various file units to index their members by both compound name and simple name. Serialized modules are keyed by identifiers, so as a transitional hack, do simple name lookup then filter the results by compound name.

Swift SVN r14768
2014-03-07 03:21:29 +00:00
Dmitri Hrybenko
f232267f23 Replace llvm::OwningPtr with std::unique_ptr
It looks like llvm::OwningPtr is going to be removed soon.


Swift SVN r14729
2014-03-06 09:47:17 +00:00
Michael Gottesman
2aa197f636 [deserialization] Expose ModuleFile::error and use the method in SILDeserializer to mark a module as being malformed when invalid SIL is encountered.
Swift SVN r14703
2014-03-06 00:08:35 +00:00
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