This is basically modeled off of Clang's ASTWriter: write out all decls
and types en masse, then write out a list of offsets for quick access later,
and use the indexes into the offset lists as module-unique IDs for the decls
and types.
No decls or types are actually being serialized yet, and I haven't done
any of the work necessary for multi-module support (which would assume
offsets don't start at 0). There's also no reader support yet.
Swift SVN r5237
The writer stores the paths to the .swift files, the reader just loads
those .swift files. Fun!
No version validation yet. No separate ModuleReader class yet. No use of
the SerializedModule architecture yet, except for creating a dummy module
when the .sm file is corrupted.
Swift SVN r5164
Based on feedback by Doug. This signature is fairly arbitrary: it's the
UTF-8 encoding of U+2828 SPARKLES, followed by the number 14 to represent
2014. (Hopefully the format will have stabilized by 2014.)
(Why not 0x00 or 0x01 for the last byte? Because it's more likely we'll
collide with someone else being cute. Why not 0x0D / 13? Because that's
\r and could conceivably appear in real Unicode text. No one uses 0x0E
these days.)
Swift SVN r5134