Skip to content

Commit b12370a

Browse files
authored
Merge pull request #71342 from rintaro/ast-attrkind
2 parents 588bc04 + 1192c96 commit b12370a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1173
-1119
lines changed

include/swift/APIDigester/ModuleAnalyzerNodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class SDKNodeDecl: public SDKNode {
394394
bool isImplicit() const { return IsImplicit; };
395395
bool isStatic() const { return IsStatic; };
396396
bool isOverriding() const { return IsOverriding; };
397-
bool isOptional() const { return hasDeclAttribute(DeclAttrKind::DAK_Optional); }
397+
bool isOptional() const { return hasDeclAttribute(DeclAttrKind::Optional); }
398398
bool isOpen() const { return IsOpen; }
399399
bool isInternal() const { return IsInternal; }
400400
bool isABIPlaceholder() const { return IsABIPlaceholder; }
@@ -492,7 +492,7 @@ class SDKNodeTypeNominal : public SDKNodeType {
492492
class SDKNodeTypeFunc : public SDKNodeType {
493493
public:
494494
SDKNodeTypeFunc(SDKNodeInitInfo Info);
495-
bool isEscaping() const { return hasTypeAttribute(TypeAttrKind::TAK_noescape); }
495+
bool isEscaping() const { return hasTypeAttribute(TypeAttrKind::NoEscape); }
496496
static bool classof(const SDKNode *N);
497497
void diagnose(SDKNode *Right) override;
498498
};

include/swift/AST/ASTBridging.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ namespace swift {
287287
SWIFT_NAME("getter:Bridged" #CLASS "Attr.asDeclAttribute(self:)") \
288288
BridgedDeclAttribute Bridged##CLASS##Attr_asDeclAttribute( \
289289
Bridged##CLASS##Attr attr);
290-
#include "swift/AST/Attr.def"
290+
#include "swift/AST/DeclAttr.def"
291291

292292
struct BridgedPatternBindingEntry {
293293
BridgedPattern pattern;
@@ -423,7 +423,7 @@ BridgedDeclContext BridgedPatternBindingInitializer_asDeclContext(
423423

424424
enum ENUM_EXTENSIBILITY_ATTR(closed) BridgedDeclAttrKind {
425425
#define DECL_ATTR(_, CLASS, ...) BridgedDeclAttrKind##CLASS,
426-
#include "swift/AST/Attr.def"
426+
#include "swift/AST/DeclAttr.def"
427427
BridgedDeclAttrKindNone,
428428
};
429429

@@ -1440,9 +1440,9 @@ void BridgedStmt_dump(BridgedStmt statement);
14401440

14411441
// Bridged type attribute kinds, which mirror TypeAttrKind exactly.
14421442
enum ENUM_EXTENSIBILITY_ATTR(closed) BridgedTypeAttrKind {
1443-
#define TYPE_ATTR(SPELLING, _) BridgedTypeAttrKind_##SPELLING,
1444-
#include "swift/AST/Attr.def"
1445-
BridgedTypeAttrKind_None,
1443+
#define TYPE_ATTR(_, CLASS) BridgedTypeAttrKind##CLASS,
1444+
#include "swift/AST/TypeAttr.def"
1445+
BridgedTypeAttrKindNone,
14461446
};
14471447

14481448
SWIFT_NAME("BridgedTypeAttrKind.init(from:)")

include/swift/AST/ASTBridgingWrappers.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
#include "swift/AST/PatternNodes.def"
6262

6363
#ifndef DECL_ATTR
64-
#define SIMPLE_DECL_ATTR(X, CLASS, OPTIONS, CODE)
64+
#define SIMPLE_DECL_ATTR(...)
6565
#define DECL_ATTR(_, Id, ...) AST_BRIDGING_WRAPPER_NONNULL(Id##Attr)
6666
#endif
67-
#include "swift/AST/Attr.def"
67+
#include "swift/AST/DeclAttr.def"
6868

6969
// Some of the base classes need to be nullable to allow them to be used as
7070
// optional parameters.

include/swift/AST/ASTVisitor.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,11 @@ class ASTVisitor {
137137

138138
AttributeRetTy visit(DeclAttribute *A, Args... AA) {
139139
switch (A->getKind()) {
140-
#define DECL_ATTR(_, CLASS, ...) \
141-
case DAK_##CLASS: \
142-
return static_cast<ImplClass*>(this) \
143-
->visit##CLASS##Attr(static_cast<CLASS##Attr*>(A), \
144-
::std::forward<Args>(AA)...);
145-
#include "swift/AST/Attr.def"
146-
147-
case DAK_Count:
148-
llvm_unreachable("Not an attribute kind");
140+
#define DECL_ATTR(_, CLASS, ...) \
141+
case DeclAttrKind::CLASS: \
142+
return static_cast<ImplClass *>(this)->visit##CLASS##Attr( \
143+
static_cast<CLASS##Attr *>(A), ::std::forward<Args>(AA)...);
144+
#include "swift/AST/DeclAttr.def"
149145
}
150146
}
151147

@@ -154,7 +150,7 @@ class ASTVisitor {
154150
return static_cast<ImplClass*>(this)->visitDeclAttribute( \
155151
A, ::std::forward<Args>(AA)...); \
156152
}
157-
#include "swift/AST/Attr.def"
153+
#include "swift/AST/DeclAttr.def"
158154

159155
bool visit(ParameterList *PL) {
160156
return static_cast<ImplClass*>(this)->visitParameterList(PL);

0 commit comments

Comments
 (0)