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

@@ -4011,6 +4011,24 @@ llvm::Error DeclDeserializer::deserializeDeclAttributes() {
break;
}
case decls_block::Custom_DECL_ATTR: {
bool isImplicit;
TypeID typeID;
serialization::decls_block::CustomDeclAttrLayout::readRecord(
scratch, isImplicit, typeID);
Expected<Type> deserialized = MF.getTypeChecked(typeID);
if (!deserialized) {
MF.fatal(deserialized.takeError());
break;
}
Attr = CustomAttr::create(ctx, SourceLoc(),
TypeLoc::withoutLoc(deserialized.get()),
isImplicit);
break;
}
#define SIMPLE_DECL_ATTR(NAME, CLASS, ...) \
case decls_block::CLASS##_DECL_ATTR: { \
bool isImplicit; \