summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTContext.cpp7
-rw-r--r--clang/lib/AST/Decl.cpp1
-rw-r--r--clang/lib/AST/DeclBase.cpp2
-rw-r--r--clang/lib/AST/DeclCXX.cpp1
-rw-r--r--clang/lib/AST/DeclObjC.cpp2
-rw-r--r--clang/lib/AST/DeclPrinter.cpp2
-rw-r--r--clang/lib/AST/DeclarationName.cpp3
-rw-r--r--clang/lib/AST/Expr.cpp2
-rw-r--r--clang/lib/AST/ExprConstant.cpp1
-rw-r--r--clang/lib/AST/ItaniumMangle.cpp3
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp9
-rw-r--r--clang/lib/AST/TemplateBase.cpp2
-rw-r--r--clang/lib/Analysis/FormatString.cpp2
-rw-r--r--clang/lib/CodeGen/CGCall.cpp1
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp4
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp1
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp1
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp1
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp4
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp4
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp1
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp2
-rw-r--r--clang/lib/CodeGen/CGVTables.cpp3
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp1
-rw-r--r--clang/lib/CodeGen/CodeGenTypes.cpp1
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp1
-rw-r--r--clang/lib/Driver/Action.cpp1
-rw-r--r--clang/lib/Driver/Driver.cpp1
-rw-r--r--clang/lib/Driver/Option.cpp3
-rw-r--r--clang/lib/Driver/Phases.cpp1
-rw-r--r--clang/lib/Index/ASTLocation.cpp1
-rw-r--r--clang/lib/Parse/ParseExprCXX.cpp4
-rw-r--r--clang/lib/Sema/SemaCXXScopeSpec.cpp1
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp1
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp1
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp1
-rw-r--r--clang/lib/Sema/SemaExpr.cpp1
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp6
-rw-r--r--clang/lib/Sema/SemaOverload.cpp2
-rw-r--r--clang/lib/Sema/SemaStmt.cpp1
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp5
-rw-r--r--clang/lib/Sema/SemaTemplateDeduction.cpp2
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp3
-rw-r--r--clang/lib/Sema/SemaType.cpp2
-rw-r--r--clang/lib/Sema/TreeTransform.h3
-rw-r--r--clang/lib/Serialization/ASTReader.cpp2
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp2
-rw-r--r--clang/lib/Serialization/ASTWriterDecl.cpp1
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporter.cpp1
-rw-r--r--clang/lib/StaticAnalyzer/Core/CoreEngine.cpp1
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngine.cpp1
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp1
-rw-r--r--clang/lib/StaticAnalyzer/Core/RegionStore.cpp1
-rw-r--r--clang/lib/StaticAnalyzer/Core/SVals.cpp1
-rw-r--r--clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp5
-rw-r--r--clang/lib/StaticAnalyzer/Core/Store.cpp3
-rw-r--r--clang/lib/StaticAnalyzer/Core/SymbolManager.cpp1
58 files changed, 4 insertions, 122 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index de77cb66cf0..5e0143dc007 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 2fdb9654b0a..a4608eb81c3 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/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/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index d1f8b1c7fd8..60fb7025abe 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -572,7 +572,6 @@ Decl *Decl::castFromDeclContext (const DeclContext *D) {
return static_cast<NAME##Decl*>(const_cast<DeclContext*>(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<NAME##Decl*>(const_cast<Decl*>(D));
#include "clang/AST/DeclNodes.inc"
llvm_unreachable("a decl that inherits DeclContext isn't handled");
- return 0;
}
}
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index b9af8e3a1f1..9addece6f96 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/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/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 68177de70d4..97f215fb7f0 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -550,7 +550,6 @@ ObjCInterfaceDecl *ObjCMethodDecl::getClassInterface() {
assert(!isa<ObjCProtocolDecl>(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/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index a17e14053cb..8d8ec2f7d2c 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -192,7 +192,7 @@ void DeclPrinter::ProcessDeclGroup(SmallVectorImpl<Decl*>& 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/clang/lib/AST/DeclarationName.cpp b/clang/lib/AST/DeclarationName.cpp
index 84d4ca94c3d..8dfca3e1e7c 100644
--- a/clang/lib/AST/DeclarationName.cpp
+++ b/clang/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/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index ba191a8c80b..6049f289f83 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/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/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 2d4b07021c2..2de72f392e0 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/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/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index ab6ec4e6a10..78f149c2df7 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/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/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index fd90883bdf1..fd99ee189bb 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/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:
// <operator-name> ::= ?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/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
index b780012557f..0c011a8ef09 100644
--- a/clang/lib/AST/TemplateBase.cpp
+++ b/clang/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/clang/lib/Analysis/FormatString.cpp b/clang/lib/Analysis/FormatString.cpp
index 3848c2c38f2..0f807e21e7f 100644
--- a/clang/lib/Analysis/FormatString.cpp
+++ b/clang/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/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index c246c3cb359..665263d5505 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/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/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 04bf996acde..fed79db9b0b 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/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/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index f3996c9659d..60ce3226a8a 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/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/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index c321faffcfd..28c60a05d05 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/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/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index 13c96d4fae5..f353fa25237 100644
--- a/clang/lib/CodeGen/CGExprComplex.cpp
+++ b/clang/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/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 2de13a4090d..1176eb1f9bf 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/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/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index 90e12327156..264a71403ab 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/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/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index be574b3efeb..1058886e612 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/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/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index 3f986bd1cd6..bc34848ccfa 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/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<ObjCAtThrowStmt>(*S));
break;
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp
index 1a210faa33f..f936a9b89de 100644
--- a/clang/lib/CodeGen/CGVTables.cpp
+++ b/clang/lib/CodeGen/CGVTables.cpp
@@ -264,7 +264,6 @@ static BaseOffset ComputeBaseOffset(ASTContext &Context,
if (!const_cast<CXXRecordDecl *>(DerivedRD)->
isDerivedFrom(const_cast<CXXRecordDecl *>(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<CXXRecordDecl *>(DerivedRD)->
isDerivedFrom(const_cast<CXXRecordDecl *>(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/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 3251b767425..f266ba9d3e8 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/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/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp
index 8742f5999b9..3032f820c66 100644
--- a/clang/lib/CodeGen/CodeGenTypes.cpp
+++ b/clang/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/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 02e6a3be38c..9debf5ef4d9 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/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/clang/lib/Driver/Action.cpp b/clang/lib/Driver/Action.cpp
index a7feed12dbd..52c0dbb5f17 100644
--- a/clang/lib/Driver/Action.cpp
+++ b/clang/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/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index b7d8f68e69f..ec9295d6fb7 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/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/clang/lib/Driver/Option.cpp b/clang/lib/Driver/Option.cpp
index cd93dd832b1..ee1963fd331 100644
--- a/clang/lib/Driver/Option.cpp
+++ b/clang/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/clang/lib/Driver/Phases.cpp b/clang/lib/Driver/Phases.cpp
index c465e1d279f..b885eeef983 100644
--- a/clang/lib/Driver/Phases.cpp
+++ b/clang/lib/Driver/Phases.cpp
@@ -24,5 +24,4 @@ const char *phases::getPhaseName(ID Id) {
}
llvm_unreachable("Invalid phase id.");
- return 0;
}
diff --git a/clang/lib/Index/ASTLocation.cpp b/clang/lib/Index/ASTLocation.cpp
index 6746004bc78..1a4f19d0f66 100644
--- a/clang/lib/Index/ASTLocation.cpp
+++ b/clang/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/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index c575507c554..c029c584ecb 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/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/clang/lib/Sema/SemaCXXScopeSpec.cpp b/clang/lib/Sema/SemaCXXScopeSpec.cpp
index 90fd7cdc409..64c72a19d29 100644
--- a/clang/lib/Sema/SemaCXXScopeSpec.cpp
+++ b/clang/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/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 166e165d691..283f4fb731d 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/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/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index da0fa3e12a7..bddefb66935 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 34eb49888dd..88c89f21bdd 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/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/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 0727bbd36c6..23b128db596 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/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/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 582f153299b..4dd43c8857f 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/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/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 3fb8df6682e..412d891a93d 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/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/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 7f42fb71780..9a802226e2f 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/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/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index c75e337fdb7..b30be82ceec 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/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/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 4f90a72ea2f..594b7b24fb7 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/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/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index 283cc575ad6..5d5cdc52335 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/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/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index d4406240d0e..43db5cbbd66 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/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/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 2b4a509f111..ad5d8b9a4e3 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -1760,7 +1760,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state,
if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_static)
break;
switch (cast<TagDecl>(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/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 0c22c61b662..509c450ced7 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -1729,7 +1729,6 @@ public:
default:
llvm_unreachable("Invalid C++ named cast");
- break;
}
return ExprError();
@@ -2682,7 +2681,6 @@ TreeTransform<Derived>
}
llvm_unreachable("Unknown name kind.");
- return DeclarationNameInfo();
}
template<typename Derived>
@@ -8050,7 +8048,6 @@ template<typename Derived>
ExprResult
TreeTransform<Derived>::TransformAsTypeExpr(AsTypeExpr *E) {
llvm_unreachable("Cannot transform asType expressions yet");
- return SemaRef.Owned(E);
}
//===----------------------------------------------------------------------===//
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 4d92e314bc7..f390929d4b3 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/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/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index 38f5f49734e..32d88407195 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/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/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index 5a5963c5ecd..ae273f395b2 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/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/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
index b87c9eba185..6e73b60abf9 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/clang/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/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
index 6a860428d64..e1705c61a37 100644
--- a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
+++ b/clang/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<BinaryOperator>(Term)->getLHS(), Term, B, Pred);
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
index 5e38f2f244a..d982a698d3d 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -1031,7 +1031,6 @@ void ExprEngine::processIndirectGoto(IndirectGotoNodeBuilder &builder) {
}
llvm_unreachable("No block with label.");
- return;
}
if (isa<loc::ConcreteInt>(V) || isa<UndefinedVal>(V)) {
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
index 955684f92de..68ccc59ac95 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
+++ b/clang/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/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index 18fbf831ec9..6d435da993e 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -892,7 +892,6 @@ SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) {
if (isa<CodeTextRegion>(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/clang/lib/StaticAnalyzer/Core/SVals.cpp b/clang/lib/StaticAnalyzer/Core/SVals.cpp
index e32a3b0f539..b5980b96938 100644
--- a/clang/lib/StaticAnalyzer/Core/SVals.cpp
+++ b/clang/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/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
index 830d70e888b..bd63ecf775d 100644
--- a/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
+++ b/clang/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/clang/lib/StaticAnalyzer/Core/Store.cpp b/clang/lib/StaticAnalyzer/Core/Store.cpp
index 63550d47f13..48a6f4f60f8 100644
--- a/clang/lib/StaticAnalyzer/Core/Store.cpp
+++ b/clang/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/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp b/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp
index 32ad5819de2..dc3a2fe6603 100644
--- a/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud