mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Parse] Add an attribute for typeEraser.
This will be used for compiler-driven type erasure for dynamic replacement of functions with an opaque return type. For now, just parse the attribute and ignore it.
This commit is contained in:
@@ -1108,6 +1108,21 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// The \c @_typeEraser(TypeEraserType) attribute.
|
||||
class TypeEraserAttr final : public DeclAttribute {
|
||||
TypeLoc TypeEraserLoc;
|
||||
public:
|
||||
TypeEraserAttr(SourceLoc atLoc, SourceRange range, TypeLoc typeEraserLoc)
|
||||
: DeclAttribute(DAK_TypeEraser, atLoc, range, /*Implicit=*/false),
|
||||
TypeEraserLoc(typeEraserLoc) {}
|
||||
|
||||
const TypeLoc &getTypeEraserLoc() const { return TypeEraserLoc; }
|
||||
|
||||
static bool classof(const DeclAttribute *DA) {
|
||||
return DA->getKind() == DAK_TypeEraser;
|
||||
}
|
||||
};
|
||||
|
||||
/// Represents any sort of access control modifier.
|
||||
class AbstractAccessControlAttr : public DeclAttribute {
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user