mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Parse unknown attributes as "custom" attributes.
Parse custom attributes with the grammar: ``` '@' type-identifier expr-paren? ```
This commit is contained in:
@@ -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; \
|
||||
|
||||
Reference in New Issue
Block a user