@@ -986,6 +986,15 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
986
986
// / Check if this is a declaration defined at the top level of the Swift module
987
987
bool isStdlibDecl () const ;
988
988
989
+ LifetimeAnnotation getLifetimeAnnotation () const {
990
+ auto &attrs = getAttrs ();
991
+ if (attrs.hasAttribute <EagerMoveAttr>())
992
+ return LifetimeAnnotation::EagerMove;
993
+ if (attrs.hasAttribute <LexicalAttr>())
994
+ return LifetimeAnnotation::Lexical;
995
+ return LifetimeAnnotation::None;
996
+ }
997
+
989
998
bool isNoImplicitCopy () const {
990
999
return getAttrs ().hasAttribute <NoImplicitCopyAttr>();
991
1000
}
@@ -2718,15 +2727,6 @@ class ValueDecl : public Decl {
2718
2727
// / 'func foo(Int) -> () -> Self?'.
2719
2728
GenericParameterReferenceInfo findExistentialSelfReferences (
2720
2729
Type baseTy, bool treatNonResultCovariantSelfAsInvariant) const ;
2721
-
2722
- LifetimeAnnotation getLifetimeAnnotation () const {
2723
- auto &attrs = getAttrs ();
2724
- if (attrs.hasAttribute <EagerMoveAttr>())
2725
- return LifetimeAnnotation::EagerMove;
2726
- if (attrs.hasAttribute <LexicalAttr>())
2727
- return LifetimeAnnotation::Lexical;
2728
- return LifetimeAnnotation::None;
2729
- }
2730
2730
};
2731
2731
2732
2732
// / This is a common base class for declarations which declare a type.
0 commit comments