Add command line argument -sil-link-all and -sil-serialize-all for testing
purpose.
Do not create new SILFunction for de-serialized SIL, instead update the
existing declaration with the de-serialized SILFunction.
Add testing case to cover partial_apply.
Swift SVN r8410
Add serialization/deserialization of the following SILInstructions:
BuiltinFunctionRefInst, IndexRawPointerInst, ModuleInst,
Conversion instructions:
RefToObjectPointerInst, UpcastInst, CoerceInst, AddressToPointerInst,
PointerToAddressInst, ObjectPointerToRefInst, RefToRawPointerInst,
RawPointerToRefInst, RefToUnownedInst, UnownedToRefInst
DestroyAddrInst, LoadInst, StrongReleaseInst, StrongRetainInst,
TupleElementAddrInst, TupleExtractInst
Make getModule in ModuleFile public to be used by SILDeserializer, also
make addModuleRef in Serializer public to be used by SILSerializer.
Update testing case to cover the above SILInstructions.
Swift SVN r8372
Use a worklist in SIL linking to traverse the newly serialized SILFunction.
Add serialization/deserialization of the following SILInstructions:
AllocArray, Apply, FunctionRef, IntegerLiteral, Metatype, StructExtract,
Struct and Tuple.
Make getDecl and getIdentifier in ModuleFile public to be used by
SILDeserializer, also make addDeclRef and addIdentifierRef in Serializer
public to be used by SILSerializer.
Update testing case to cover the above SILInstructions.
TODO: lookupSILFunction should replace the existing empty SILFunction instead
of creating a new SILFunction.
Swift SVN r8339
Add implementation to deserialize SILBasicBlock and some SILInstructins.
Add handling of local SIL values.
Add serialization of SILType category and SILValue result number.
Swift SVN r8292
For PolymorphicFunctionType used in a SILFunction, we don't have a
corresponding Decl to share the parameter list with. In that case,
we set the owning Decl ID to 0 and add a trailing param lists.
We add a helper function to find the TypeAliasDecl for a Builtin type.
If the lookup is expensive, we can cache the lookup.
Deserializing SILBasicBlock and SILInstruction is not implemented yet.
SIL serializer and deserializer are implicitly tested when a module
contains transparant SILFunctions.
Swift SVN r8230
SerializedSILLoader to hold a list of SIL deserializers.
Also add an intial implementation of a linking pass that is run right after
SILGen to link the declaration of SILFunction to the actual definition in
the serialized module.
We add two blocks to the serialized module: a sil index block that
maps identifier to a function ID and also holds a list of function offsets,
and a sil block for the actual SILFunctions. We can probably use subblock
instead of two top-level blocks.
The serialization/de-serialization of the function hash table and the function
offsets are implemented. But we are missing handling of types (see FIXME in
the code).
ModuleFile::Serialized is made public to be used by SIL deserializer, as well
as ModuleFile::getType.
The SIL deserializer holds a pointer to the ModuleFile, it gets the sil cursor
and the sil index cursor from the ModuleFile. The other option is for SIL
deserializer to find the start of the two sil blocks within itself, thus having
less coupling with ModuleFile.
No testing case yet because we are missing handling of types.
Swift SVN r8206
few SIL instructions types.
This will be tested when we have a SIL deserializer. Testing cases covering
each implemented SIL instruction will be added.
Swift SVN r8094
functions should be serialized.
Transparent is added as a 1-bit field. In SILGen, we set SILFunction's
transparent attribute according to the attribute of the ValueDecl.
Swift SVN r7882
Add SerializeSIL.cpp for basic implementation of a SIL serializer.
serialize, serializeToStream, Serializer::writeToStream, and
Serializer::writeTranslationUnit all take an additional SILModule to pass it
to Serializer::writeSILFunctions.
Serializer::writeSILFunctions goes through all SILFunctions in a SILModule, and
serializes all SILFunctions that are transparent.
Swift SVN r7875