[serialization] Handle fixity and assignment function attributes.

With this change we should be able to round-trip all of Policy.swift.

Swift SVN r6085
This commit is contained in:
Jordan Rose
2013-07-09 00:45:05 +00:00
parent aa230234eb
commit fdd5b36dfc
3 changed files with 25 additions and 5 deletions

View File

@@ -941,8 +941,15 @@ bool Serializer::writeDecl(const Decl *D) {
case DeclKind::Func: {
auto fn = cast<FuncDecl>(D);
// FIXME: Handle attributes.
if (!fn->getAttrs().empty())
DeclAttributes attrs = fn->getAttrs();
// FIXME: We need some representation of these for source fidelity.
attrs.ExplicitPrefix = false;
attrs.ExplicitPostfix = false;
attrs.ExplicitInfix = false;
attrs.Assignment = false;
// FIXME: Handle other attributes.
if (!attrs.empty())
return false;
const Decl *DC = getDeclForContext(fn->getDeclContext());
@@ -956,6 +963,7 @@ bool Serializer::writeDecl(const Decl *D) {
addDeclRef(DC),
fn->isImplicit(),
fn->isStatic(),
fn->getAttrs().isAssignment(),
addTypeRef(fn->getType()),
addDeclRef(associated),
addDeclRef(fn->getOverriddenDecl()));