[serialization] Add support for [conversion] methods.

Take advantage of the fact that a function can never be both a conversion
method and an assignment operator to pack both flags into the same bit in
the serialized record.

Swift SVN r6185
This commit is contained in:
Jordan Rose
2013-07-11 23:35:12 +00:00
parent 02c609854c
commit d1163afb4b
3 changed files with 12 additions and 6 deletions

View File

@@ -1016,6 +1016,7 @@ bool Serializer::writeDecl(const Decl *D) {
attrs.ExplicitPostfix = false;
attrs.ExplicitInfix = false;
attrs.Assignment = false;
attrs.Conversion = false;
// FIXME: Handle other attributes.
if (!attrs.empty())
@@ -1029,7 +1030,8 @@ bool Serializer::writeDecl(const Decl *D) {
addDeclRef(DC),
fn->isImplicit(),
fn->isStatic(),
fn->getAttrs().isAssignment(),
fn->getAttrs().isAssignment() ||
fn->getAttrs().isConversion(),
addTypeRef(fn->getType()),
addDeclRef(fn->getOperatorDecl()),
addDeclRef(fn->getOverriddenDecl()));