Skip to content

Commit 6296a0e

Browse files
committed
[Serialization] Make sure we handle all decl kinds
...well, at least a little more than before. This /still/ isn't as strong as the switch that used to be here because a subtype of an existing Decl or Type won't show up, but that's probably still worth the maintainability (and backtrace) tradeoff.
1 parent dc1653f commit 6296a0e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/Serialization/Serialization.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,9 +2848,8 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
28482848
DeclVisitor<DeclSerializer>::visit(const_cast<Decl *>(D));
28492849
}
28502850

2851-
void visitDecl(const Decl *) {
2852-
llvm_unreachable("I guess we forgot a Decl kind?");
2853-
}
2851+
/// If this gets referenced, we forgot to handle a decl.
2852+
void visitDecl(const Decl *) = delete;
28542853

28552854
void visitExtensionDecl(const ExtensionDecl *extension) {
28562855
using namespace decls_block;

0 commit comments

Comments
 (0)