Switch assert(0/false) llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp
index f83f709..4d92e31 100644
--- a/lib/Serialization/ASTReader.cpp
+++ b/lib/Serialization/ASTReader.cpp
@@ -4993,7 +4993,7 @@
}
}
- assert(0 && "Unhandled template name kind!");
+ llvm_unreachable("Unhandled template name kind!");
return TemplateName();
}
@@ -5033,7 +5033,7 @@
}
}
- assert(0 && "Unhandled template argument kind!");
+ llvm_unreachable("Unhandled template argument kind!");
return TemplateArgument();
}
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index 01b635e..38f5f49 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -345,7 +345,7 @@
ReadDeclarationNameLoc(FD->DNLoc, FD->getDeclName(), Record, Idx);
FD->IdentifierNamespace = Record[Idx++];
switch ((FunctionDecl::TemplatedKind)Record[Idx++]) {
- default: assert(false && "Unhandled TemplatedKind!");
+ default: llvm_unreachable("Unhandled TemplatedKind!");
break;
case FunctionDecl::TK_NonTemplate:
break;
@@ -955,7 +955,7 @@
};
switch ((CXXRecKind)Record[Idx++]) {
default:
- assert(false && "Out of sync with ASTDeclWriter::VisitCXXRecordDecl?");
+ llvm_unreachable("Out of sync with ASTDeclWriter::VisitCXXRecordDecl?");
case CXXRecNotTemplate:
break;
case CXXRecTemplate:
@@ -1306,8 +1306,8 @@
RedeclKind Kind = (RedeclKind)Record[Idx++];
switch (Kind) {
default:
- assert(0 && "Out of sync with ASTDeclWriter::VisitRedeclarable or messed up"
- " reading");
+ llvm_unreachable("Out of sync with ASTDeclWriter::VisitRedeclarable or"
+ " messed up reading");
case NoRedeclaration:
break;
case PointsToPrevious: {
@@ -1480,7 +1480,7 @@
switch ((DeclCode)DeclsCursor.ReadRecord(Code, Record)) {
case DECL_CONTEXT_LEXICAL:
case DECL_CONTEXT_VISIBLE:
- assert(false && "Record cannot be de-serialized with ReadDeclRecord");
+ llvm_unreachable("Record cannot be de-serialized with ReadDeclRecord");
break;
case DECL_TYPEDEF:
D = TypedefDecl::Create(Context, 0, SourceLocation(), SourceLocation(),
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index 3286a17..494f4aa 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -91,7 +91,7 @@
}
void ASTTypeWriter::VisitBuiltinType(const BuiltinType *T) {
- assert(false && "Built-in types are never serialized");
+ llvm_unreachable("Built-in types are never serialized");
}
void ASTTypeWriter::VisitComplexType(const ComplexType *T) {
@@ -305,7 +305,7 @@
ASTTypeWriter::VisitDependentSizedExtVectorType(
const DependentSizedExtVectorType *T) {
// FIXME: Serialize this type (C++ only)
- assert(false && "Cannot serialize dependent sized extended vector types");
+ llvm_unreachable("Cannot serialize dependent sized extended vector types");
}
void
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp
index a7468a7..5a5963c 100644
--- a/lib/Serialization/ASTWriterDecl.cpp
+++ b/lib/Serialization/ASTWriterDecl.cpp
@@ -295,7 +295,7 @@
Record.push_back(D->getIdentifierNamespace());
Record.push_back(D->getTemplatedKind());
switch (D->getTemplatedKind()) {
- default: assert(false && "Unhandled TemplatedKind!");
+ default: llvm_unreachable("Unhandled TemplatedKind!");
break;
case FunctionDecl::TK_NonTemplate:
break;
diff --git a/lib/Serialization/ASTWriterStmt.cpp b/lib/Serialization/ASTWriterStmt.cpp
index 5f1e4de..a8c02a5 100644
--- a/lib/Serialization/ASTWriterStmt.cpp
+++ b/lib/Serialization/ASTWriterStmt.cpp
@@ -1440,7 +1440,7 @@
SourceManager &SrcMgr
= DeclIDs.begin()->first->getASTContext().getSourceManager();
S->dump(SrcMgr);
- assert(0 && "Unhandled sub statement writing AST file");
+ llvm_unreachable("Unhandled sub statement writing AST file");
}
#endif