Skip to content

Commit 87fe5a6

Browse files
committed
[AST] NFC: Introduce ABSTRACT_CONTEXT_DECL macro
This is for decl nodes that are both abstract and are DeclContexts.
1 parent 1d13194 commit 87fe5a6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

include/swift/AST/DeclNodes.def

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@
3838
#define CONTEXT_DECL(Id, Parent) DECL(Id, Parent)
3939
#endif
4040

41+
/// ABSTRACT_CONTEXT_DECL(Id, Parent)
42+
/// Used for abstract Decls that are also DeclContexts.
43+
///
44+
#ifndef ABSTRACT_CONTEXT_DECL
45+
#define ABSTRACT_CONTEXT_DECL(Id, Parent) ABSTRACT_DECL(Id, Parent)
46+
#endif
47+
4148
/// ITERABLE_NONGENERIC_DECL(Id, Parent)
4249
/// Used for Decls that are also IterableDeclContexts and DeclContexts. The
4350
/// default behavior is to do the same as for CONTEXT_DECL. This combination
@@ -145,8 +152,8 @@
145152

146153
ABSTRACT_DECL(Value, Decl)
147154
ABSTRACT_DECL(Type, ValueDecl)
148-
ABSTRACT_DECL(GenericType, TypeDecl)
149-
ABSTRACT_DECL(NominalType, GenericTypeDecl)
155+
ABSTRACT_CONTEXT_DECL(GenericType, TypeDecl)
156+
ABSTRACT_CONTEXT_DECL(NominalType, GenericTypeDecl)
150157
NOMINAL_TYPE_DECL(Enum, NominalTypeDecl)
151158
NOMINAL_TYPE_DECL(Struct, NominalTypeDecl)
152159
NOMINAL_TYPE_DECL(Class, NominalTypeDecl)
@@ -165,7 +172,7 @@ ABSTRACT_DECL(Value, Decl)
165172
VALUE_DECL(Param, VarDecl)
166173
GENERIC_VALUE_DECL(Subscript, AbstractStorageDecl)
167174
DECL_RANGE(AbstractStorage, Var, Subscript)
168-
ABSTRACT_DECL(AbstractFunction, ValueDecl)
175+
ABSTRACT_CONTEXT_DECL(AbstractFunction, ValueDecl)
169176
ABSTRACT_FUNCTION_DECL(Constructor, AbstractFunctionDecl)
170177
ABSTRACT_FUNCTION_DECL(Destructor, AbstractFunctionDecl)
171178
ABSTRACT_FUNCTION_DECL(Func, AbstractFunctionDecl)
@@ -208,6 +215,7 @@ LAST_DECL(MacroExpansion)
208215
#undef ABSTRACT_FUNCTION_DECL
209216
#undef VALUE_DECL
210217
#undef DECL_RANGE
218+
#undef ABSTRACT_CONTEXT_DECL
211219
#undef ABSTRACT_DECL
212220
#undef OPERATOR_DECL
213221
#undef DECL

0 commit comments

Comments
 (0)