Abolish the old attribute syntax for type attributes (and SIL type attrs)

- Change type attribute printing logic (in astprinter and the demangler) 
  to print in the new syntax
- Change the swift parser to only accept type attributes in the new syntax.
- Update canParseTypeTupleBody to lookahead over new-syntax type attributes.
- Update the testsuite to use the new syntax.



Swift SVN r9273
This commit is contained in:
Chris Lattner
2013-10-13 05:39:46 +00:00
parent 704126b62b
commit a476f65471
30 changed files with 782 additions and 835 deletions

View File

@@ -484,7 +484,7 @@ public:
DeclAttributes &Attributes,
PatternBindingDecl *PBD = nullptr);
bool parseAttributeList(DeclAttributes &Attributes, bool OldStyle) {
bool parseAttributeList(DeclAttributes &Attributes, bool OldStyle = false) {
if (OldStyle) {
if (Tok.is(tok::l_square))
return parseAttributeListPresent(Attributes, OldStyle);
@@ -497,18 +497,13 @@ public:
bool parseAttributeListPresent(DeclAttributes &Attributes, bool OldStyle);
bool parseAttribute(DeclAttributes &Attributes, bool OldStyle);
bool parseTypeAttributeList(TypeAttributes &Attributes, bool OldStyle) {
if (OldStyle) {
if (Tok.is(tok::l_square))
return parseTypeAttributeListPresent(Attributes, OldStyle);
} else {
if (Tok.is(tok::at_sign))
return parseTypeAttributeListPresent(Attributes, OldStyle);
}
bool parseTypeAttributeList(TypeAttributes &Attributes) {
if (Tok.is(tok::at_sign))
return parseTypeAttributeListPresent(Attributes);
return false;
}
bool parseTypeAttributeListPresent(TypeAttributes &Attributes, bool OldStyle);
bool parseTypeAttribute(TypeAttributes &Attributes, bool OldStyle);
bool parseTypeAttributeListPresent(TypeAttributes &Attributes);
bool parseTypeAttribute(TypeAttributes &Attributes);
ParserResult<ImportDecl> parseDeclImport(unsigned Flags,