diff options
author | David Blaikie <dblaikie@gmail.com> | 2011-09-23 05:06:16 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2011-09-23 05:06:16 +0000 |
commit | 83d382b1cad133cb163a68dd7149fae2802275e1 (patch) | |
tree | 20f63870b2fa8c4a5b49076275bc8b60224f0edc /clang/lib/StaticAnalyzer/Core | |
parent | 42fe6bd5f230d4c88377e24ace7a226c178dd2b4 (diff) | |
download | bcm5719-llvm-83d382b1cad133cb163a68dd7149fae2802275e1.tar.gz bcm5719-llvm-83d382b1cad133cb163a68dd7149fae2802275e1.zip |
Switch assert(0/false) llvm_unreachable.
llvm-svn: 140367
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/AggExprVisitor.cpp | 2 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 2 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/CoreEngine.cpp | 4 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 2 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | 8 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 4 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/SVals.cpp | 4 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp | 4 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | 16 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/Store.cpp | 6 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/SymbolManager.cpp | 2 |
11 files changed, 27 insertions, 27 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AggExprVisitor.cpp b/clang/lib/StaticAnalyzer/Core/AggExprVisitor.cpp index 901190d901d..0936d61784a 100644 --- a/clang/lib/StaticAnalyzer/Core/AggExprVisitor.cpp +++ b/clang/lib/StaticAnalyzer/Core/AggExprVisitor.cpp @@ -46,7 +46,7 @@ public: void AggExprVisitor::VisitCastExpr(CastExpr *E) { switch (E->getCastKind()) { default: - assert(0 && "Unhandled cast kind"); + llvm_unreachable("Unhandled cast kind"); case CK_NoOp: case CK_ConstructorConversion: case CK_UserDefinedConversion: diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 3936d561c57..b87c9eba185 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1742,7 +1742,7 @@ FindReportInEquivalenceClass(BugReportEquivClass& EQ, if (!errorNode) continue; if (errorNode->isSink()) { - assert(false && + llvm_unreachable( "BugType::isSuppressSink() should not be 'true' for sink end nodes"); return 0; } diff --git a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp index 06c3af1c0ae..6a860428d64 100644 --- a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp @@ -326,7 +326,7 @@ void CoreEngine::HandleBlockExit(const CFGBlock * B, ExplodedNode *Pred) { if (const Stmt *Term = B->getTerminator()) { switch (Term->getStmtClass()) { default: - assert(false && "Analysis for this terminator not implemented."); + llvm_unreachable("Analysis for this terminator not implemented."); break; case Stmt::BinaryOperatorClass: // '&&' and '||' @@ -547,7 +547,7 @@ static ProgramPoint GetProgramPoint(const Stmt *S, ProgramPoint::Kind K, const ProgramPointTag *tag){ switch (K) { default: - assert(false && "Unhandled ProgramPoint kind"); + llvm_unreachable("Unhandled ProgramPoint kind"); case ProgramPoint::PreStmtKind: return PreStmt(S, LC, tag); case ProgramPoint::PostStmtKind: diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 37362d37cb6..5e38f2f244a 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -1030,7 +1030,7 @@ void ExprEngine::processIndirectGoto(IndirectGotoNodeBuilder &builder) { } } - assert(false && "No block with label."); + llvm_unreachable("No block with label."); return; } diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp index 0daa252ecce..955684f92de 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -74,7 +74,7 @@ void ExprEngine::VisitBinaryOperator(const BinaryOperator* B, switch (Op) { default: - assert(0 && "Invalid opcode for compound assignment."); + llvm_unreachable("Invalid opcode for compound assignment."); case BO_MulAssign: Op = BO_Mul; break; case BO_DivAssign: Op = BO_Div; break; case BO_RemAssign: Op = BO_Rem; break; @@ -203,9 +203,9 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, switch (CastE->getCastKind()) { case CK_LValueToRValue: - assert(false && "LValueToRValue casts handled earlier."); + llvm_unreachable("LValueToRValue casts handled earlier."); case CK_GetObjCProperty: - assert(false && "GetObjCProperty casts handled earlier."); + llvm_unreachable("GetObjCProperty casts handled earlier."); case CK_ToVoid: Dst.Add(Pred); continue; @@ -625,7 +625,7 @@ void ExprEngine::VisitUnaryOperator(const UnaryOperator* U, switch (U->getOpcode()) { default: - assert(false && "Invalid Opcode."); + llvm_unreachable("Invalid Opcode."); break; case UO_Not: diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp index 04c274d319e..18fbf831ec9 100644 --- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -891,7 +891,7 @@ SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) { } if (isa<CodeTextRegion>(MR)) { - assert(0 && "Why load from a code text region?"); + llvm_unreachable("Why load from a code text region?"); return UnknownVal(); } @@ -1130,7 +1130,7 @@ RegionStoreManager::RetrieveDerivedDefaultValue(RegionBindings B, if (isa<nonloc::LazyCompoundVal>(val)) return Optional<SVal>(); - assert(0 && "Unknown default value"); + llvm_unreachable("Unknown default value"); } return Optional<SVal>(); diff --git a/clang/lib/StaticAnalyzer/Core/SVals.cpp b/clang/lib/StaticAnalyzer/Core/SVals.cpp index 8eb65baa89f..e32a3b0f539 100644 --- a/clang/lib/StaticAnalyzer/Core/SVals.cpp +++ b/clang/lib/StaticAnalyzer/Core/SVals.cpp @@ -171,7 +171,7 @@ void SVal::symbol_iterator::expand() { return; } - assert(false && "unhandled expansion case"); + llvm_unreachable("unhandled expansion case"); } const void *nonloc::LazyCompoundVal::getStore() const { @@ -369,7 +369,7 @@ void Loc::dumpToStream(raw_ostream &os) const { break; } default: - assert(false && "Pretty-printing not implemented for this Loc."); + llvm_unreachable("Pretty-printing not implemented for this Loc."); break; } } diff --git a/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp b/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp index 73b4d78ebaa..79d8b8bf9de 100644 --- a/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp +++ b/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp @@ -125,7 +125,7 @@ static BinaryOperator::Opcode NegateComparison(BinaryOperator::Opcode op) { // the only place it's used. (This code was copied from SimpleSValBuilder.cpp.) switch (op) { default: - assert(false && "Invalid opcode."); + llvm_unreachable("Invalid opcode."); case BO_LT: return BO_GE; case BO_GT: return BO_LE; case BO_LE: return BO_GT; @@ -152,7 +152,7 @@ const ProgramState *SimpleConstraintManager::assumeAux(const ProgramState *state switch (Cond.getSubKind()) { default: - assert(false && "'Assume' not implemented for this NonLoc"); + llvm_unreachable("'Assume' not implemented for this NonLoc"); case nonloc::SymbolValKind: { nonloc::SymbolVal& SV = cast<nonloc::SymbolVal>(Cond); diff --git a/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp index 787aa055e67..830d70e888b 100644 --- a/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp +++ b/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp @@ -171,7 +171,7 @@ SVal SimpleSValBuilder::evalComplement(NonLoc X) { static BinaryOperator::Opcode NegateComparison(BinaryOperator::Opcode op) { switch (op) { default: - assert(false && "Invalid opcode."); + llvm_unreachable("Invalid opcode."); case BO_LT: return BO_GE; case BO_GT: return BO_LE; case BO_LE: return BO_GT; @@ -184,7 +184,7 @@ static BinaryOperator::Opcode NegateComparison(BinaryOperator::Opcode op) { static BinaryOperator::Opcode ReverseComparison(BinaryOperator::Opcode op) { switch (op) { default: - assert(false && "Invalid opcode."); + llvm_unreachable("Invalid opcode."); case BO_LT: return BO_GT; case BO_GT: return BO_LT; case BO_LE: return BO_GE; @@ -347,7 +347,7 @@ SVal SimpleSValBuilder::evalBinOpNN(const ProgramState *state, break; case BO_LAnd: case BO_LOr: - assert(false && "Logical operators handled by branching logic."); + llvm_unreachable("Logical operators handled by branching logic."); return UnknownVal(); case BO_Assign: case BO_MulAssign: @@ -361,11 +361,11 @@ SVal SimpleSValBuilder::evalBinOpNN(const ProgramState *state, case BO_XorAssign: case BO_OrAssign: case BO_Comma: - assert(false && "'=' and ',' operators handled by ExprEngine."); + llvm_unreachable("'=' and ',' operators handled by ExprEngine."); return UnknownVal(); case BO_PtrMemD: case BO_PtrMemI: - assert(false && "Pointer arithmetic not handled here."); + llvm_unreachable("Pointer arithmetic not handled here."); return UnknownVal(); case BO_LT: case BO_GT: @@ -556,7 +556,7 @@ SVal SimpleSValBuilder::evalBinOpLL(const ProgramState *state, if (lhs == rhs) { switch (op) { default: - assert(false && "Unimplemented operation for two identical values"); + llvm_unreachable("Unimplemented operation for two identical values"); return UnknownVal(); case BO_Sub: return makeZeroVal(resultTy); @@ -573,7 +573,7 @@ SVal SimpleSValBuilder::evalBinOpLL(const ProgramState *state, switch (lhs.getSubKind()) { default: - assert(false && "Ordering not implemented for this Loc."); + llvm_unreachable("Ordering not implemented for this Loc."); return UnknownVal(); case loc::GotoLabelKind: @@ -827,7 +827,7 @@ SVal SimpleSValBuilder::evalBinOpLL(const ProgramState *state, return makeTruthVal(!leftFirst, resultTy); } - assert(false && "Fields not found in parent record's definition"); + llvm_unreachable("Fields not found in parent record's definition"); } // If we get here, we have no way of comparing the regions. diff --git a/clang/lib/StaticAnalyzer/Core/Store.cpp b/clang/lib/StaticAnalyzer/Core/Store.cpp index 127d583b229..63550d47f13 100644 --- a/clang/lib/StaticAnalyzer/Core/Store.cpp +++ b/clang/lib/StaticAnalyzer/Core/Store.cpp @@ -103,7 +103,7 @@ const MemRegion *StoreManager::castRegion(const MemRegion *R, QualType CastToTy) case MemRegion::UnknownSpaceRegionKind: case MemRegion::NonStaticGlobalSpaceRegionKind: case MemRegion::StaticGlobalSpaceRegionKind: { - assert(0 && "Invalid region cast"); + llvm_unreachable("Invalid region cast"); break; } @@ -203,7 +203,7 @@ const MemRegion *StoreManager::castRegion(const MemRegion *R, QualType CastToTy) } } - assert(0 && "unreachable"); + llvm_unreachable("unreachable"); return 0; } @@ -261,7 +261,7 @@ SVal StoreManager::getLValueFieldOrIvar(const Decl *D, SVal Base) { return Base; default: - assert(0 && "Unhandled Base."); + llvm_unreachable("Unhandled Base."); return Base; } diff --git a/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp b/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp index 255b9149855..32ad5819de2 100644 --- a/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp +++ b/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp @@ -28,7 +28,7 @@ void SymExpr::dump() const { static void print(raw_ostream &os, BinaryOperator::Opcode Op) { switch (Op) { default: - assert(false && "operator printing not implemented"); + llvm_unreachable("operator printing not implemented"); break; case BO_Mul: os << '*' ; break; case BO_Div: os << '/' ; break; |