Skip to content

Commit cab7cae

Browse files
authored
Merge pull request #6209 from hughbe/api-digestor-warnings
2 parents 140df6b + 0f1ffc8 commit cab7cae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/swift-api-digester/swift-api-digester.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ static StringRef getKeyContent(SDKContext &Ctx, KeyKind Kind) {
233233
#define KEY(NAME) case KeyKind::KK_##NAME: return Ctx.buffer(#NAME);
234234
#include "DigesterEnums.def"
235235
}
236+
237+
llvm_unreachable("Unhandled KeyKind in switch.");
236238
}
237239

238240
// The node kind appearing in the tree that describes the content of the SDK
@@ -278,6 +280,8 @@ static raw_ostream &operator<<(raw_ostream &Out, const DeclKind Value) {
278280
#define DECL(X, PARENT) case DeclKind::X: return Out << #X;
279281
#include "swift/AST/DeclNodes.def"
280282
}
283+
284+
llvm_unreachable("Unhandled DeclKind in switch.");
281285
}
282286

283287
struct SDKNodeInitInfo {
@@ -645,6 +649,8 @@ bool SDKNodeDecl::classof(const SDKNode *N) {
645649
case SDKNodeKind::TypeNameAlias:
646650
return false;
647651
}
652+
653+
llvm_unreachable("Unhandled SDKNodeKind in switch.");
648654
}
649655

650656
void SDKNodeDecl::addDeclAttribute(SDKDeclAttrKind DAKind) {
@@ -939,6 +945,8 @@ bool SDKNode::operator==(const SDKNode &Other) const {
939945
hasSameChildren(Other);
940946
}
941947
}
948+
949+
llvm_unreachable("Unhanlded SDKNodeKind in switch.");
942950
}
943951

944952
// The pretty printer of a tree of SDKNode
@@ -2984,6 +2992,8 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
29842992
case Ownership::Unowned: return Ctx.buffer("unowned");
29852993
case Ownership::Unmanaged: return Ctx.buffer("unowned(unsafe)");
29862994
}
2995+
2996+
llvm_unreachable("Unhandled Ownership in switch.");
29872997
};
29882998
auto *Count = UpdateMap.findUpdateCounterpart(Node)->getAs<SDKNodeDecl>();
29892999
AttrChangedDecls.Diags.emplace_back(Node->getDeclKind(),

0 commit comments

Comments
 (0)