diff options
117 files changed, 342 insertions, 336 deletions
diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h index 2f0eafa5c1..67975e4f9c 100644 --- a/include/clang/AST/Attr.h +++ b/include/clang/AST/Attr.h @@ -66,11 +66,11 @@ protected: virtual ~Attr(); void* operator new(size_t bytes) throw() { - assert(0 && "Attrs cannot be allocated with regular 'new'."); + llvm_unreachable("Attrs cannot be allocated with regular 'new'."); return 0; } void operator delete(void* data) throw() { - assert(0 && "Attrs cannot be released with regular 'delete'."); + llvm_unreachable("Attrs cannot be released with regular 'delete'."); } public: diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h index 04c6674426..138e47d1a9 100644 --- a/include/clang/AST/DeclTemplate.h +++ b/include/clang/AST/DeclTemplate.h @@ -908,7 +908,7 @@ protected: // FIXME: This should probably never be called, but it's here as TemplateParmPosition() : Depth(0), Position(0) - { /* assert(0 && "Cannot create positionless template parameter"); */ } + { /* llvm_unreachable("Cannot create positionless template parameter"); */ } TemplateParmPosition(unsigned D, unsigned P) : Depth(D), Position(P) diff --git a/include/clang/AST/DeclVisitor.h b/include/clang/AST/DeclVisitor.h index aee1998028..b5b6bd42dd 100644 --- a/include/clang/AST/DeclVisitor.h +++ b/include/clang/AST/DeclVisitor.h @@ -30,7 +30,7 @@ class DeclVisitor { public: RetTy Visit(Decl *D) { switch (D->getKind()) { - default: assert(false && "Decl that isn't part of DeclNodes.inc!"); + default: llvm_unreachable("Decl that isn't part of DeclNodes.inc!"); #define DECL(DERIVED, BASE) \ case Decl::DERIVED: DISPATCH(DERIVED##Decl, DERIVED##Decl); #define ABSTRACT_DECL(DECL) diff --git a/include/clang/AST/Mangle.h b/include/clang/AST/Mangle.h index d40e101b2b..fcb7ebdba5 100644 --- a/include/clang/AST/Mangle.h +++ b/include/clang/AST/Mangle.h @@ -135,7 +135,7 @@ public: // This is pretty lame. virtual void mangleItaniumGuardVariable(const VarDecl *D, raw_ostream &) { - assert(0 && "Target does not support mangling guard variables"); + llvm_unreachable("Target does not support mangling guard variables"); } /// @} }; diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index f4c8bae7d1..36add6c457 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -1322,7 +1322,7 @@ bool RecursiveASTVisitor<Derived>::TraverseFunctionInstantiations( case TSK_ExplicitSpecialization: break; default: - assert(false && "Unknown specialization kind."); + llvm_unreachable("Unknown specialization kind."); } } diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 34b8a12f40..c186b4896e 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -107,11 +107,11 @@ public: // Make vanilla 'new' and 'delete' illegal for Stmts. protected: void* operator new(size_t bytes) throw() { - assert(0 && "Stmts cannot be allocated with regular 'new'."); + llvm_unreachable("Stmts cannot be allocated with regular 'new'."); return 0; } void operator delete(void* data) throw() { - assert(0 && "Stmts cannot be released with regular 'delete'."); + llvm_unreachable("Stmts cannot be released with regular 'delete'."); } class StmtBitfields { diff --git a/include/clang/AST/StmtVisitor.h b/include/clang/AST/StmtVisitor.h index 29d2347546..48a0123608 100644 --- a/include/clang/AST/StmtVisitor.h +++ b/include/clang/AST/StmtVisitor.h @@ -42,7 +42,7 @@ public: // below. if (PTR(BinaryOperator) BinOp = dyn_cast<BinaryOperator>(S)) { switch (BinOp->getOpcode()) { - default: assert(0 && "Unknown binary operator!"); + default: llvm_unreachable("Unknown binary operator!"); case BO_PtrMemD: DISPATCH(BinPtrMemD, BinaryOperator); case BO_PtrMemI: DISPATCH(BinPtrMemI, BinaryOperator); case BO_Mul: DISPATCH(BinMul, BinaryOperator); @@ -80,7 +80,7 @@ public: } } else if (PTR(UnaryOperator) UnOp = dyn_cast<UnaryOperator>(S)) { switch (UnOp->getOpcode()) { - default: assert(0 && "Unknown unary operator!"); + default: llvm_unreachable("Unknown unary operator!"); case UO_PostInc: DISPATCH(UnaryPostInc, UnaryOperator); case UO_PostDec: DISPATCH(UnaryPostDec, UnaryOperator); case UO_PreInc: DISPATCH(UnaryPreInc, UnaryOperator); @@ -99,7 +99,7 @@ public: // Top switch stmt: dispatch to VisitFooStmt for each FooStmt. switch (S->getStmtClass()) { - default: assert(0 && "Unknown stmt kind!"); + default: llvm_unreachable("Unknown stmt kind!"); |