Parse unknown attributes as "custom" attributes.

Parse custom attributes with the grammar:

```
'@' type-identifier expr-paren?
```
This commit is contained in:
Doug Gregor
2019-03-28 21:59:09 -07:00
parent 7cf4c6b1a7
commit a848d12665
19 changed files with 535 additions and 120 deletions

View File

@@ -2407,6 +2407,15 @@ void Serializer::writeDeclAttribute(const DeclAttribute *DA) {
addDeclRef(theAttr->getReplacedFunction()), pieces.size(), pieces);
return;
}
case DAK_Custom: {
auto abbrCode = DeclTypeAbbrCodes[CustomDeclAttrLayout::Code];
auto theAttr = cast<CustomAttr>(DA);
CustomDeclAttrLayout::emitRecord(
Out, ScratchRecord, abbrCode, theAttr->isImplicit(),
addTypeRef(theAttr->getTypeLoc().getType()));
return;
}
}
}