From eb2d1f1c88836bd5382e5d7aa8f6b85148a88b27 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 23 Sep 2011 20:26:49 +0000 Subject: [PATCH] Removing a bunch of dead returns/breaks after llvm_unreachables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Attr.h | 1 - include/clang/AST/Stmt.h | 1 - lib/AST/ASTContext.cpp | 7 ------- lib/AST/Decl.cpp | 1 - lib/AST/DeclBase.cpp | 2 -- lib/AST/DeclCXX.cpp | 1 - lib/AST/DeclObjC.cpp | 2 -- lib/AST/DeclPrinter.cpp | 2 +- lib/AST/DeclarationName.cpp | 3 --- lib/AST/Expr.cpp | 2 -- lib/AST/ExprConstant.cpp | 1 - lib/AST/ItaniumMangle.cpp | 3 --- lib/AST/MicrosoftMangle.cpp | 9 --------- lib/AST/TemplateBase.cpp | 2 -- lib/Analysis/FormatString.cpp | 2 -- lib/CodeGen/CGCall.cpp | 1 - lib/CodeGen/CGDebugInfo.cpp | 4 ---- lib/CodeGen/CGExpr.cpp | 1 - lib/CodeGen/CGExprAgg.cpp | 1 - lib/CodeGen/CGExprComplex.cpp | 1 - lib/CodeGen/CGExprConstant.cpp | 4 ---- lib/CodeGen/CGExprScalar.cpp | 4 ---- lib/CodeGen/CGObjCMac.cpp | 1 - lib/CodeGen/CGStmt.cpp | 2 -- lib/CodeGen/CGVTables.cpp | 3 --- lib/CodeGen/CodeGenAction.cpp | 1 - lib/CodeGen/CodeGenTypes.cpp | 1 - lib/CodeGen/TargetInfo.cpp | 1 - lib/Driver/Action.cpp | 1 - lib/Driver/Driver.cpp | 1 - lib/Driver/Option.cpp | 3 --- lib/Driver/Phases.cpp | 1 - lib/Index/ASTLocation.cpp | 1 - lib/Parse/ParseExprCXX.cpp | 4 +--- lib/Sema/SemaCXXScopeSpec.cpp | 1 - lib/Sema/SemaCodeComplete.cpp | 1 - lib/Sema/SemaDecl.cpp | 4 +--- lib/Sema/SemaDeclAttr.cpp | 1 - lib/Sema/SemaDeclCXX.cpp | 1 - lib/Sema/SemaExpr.cpp | 1 - lib/Sema/SemaExprCXX.cpp | 6 ------ lib/Sema/SemaOverload.cpp | 2 -- lib/Sema/SemaStmt.cpp | 1 - lib/Sema/SemaTemplate.cpp | 5 ----- lib/Sema/SemaTemplateDeduction.cpp | 2 -- lib/Sema/SemaTemplateInstantiateDecl.cpp | 3 --- lib/Sema/SemaType.cpp | 2 +- lib/Sema/TreeTransform.h | 3 --- lib/Serialization/ASTReader.cpp | 2 -- lib/Serialization/ASTReaderDecl.cpp | 2 -- lib/Serialization/ASTWriterDecl.cpp | 1 - lib/StaticAnalyzer/Core/BugReporter.cpp | 1 - lib/StaticAnalyzer/Core/CoreEngine.cpp | 1 - lib/StaticAnalyzer/Core/ExprEngine.cpp | 1 - lib/StaticAnalyzer/Core/ExprEngineC.cpp | 1 - lib/StaticAnalyzer/Core/RegionStore.cpp | 1 - lib/StaticAnalyzer/Core/SVals.cpp | 1 - lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | 5 ----- lib/StaticAnalyzer/Core/Store.cpp | 3 --- lib/StaticAnalyzer/Core/SymbolManager.cpp | 1 - tools/libclang/CIndexDiagnostic.cpp | 2 +- 61 files changed, 5 insertions(+), 125 deletions(-) diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h index c5b564d616..cf2e3c5d25 100644 --- a/include/clang/AST/Attr.h +++ b/include/clang/AST/Attr.h @@ -68,7 +68,6 @@ protected: void* operator new(size_t bytes) throw() { llvm_unreachable("Attrs cannot be allocated with regular 'new'."); - return 0; } void operator delete(void* data) throw() { llvm_unreachable("Attrs cannot be released with regular 'delete'."); diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index c186b4896e..3b0edccf02 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -108,7 +108,6 @@ public: protected: void* operator new(size_t bytes) throw() { llvm_unreachable("Stmts cannot be allocated with regular 'new'."); - return 0; } void operator delete(void* data) throw() { llvm_unreachable("Stmts cannot be released with regular 'delete'."); diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index de77cb66cf..5e0143dc00 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3219,7 +3219,6 @@ ASTContext::getCanonicalTemplateArgument(const TemplateArgument &Arg) const { // Silence GCC warning llvm_unreachable("Unhandled template argument kind"); - return TemplateArgument(); } NestedNameSpecifier * @@ -4919,7 +4918,6 @@ CanQualType ASTContext::getFromTargetType(unsigned Type) const { } llvm_unreachable("Unhandled TargetInfo::IntType value"); - return CanQualType(); } //===----------------------------------------------------------------------===// @@ -5749,13 +5747,11 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, #define DEPENDENT_TYPE(Class, Base) case Type::Class: #include "clang/AST/TypeNodes.def" llvm_unreachable("Non-canonical and dependent types shouldn't get here"); - return QualType(); case Type::LValueReference: case Type::RValueReference: case Type::MemberPointer: llvm_unreachable("C++ should never be in mergeTypes"); - return QualType(); case Type::ObjCInterface: case Type::IncompleteArray: @@ -5763,7 +5759,6 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, case Type::FunctionProto: case Type::ExtVector: llvm_unreachable("Types are eliminated above"); - return QualType(); case Type::Pointer: { @@ -6015,7 +6010,6 @@ QualType ASTContext::getCorrespondingUnsignedType(QualType T) { return UnsignedInt128Ty; default: llvm_unreachable("Unexpected signed integer type"); - return QualType(); } } @@ -6476,7 +6470,6 @@ MangleContext *ASTContext::createMangleContext() { return createMicrosoftMangleContext(*this, getDiagnostics()); } llvm_unreachable("Unsupported ABI"); - return 0; } CXXABI::~CXXABI() {} diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 2fdb9654b0..a4608eb81c 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1891,7 +1891,6 @@ FunctionDecl::TemplatedKind FunctionDecl::getTemplatedKind() const { return TK_DependentFunctionTemplateSpecialization; llvm_unreachable("Did we miss a TemplateOrSpecialization type?"); - return TK_NonTemplate; } FunctionDecl *FunctionDecl::getInstantiatedFromMemberFunction() const { diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index d1f8b1c7fd..60fb7025ab 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -572,7 +572,6 @@ Decl *Decl::castFromDeclContext (const DeclContext *D) { return static_cast(const_cast(D)); #include "clang/AST/DeclNodes.inc" llvm_unreachable("a decl that inherits DeclContext isn't handled"); - return 0; } } @@ -592,7 +591,6 @@ DeclContext *Decl::castToDeclContext(const Decl *D) { return static_cast(const_cast(D)); #include "clang/AST/DeclNodes.inc" llvm_unreachable("a decl that inherits DeclContext isn't handled"); - return 0; } } diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index b9af8e3a1f..9addece6f9 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -1694,7 +1694,6 @@ static const char *getAccessName(AccessSpecifier AS) { default: case AS_none: llvm_unreachable("Invalid access specifier!"); - return 0; case AS_public: return "public"; case AS_private: diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 68177de70d..97f215fb7f 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -550,7 +550,6 @@ ObjCInterfaceDecl *ObjCMethodDecl::getClassInterface() { assert(!isa(getDeclContext()) && "It's a protocol method"); llvm_unreachable("unknown method context"); - return 0; } //===----------------------------------------------------------------------===// @@ -782,7 +781,6 @@ const ObjCInterfaceDecl *ObjCIvarDecl::getContainingInterface() const { case ObjCCategoryImpl: case ObjCProtocol: llvm_unreachable("invalid ivar container!"); - return 0; // Ivars can only appear in class extension categories. case ObjCCategory: { diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index a17e14053c..8d8ec2f7d2 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -192,7 +192,7 @@ void DeclPrinter::ProcessDeclGroup(SmallVectorImpl& Decls) { void DeclPrinter::Print(AccessSpecifier AS) { switch(AS) { - case AS_none: llvm_unreachable("No access specifier!"); break; + case AS_none: llvm_unreachable("No access specifier!"); case AS_public: Out << "public"; break; case AS_protected: Out << "protected"; break; case AS_private: Out << "private"; break; diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp index 84d4ca94c3..8dfca3e1e7 100644 --- a/lib/AST/DeclarationName.cpp +++ b/lib/AST/DeclarationName.cpp @@ -194,7 +194,6 @@ DeclarationName::NameKind DeclarationName::getNameKind() const { // Can't actually get here. llvm_unreachable("This should be unreachable!"); - return Identifier; } bool DeclarationName::isDependentName() const { @@ -340,7 +339,6 @@ void *DeclarationName::getFETokenInfoAsVoid() const { default: llvm_unreachable("Declaration name has no FETokenInfo"); } - return 0; } void DeclarationName::setFETokenInfo(void *T) { @@ -622,5 +620,4 @@ SourceLocation DeclarationNameInfo::getEndLoc() const { return NameLoc; } llvm_unreachable("Unexpected declaration name kind"); - return SourceLocation(); } diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index ba191a8c80..6049f289f8 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -2503,8 +2503,6 @@ Expr::isNullPointerConstant(ASTContext &Ctx, switch (NPC) { case NPC_NeverValueDependent: llvm_unreachable("Unexpected value dependent expression!"); - // If the unthinkable happens, fall through to the safest alternative. - case NPC_ValueDependentIsNull: if (isTypeDependent() || getType()->isIntegralType(Ctx)) return NPCK_ZeroInteger; diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 2d4b07021c..2de72f392e 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -389,7 +389,6 @@ public: RetTy VisitStmt(const Stmt *) { llvm_unreachable("Expression evaluator should not be called on stmts"); - return DerivedError(0); } RetTy VisitExpr(const Expr *E) { return DerivedError(E); diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index ab6ec4e6a1..78f149c2df 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -1070,7 +1070,6 @@ void CXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND, case DeclarationName::ObjCOneArgSelector: case DeclarationName::ObjCMultiArgSelector: llvm_unreachable("Can't mangle Objective-C selector names here!"); - break; case DeclarationName::CXXConstructorName: if (ND == Structor) @@ -1125,7 +1124,6 @@ void CXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND, case DeclarationName::CXXUsingDirective: llvm_unreachable("Can't mangle a using directive name!"); - break; } } @@ -1513,7 +1511,6 @@ CXXNameMangler::mangleOperatorName(OverloadedOperatorKind OO, unsigned Arity) { case OO_None: case NUM_OVERLOADED_OPERATORS: llvm_unreachable("Not an overloaded operator"); - break; } } diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index fd90883bdf..fd99ee189b 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -333,15 +333,12 @@ MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND, case DeclarationName::ObjCOneArgSelector: case DeclarationName::ObjCMultiArgSelector: llvm_unreachable("Can't mangle Objective-C selector names here!"); - break; case DeclarationName::CXXConstructorName: llvm_unreachable("Can't mangle constructors yet!"); - break; case DeclarationName::CXXDestructorName: llvm_unreachable("Can't mangle destructors yet!"); - break; case DeclarationName::CXXConversionFunctionName: // ::= ?B # (cast) @@ -356,11 +353,9 @@ MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND, case DeclarationName::CXXLiteralOperatorName: // FIXME: Was this added in VS2010? Does MS even know how to mangle this? llvm_unreachable("Don't know how to mangle literal operators yet!"); - break; case DeclarationName::CXXUsingDirective: llvm_unreachable("Can't mangle a using directive name!"); - break; } } @@ -514,12 +509,10 @@ void MicrosoftCXXNameMangler::mangleOperatorName(OverloadedOperatorKind OO) { case OO_Conditional: llvm_unreachable("Don't know how to mangle ?:"); - break; case OO_None: case NUM_OVERLOADED_OPERATORS: llvm_unreachable("Not an overloaded operator"); - break; } } @@ -714,7 +707,6 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T) { case BuiltinType::BoundMember: llvm_unreachable( "Overloaded and dependent types shouldn't get to name mangling"); - break; case BuiltinType::ObjCId: Out << "PAUobjc_object@@"; break; case BuiltinType::ObjCClass: Out << "PAUobjc_class@@"; break; case BuiltinType::ObjCSel: Out << "PAUobjc_selector@@"; break; @@ -723,7 +715,6 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T) { case BuiltinType::Char32: case BuiltinType::NullPtr: llvm_unreachable("Don't know how to mangle this type"); - break; } } diff --git a/lib/AST/TemplateBase.cpp b/lib/AST/TemplateBase.cpp index b780012557..0c011a8ef0 100644 --- a/lib/AST/TemplateBase.cpp +++ b/lib/AST/TemplateBase.cpp @@ -69,7 +69,6 @@ bool TemplateArgument::isDependent() const { switch (getKind()) { case Null: llvm_unreachable("Should not have a NULL template argument"); - return false; case Type: return getAsType()->isDependentType(); @@ -108,7 +107,6 @@ bool TemplateArgument::isInstantiationDependent() const { switch (getKind()) { case Null: llvm_unreachable("Should not have a NULL template argument"); - return false; case Type: return getAsType()->isInstantiationDependentType(); diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp index 3848c2c38f..0f807e21e7 100644 --- a/lib/Analysis/FormatString.cpp +++ b/lib/Analysis/FormatString.cpp @@ -210,7 +210,6 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const { switch (K) { case InvalidTy: llvm_unreachable("ArgTypeResult must be valid"); - return true; case UnknownTy: return true; @@ -313,7 +312,6 @@ QualType ArgTypeResult::getRepresentativeType(ASTContext &C) const { switch (K) { case InvalidTy: llvm_unreachable("No representative type for Invalid ArgTypeResult"); - // Fall-through. case UnknownTy: return QualType(); case SpecificTy: diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index c246c3cb35..665263d550 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1864,7 +1864,6 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, } llvm_unreachable("Unhandled ABIArgInfo::Kind"); - return RValue::get(0); } /* VarArg handling */ diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 04bf996acd..fed79db9b0 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -291,16 +291,12 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) { switch (BT->getKind()) { case BuiltinType::Dependent: llvm_unreachable("Unexpected builtin type Dependent"); - return llvm::DIType(); case BuiltinType::Overload: llvm_unreachable("Unexpected builtin type Overload"); - return llvm::DIType(); case BuiltinType::BoundMember: llvm_unreachable("Unexpected builtin type BoundMember"); - return llvm::DIType(); case BuiltinType::UnknownAny: llvm_unreachable("Unexpected builtin type UnknownAny"); - return llvm::DIType(); case BuiltinType::NullPtr: return DBuilder. createNullPtrType(BT->getName(CGM.getContext().getLangOptions())); diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index f3996c9659..60ce3226a8 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1795,7 +1795,6 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) { return EmitFunctionDeclLValue(*this, E, FD); llvm_unreachable("Unhandled member declaration!"); - return LValue(); } LValue CodeGenFunction::EmitLValueForBitfield(llvm::Value *BaseValue, diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index c321faffcf..28c60a05d0 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -320,7 +320,6 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) { case CK_UncheckedDerivedToBase: { llvm_unreachable("cannot perform hierarchy conversion in EmitAggExpr: " "should have been unpacked before we got here"); - break; } case CK_GetObjCProperty: { diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index 13c96d4fae..f353fa2523 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -104,7 +104,6 @@ public: ComplexPairTy VisitStmt(Stmt *S) { S->dump(CGF.getContext().getSourceManager()); llvm_unreachable("Stmt can't have complex result type!"); - return ComplexPairTy(); } ComplexPairTy VisitExpr(Expr *S); ComplexPairTy VisitParenExpr(ParenExpr *PE) { return Visit(PE->getSubExpr());} diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 2de13a4090..1176eb1f9b 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -781,9 +781,6 @@ public: return 0; llvm_unreachable("Unable to handle InitListExpr"); - // Get rid of control reaches end of void function warning. - // Not reached. - return 0; } llvm::Constant *VisitCXXConstructExpr(CXXConstructExpr *E) { @@ -967,7 +964,6 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E, switch (Result.Val.getKind()) { case APValue::Uninitialized: llvm_unreachable("Constant expressions should be initialized."); - return 0; case APValue::LValue: { llvm::Type *DestTy = getTypes().ConvertTypeForMem(DestType); llvm::Constant *Offset = diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 90e1232715..264a71403a 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -154,7 +154,6 @@ public: Value *VisitStmt(Stmt *S) { S->dump(CGF.getContext().getSourceManager()); llvm_unreachable("Stmt can't have complex result type!"); - return 0; } Value *VisitExpr(Expr *S); @@ -1264,10 +1263,8 @@ EmitAddConsiderOverflowBehavior(const UnaryOperator *E, BinOp.Opcode = BO_Add; BinOp.E = E; return EmitOverflowCheckedBinOp(BinOp); - break; } llvm_unreachable("Unknown SignedOverflowBehaviorTy"); - return 0; } llvm::Value * @@ -2756,7 +2753,6 @@ LValue CodeGenFunction::EmitCompoundAssignmentLValue( case BO_Assign: case BO_Comma: llvm_unreachable("Not valid compound assignment operators"); - break; } llvm_unreachable("Unhandled compound assignment operator"); diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index be574b3efe..1058886e61 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -1061,7 +1061,6 @@ public: /// class of the given name. virtual llvm::GlobalVariable *GetClassGlobal(const std::string &Name) { llvm_unreachable("CGObjCMac::GetClassGlobal"); - return 0; } }; diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index 3f986bd1cd..bc34848ccf 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -139,11 +139,9 @@ void CodeGenFunction::EmitStmt(const Stmt *S) { case Stmt::ObjCAtCatchStmtClass: llvm_unreachable( "@catch statements should be handled by EmitObjCAtTryStmt"); - break; case Stmt::ObjCAtFinallyStmtClass: llvm_unreachable( "@finally statements should be handled by EmitObjCAtTryStmt"); - break; case Stmt::ObjCAtThrowStmtClass: EmitObjCAtThrowStmt(cast(*S)); break; diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index 1a210faa33..f936a9b89d 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -264,7 +264,6 @@ static BaseOffset ComputeBaseOffset(ASTContext &Context, if (!const_cast(DerivedRD)-> isDerivedFrom(const_cast(BaseRD), Paths)) { llvm_unreachable("Class must be derived from the passed in base class!"); - return BaseOffset(); } return ComputeBaseOffset(Context, DerivedRD, Paths.front()); @@ -701,7 +700,6 @@ CharUnits VCallOffsetMap::getVCallOffsetOffset(const CXXMethodDecl *MD) { } llvm_unreachable("Should always find a vcall offset offset!"); - return CharUnits::Zero(); } /// VCallAndVBaseOffsetBuilder - Class for building vcall and vbase offsets. @@ -1362,7 +1360,6 @@ VTableBuilder::ComputeThisAdjustmentBaseOffset(BaseSubobject Base, if (!const_cast(DerivedRD)-> isDerivedFrom(const_cast(BaseRD), Paths)) { llvm_unreachable("Class must be derived from the passed in base class!"); - return BaseOffset(); } // We have to go through all the paths, and see which one leads us to the diff --git a/lib/CodeGen/CodeGenAction.cpp b/lib/CodeGen/CodeGenAction.cpp index 3251b76742..f266ba9d3e 100644 --- a/lib/CodeGen/CodeGenAction.cpp +++ b/lib/CodeGen/CodeGenAction.cpp @@ -276,7 +276,6 @@ static raw_ostream *GetOutputStream(CompilerInstance &CI, } llvm_unreachable("Invalid action!"); - return 0; } ASTConsumer *CodeGenAction::CreateASTConsumer(CompilerInstance &CI, diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 8742f5999b..3032f820c6 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -274,7 +274,6 @@ static llvm::Type *getTypeForFormat(llvm::LLVMContext &VMContext, if (&format == &llvm::APFloat::x87DoubleExtended) return llvm::Type::getX86_FP80Ty(VMContext); llvm_unreachable("Unknown float format!"); - return 0; } /// ConvertType - Convert the specified type to its LLVM form. diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 02e6a3be38..9debf5ef4d 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -1893,7 +1893,6 @@ ABIArgInfo X86_64ABIInfo::classifyArgumentType(QualType Ty, unsigned &neededInt, case X87: case ComplexX87: llvm_unreachable("Invalid classification for hi word."); - break; case NoClass: break; diff --git a/lib/Driver/Action.cpp b/lib/Driver/Action.cpp index a7feed12db..52c0dbb5f1 100644 --- a/lib/Driver/Action.cpp +++ b/lib/Driver/Action.cpp @@ -36,7 +36,6 @@ const char *Action::getClassName(ActionClass AC) { } llvm_unreachable("invalid class"); - return 0; } InputAction::InputAction(const Arg &_Input, types::ID _Type) diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index b7d8f68e69..ec9295d6fb 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -1114,7 +1114,6 @@ Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase, } llvm_unreachable("invalid phase in ConstructPhaseAction"); - return 0; } bool Driver::IsUsingLTO(const ArgList &Args) const { diff --git a/lib/Driver/Option.cpp b/lib/Driver/Option.cpp index cd93dd832b..ee1963fd33 100644 --- a/lib/Driver/Option.cpp +++ b/lib/Driver/Option.cpp @@ -116,7 +116,6 @@ OptionGroup::OptionGroup(OptSpecifier ID, const char *Name, Arg *OptionGroup::accept(const ArgList &Args, unsigned &Index) const { llvm_unreachable("accept() should never be called on an OptionGroup"); - return 0; } InputOption::InputOption(OptSpecifier ID) @@ -125,7 +124,6 @@ InputOption::InputOption(OptSpecifier ID) Arg *InputOption::accept(const ArgList &Args, unsigned &Index) const { llvm_unreachable("accept() should never be called on an InputOption"); - return 0; } UnknownOption::UnknownOption(OptSpecifier ID) @@ -134,7 +132,6 @@ UnknownOption::UnknownOption(OptSpecifier ID) Arg *UnknownOption::accept(const ArgList &Args, unsigned &Index) const { llvm_unreachable("accept() should never be called on an UnknownOption"); - return 0; } FlagOption::FlagOption(OptSpecifier ID, const char *Name, diff --git a/lib/Driver/Phases.cpp b/lib/Driver/Phases.cpp index c465e1d279..b885eeef98 100644 --- a/lib/Driver/Phases.cpp +++ b/lib/Driver/Phases.cpp @@ -24,5 +24,4 @@ const char *phases::getPhaseName(ID Id) { } llvm_unreachable("Invalid phase id."); - return 0; } diff --git a/lib/Index/ASTLocation.cpp b/lib/Index/ASTLocation.cpp index 6746004bc7..1a4f19d0f6 100644 --- a/lib/Index/ASTLocation.cpp +++ b/lib/Index/ASTLocation.cpp @@ -61,7 +61,6 @@ SourceRange ASTLocation::getSourceRange() const { switch (getKind()) { default: llvm_unreachable("Invalid Kind"); - return SourceRange(); case N_Decl: return D->getSourceRange(); case N_Stmt: diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index c575507c55..c029c584ec 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -30,7 +30,6 @@ static int SelectDigraphErrorMessage(tok::TokenKind Kind) { case tok::kw_static_cast: return 4; default: llvm_unreachable("Unknown type for digraph error message."); - return -1; } } @@ -784,7 +783,7 @@ ExprResult Parser::ParseCXXCasts() { const char *CastName = 0; // For error messages switch (Kind) { - default: llvm_unreachable("Unknown C++ cast!"); abort(); + default: llvm_unreachable("Unknown C++ cast!"); case tok::kw_const_cast: CastName = "const_cast"; break; case tok::kw_dynamic_cast: CastName = "dynamic_cast"; break; case tok::kw_reinterpret_cast: CastName = "reinterpret_cast"; break; @@ -1292,7 +1291,6 @@ void Parser::ParseCXXSimpleTypeSpecifier(DeclSpec &DS) { llvm_unreachable("Annotation token should already be formed!"); default: llvm_unreachable("Not a simple-type-specifier token!"); - abort(); // type-name case tok::annot_typename: { diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp index 90fd7cdc40..64c72a19d2 100644 --- a/lib/Sema/SemaCXXScopeSpec.cpp +++ b/lib/Sema/SemaCXXScopeSpec.cpp @@ -138,7 +138,6 @@ DeclContext *Sema::computeDeclContext(const CXXScopeSpec &SS, switch (NNS->getKind()) { case NestedNameSpecifier::Identifier: llvm_unreachable("Dependent nested-name-specifier has no DeclContext"); - break; case NestedNameSpecifier::Namespace: return NNS->getAsNamespace(); diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 166e165d69..283f4fb731 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -3401,7 +3401,6 @@ void Sema::CodeCompleteTag(Scope *S, unsigned TagSpec) { default: llvm_unreachable("Unknown type specifier kind in CodeCompleteTag"); - return; } ResultBuilder Results(*this, CodeCompleter->getAllocator(), ContextKind); diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index da0fa3e12a..bddefb6693 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2938,7 +2938,6 @@ Sema::GetNameFromUnqualifiedId(const UnqualifiedId &Name) { } // switch (Name.getKind()) llvm_unreachable("Unknown name kind"); - return DeclarationNameInfo(); } static QualType getCoreType(QualType Ty) { @@ -8375,7 +8374,6 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) { } llvm_unreachable("found no user-declared constructors"); - return; } break; @@ -8460,7 +8458,7 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) { case CXXDestructor: hasTrivial = &CXXRecordDecl::hasTrivialDestructor; break; default: - llvm_unreachable("unexpected special member"); return; + llvm_unreachable("unexpected special member"); } // Check for nontrivial bases (and recurse). diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 34eb49888d..88c89f21bd 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -3206,7 +3206,6 @@ static void handleNSReturnsRetainedAttr(Sema &S, Decl *D, switch (Attr.getKind()) { default: llvm_unreachable("invalid ownership attribute"); - return; case AttributeList::AT_ns_returns_autoreleased: D->addAttr(::new (S.Context) NSReturnsAutoreleasedAttr(Attr.getRange(), S.Context)); diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 0727bbd36c..23b128db59 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -9978,7 +9978,6 @@ void Sema::SetDeclDefaulted(Decl *Dcl, SourceLocation DefaultLoc) { case CXXInvalid: llvm_unreachable("Invalid special member."); - break; } } else { Diag(DefaultLoc, diag::err_default_special_members); diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 582f153299..4dd43c8857 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -8942,7 +8942,6 @@ ExprResult Sema::ActOnGNUNullExpr(SourceLocation TokenLoc) { Ty = Context.LongLongTy; else { llvm_unreachable("I don't know size of pointer!"); - Ty = Context.IntTy; } return Owned(new (Context) GNUNullExpr(Ty, TokenLoc)); diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 3fb8df6682..412d891a93 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -1526,7 +1526,6 @@ bool Sema::FindAllocationOverload(SourceLocation StartLoc, SourceRange Range, } } llvm_unreachable("Unreachable, bad result from BestViableFunction"); - return true; } @@ -2182,7 +2181,6 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, case ImplicitConversionSequence::EllipsisConversion: llvm_unreachable("Cannot perform an ellipsis conversion"); - return Owned(From); case ImplicitConversionSequence::BadConversion: return ExprError(); @@ -2285,7 +2283,6 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, default: llvm_unreachable("Improper first standard conversion"); - break; } // Perform the second implicit conversion @@ -2525,7 +2522,6 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, case ICK_Qualification: case ICK_Num_Conversion_Kinds: llvm_unreachable("Improper second standard conversion"); - break; } switch (SCS.Third) { @@ -2551,7 +2547,6 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, default: llvm_unreachable("Improper third standard conversion"); - break; } return Owned(From); @@ -3561,7 +3556,6 @@ static bool FindConditionalOverload(Sema &Self, ExprResult &LHS, ExprResult &RHS case OR_Deleted: llvm_unreachable("Conditional operator has only built-in overloads"); - break; } return true; } diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 7f42fb7178..9a802226e2 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -6334,7 +6334,6 @@ Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op, case OO_None: case NUM_OVERLOADED_OPERATORS: llvm_unreachable("Expected an overloaded operator"); - break; case OO_New: case OO_Delete: @@ -6343,7 +6342,6 @@ Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op, case OO_Call: llvm_unreachable( "Special operators don't use AddBuiltinOperatorCandidates"); - break; case OO_Comma: case OO_Arrow: diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index c75e337fdb..b30be82cee 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -1388,7 +1388,6 @@ Sema::BuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation ColonLoc, // Can't be a DependentSizedArrayType or an IncompleteArrayType since // UnqAT is not incomplete and Range is not type-dependent. llvm_unreachable("Unexpected array type in for-range"); - return StmtError(); } // end-expr is __range + __bound. diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 4f90a72ea2..594b7b24fb 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -2683,7 +2683,6 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param, switch (Arg.getArgument().getKind()) { case TemplateArgument::Null: llvm_unreachable("Should never see a NULL template argument here"); - return true; case TemplateArgument::Expression: { TemplateArgument Result; @@ -2806,7 +2805,6 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param, switch (Arg.getArgument().getKind()) { case TemplateArgument::Null: llvm_unreachable("Should never see a NULL template argument here"); - return true; case TemplateArgument::Template: case TemplateArgument::TemplateExpansion: @@ -5218,7 +5216,6 @@ Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc, case TSK_Undeclared: case TSK_ImplicitInstantiation: llvm_unreachable("Don't check implicit instantiations here"); - return false; case TSK_ExplicitSpecialization: switch (PrevTSK) { @@ -5351,8 +5348,6 @@ Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc, } llvm_unreachable("Missing specialization/instantiation case?"); - - return false; } /// \brief Perform semantic analysis for the given dependent function diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp index 283cc575ad..5d5cdc5233 100644 --- a/lib/Sema/SemaTemplateDeduction.cpp +++ b/lib/Sema/SemaTemplateDeduction.cpp @@ -1540,7 +1540,6 @@ DeduceTemplateArguments(Sema &S, switch (Param.getKind()) { case TemplateArgument::Null: llvm_unreachable("Null template argument in parameter list"); - break; case TemplateArgument::Type: if (Arg.getKind() == TemplateArgument::Type) @@ -1831,7 +1830,6 @@ static bool isSameTemplateArg(ASTContext &Context, switch (X.getKind()) { case TemplateArgument::Null: llvm_unreachable("Comparing NULL template argument"); - break; case TemplateArgument::Type: return Context.getCanonicalType(X.getAsType()) == diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index d4406240d0..43db5cbbd6 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -97,7 +97,6 @@ void Sema::InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs, Decl * TemplateDeclInstantiator::VisitTranslationUnitDecl(TranslationUnitDecl *D) { llvm_unreachable("Translation units cannot be instantiated"); - return D; } Decl * @@ -111,7 +110,6 @@ TemplateDeclInstantiator::VisitLabelDecl(LabelDecl *D) { Decl * TemplateDeclInstantiator::VisitNamespaceDecl(NamespaceDecl *D) { llvm_unreachable("Namespaces cannot be instantiated"); - return D; } Decl * @@ -702,7 +700,6 @@ Decl *TemplateDeclInstantiator::VisitEnumDecl(EnumDecl *D) { Decl *TemplateDeclInstantiator::VisitEnumConstantDecl(EnumConstantDecl *D) { llvm_unreachable("EnumConstantDecls can only occur within EnumDecls."); - return 0; } Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) { diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 2b4a509f11..ad5d8b9a4e 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -1760,7 +1760,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_static) break; switch (cast(SemaRef.CurContext)->getTagKind()) { - case TTK_Enum: llvm_unreachable("unhandled tag kind"); break; + case TTK_Enum: llvm_unreachable("unhandled tag kind"); case TTK_Struct: Error = 1; /* Struct member */ break; case TTK_Union: Error = 2; /* Union member */ break; case TTK_Class: Error = 3; /* Class member */ break; diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 0c22c61b66..509c450ced 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -1729,7 +1729,6 @@ public: default: llvm_unreachable("Invalid C++ named cast"); - break; } return ExprError(); @@ -2682,7 +2681,6 @@ TreeTransform } llvm_unreachable("Unknown name kind."); - return DeclarationNameInfo(); } template @@ -8050,7 +8048,6 @@ template ExprResult TreeTransform::TransformAsTypeExpr(AsTypeExpr *E) { llvm_unreachable("Cannot transform asType expressions yet"); - return SemaRef.Owned(E); } //===----------------------------------------------------------------------===// diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 4d92e314bc..f390929d4b 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -4994,7 +4994,6 @@ ASTReader::ReadTemplateName(Module &F, const RecordData &Record, } llvm_unreachable("Unhandled template name kind!"); - return TemplateName(); } TemplateArgument @@ -5034,7 +5033,6 @@ ASTReader::ReadTemplateArgument(Module &F, } llvm_unreachable("Unhandled template argument kind!"); - return TemplateArgument(); } TemplateParameterList * diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 38f5f49734..32d8840719 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -346,7 +346,6 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { FD->IdentifierNamespace = Record[Idx++]; switch ((FunctionDecl::TemplatedKind)Record[Idx++]) { default: llvm_unreachable("Unhandled TemplatedKind!"); - break; case FunctionDecl::TK_NonTemplate: break; case FunctionDecl::TK_FunctionTemplate: @@ -1481,7 +1480,6 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) { case DECL_CONTEXT_LEXICAL: case DECL_CONTEXT_VISIBLE: llvm_unreachable("Record cannot be de-serialized with ReadDeclRecord"); - break; case DECL_TYPEDEF: D = TypedefDecl::Create(Context, 0, SourceLocation(), SourceLocation(), 0, 0); diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index 5a5963c5ec..ae273f395b 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -296,7 +296,6 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { Record.push_back(D->getTemplatedKind()); switch (D->getTemplatedKind()) { default: llvm_unreachable("Unhandled TemplatedKind!"); - break; case FunctionDecl::TK_NonTemplate: break; case FunctionDecl::TK_FunctionTemplate: diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index b87c9eba18..6e73b60abf 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1744,7 +1744,6 @@ FindReportInEquivalenceClass(BugReportEquivClass& EQ, if (errorNode->isSink()) { llvm_unreachable( "BugType::isSuppressSink() should not be 'true' for sink end nodes"); - return 0; } // No successors? By definition this nodes isn't post-dominated by a sink. if (errorNode->succ_empty()) { diff --git a/lib/StaticAnalyzer/Core/CoreEngine.cpp b/lib/StaticAnalyzer/Core/CoreEngine.cpp index 6a860428d6..e1705c61a3 100644 --- a/lib/StaticAnalyzer/Core/CoreEngine.cpp +++ b/lib/StaticAnalyzer/Core/CoreEngine.cpp @@ -327,7 +327,6 @@ void CoreEngine::HandleBlockExit(const CFGBlock * B, ExplodedNode *Pred) { switch (Term->getStmtClass()) { default: llvm_unreachable("Analysis for this terminator not implemented."); - break; case Stmt::BinaryOperatorClass: // '&&' and '||' HandleBranch(cast(Term)->getLHS(), Term, B, Pred); diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 5e38f2f244..d982a698d3 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -1031,7 +1031,6 @@ void ExprEngine::processIndirectGoto(IndirectGotoNodeBuilder &builder) { } llvm_unreachable("No block with label."); - return; } if (isa(V) || isa(V)) { diff --git a/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/lib/StaticAnalyzer/Core/ExprEngineC.cpp index 955684f92d..68ccc59ac9 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -626,7 +626,6 @@ void ExprEngine::VisitUnaryOperator(const UnaryOperator* U, switch (U->getOpcode()) { default: llvm_unreachable("Invalid Opcode."); - break; case UO_Not: // FIXME: Do we need to handle promotions? diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp index 18fbf831ec..6d435da993 100644 --- a/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -892,7 +892,6 @@ SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) { if (isa(MR)) { llvm_unreachable("Why load from a code text region?"); - return UnknownVal(); } // FIXME: Perhaps this method should just take a 'const MemRegion*' argument diff --git a/lib/StaticAnalyzer/Core/SVals.cpp b/lib/StaticAnalyzer/Core/SVals.cpp index e32a3b0f53..b5980b9693 100644 --- a/lib/StaticAnalyzer/Core/SVals.cpp +++ b/lib/StaticAnalyzer/Core/SVals.cpp @@ -370,6 +370,5 @@ void Loc::dumpToStream(raw_ostream &os) const { } default: llvm_unreachable("Pretty-printing not implemented for this Loc."); - break; } } diff --git a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp index 830d70e888..bd63ecf775 100644 --- a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp +++ b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp @@ -348,7 +348,6 @@ SVal SimpleSValBuilder::evalBinOpNN(const ProgramState *state, case BO_LAnd: case BO_LOr: llvm_unreachable("Logical operators handled by branching logic."); - return UnknownVal(); case BO_Assign: case BO_MulAssign: case BO_DivAssign: @@ -362,11 +361,9 @@ SVal SimpleSValBuilder::evalBinOpNN(const ProgramState *state, case BO_OrAssign: case BO_Comma: llvm_unreachable("'=' and ',' operators handled by ExprEngine."); - return UnknownVal(); case BO_PtrMemD: case BO_PtrMemI: llvm_unreachable("Pointer arithmetic not handled here."); - return UnknownVal(); case BO_LT: case BO_GT: case BO_LE: @@ -557,7 +554,6 @@ SVal SimpleSValBuilder::evalBinOpLL(const ProgramState *state, switch (op) { default: llvm_unreachable("Unimplemented operation for two identical values"); - return UnknownVal(); case BO_Sub: return makeZeroVal(resultTy); case BO_EQ: @@ -574,7 +570,6 @@ SVal SimpleSValBuilder::evalBinOpLL(const ProgramState *state, switch (lhs.getSubKind()) { default: llvm_unreachable("Ordering not implemented for this Loc."); - return UnknownVal(); case loc::GotoLabelKind: // The only thing we know about labels is that they're non-null. diff --git a/lib/StaticAnalyzer/Core/Store.cpp b/lib/StaticAnalyzer/Core/Store.cpp index 63550d47f1..48a6f4f60f 100644 --- a/lib/StaticAnalyzer/Core/Store.cpp +++ b/lib/StaticAnalyzer/Core/Store.cpp @@ -104,7 +104,6 @@ const MemRegion *StoreManager::castRegion(const MemRegion *R, QualType CastToTy) case MemRegion::NonStaticGlobalSpaceRegionKind: case MemRegion::StaticGlobalSpaceRegionKind: { llvm_unreachable("Invalid region cast"); - break; } case MemRegion::FunctionTextRegionKind: @@ -204,7 +203,6 @@ const MemRegion *StoreManager::castRegion(const MemRegion *R, QualType CastToTy) } llvm_unreachable("unreachable"); - return 0; } @@ -262,7 +260,6 @@ SVal StoreManager::getLValueFieldOrIvar(const Decl *D, SVal Base) { default: llvm_unreachable("Unhandled Base."); - return Base; } // NOTE: We must have this check first because ObjCIvarDecl is a subclass diff --git a/lib/StaticAnalyzer/Core/SymbolManager.cpp b/lib/StaticAnalyzer/Core/SymbolManager.cpp index 32ad5819de..dc3a2fe660 100644 --- a/lib/StaticAnalyzer/Core/SymbolManager.cpp +++ b/lib/StaticAnalyzer/Core/SymbolManager.cpp @@ -29,7 +29,6 @@ static void print(raw_ostream &os, BinaryOperator::Opcode Op) { switch (Op) { default: llvm_unreachable("operator printing not implemented"); - break; case BO_Mul: os << '*' ; break; case BO_Div: os << '/' ; break; case BO_Rem: os << '%' ; break; diff --git a/tools/libclang/CIndexDiagnostic.cpp b/tools/libclang/CIndexDiagnostic.cpp index cfebbfce52..db71a767c9 100644 --- a/tools/libclang/CIndexDiagnostic.cpp +++ b/tools/libclang/CIndexDiagnostic.cpp @@ -106,7 +106,7 @@ CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, unsigned Options) { /* Print warning/error/etc. */ switch (Severity) { - case CXDiagnostic_Ignored: llvm_unreachable("impossible"); break; + case CXDiagnostic_Ignored: llvm_unreachable("impossible"); case CXDiagnostic_Note: Out << "note: "; break; case CXDiagnostic_Warning: Out << "warning: "; break; case CXDiagnostic_Error: Out << "error: "; break;