[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:
Holly Borla
2020-02-11 16:18:24 -08:00
parent ff9d3ef073
commit ffba71b889
10 changed files with 86 additions and 0 deletions

View File

@@ -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: