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
diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h
index c5b564d..cf2e3c5 100644
--- a/include/clang/AST/Attr.h
+++ b/include/clang/AST/Attr.h
@@ -68,7 +68,6 @@
   
   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 c186b48..3b0edcc 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -108,7 +108,6 @@
 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 de77cb6..5e0143d 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -3219,7 +3219,6 @@
 
   // Silence GCC warning
   llvm_unreachable("Unhandled template argument kind");
-  return TemplateArgument();
 }
 
 NestedNameSpecifier *
@@ -4919,7 +4918,6 @@
   }
 
   llvm_unreachable("Unhandled TargetInfo::IntType value");
-  return CanQualType();
 }
 
 //===----------------------------------------------------------------------===//
@@ -5749,13 +5747,11 @@
 #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 @@
   case Type::FunctionProto:
   case Type::ExtVector:
     llvm_unreachable("Types are eliminated above");
-    return QualType();
 
   case Type::Pointer:
   {
@@ -6015,7 +6010,6 @@
     return UnsignedInt128Ty;
   default:
     llvm_unreachable("Unexpected signed integer type");
-    return QualType();
   }
 }
 
@@ -6476,7 +6470,6 @@
     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 2fdb965..a4608eb 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -1891,7 +1891,6 @@
     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 d1f8b1c..60fb702 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -572,7 +572,6 @@
         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 @@
         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/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index b9af8e3..9addece 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -1694,7 +1694,6 @@
     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 68177de..97f215f 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -550,7 +550,6 @@
 
   assert(!isa<ObjCProtocolDecl>(getDeclContext()) && "It's a protocol method");
   llvm_unreachable("unknown method context");
-  return 0;
 }
 
 //===----------------------------------------------------------------------===//
@@ -782,7 +781,6 @@
   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 a17e140..8d8ec2f 100644
--- a/lib/AST/DeclPrinter.cpp
+++ b/lib/AST/DeclPrinter.cpp
@@ -192,7 +192,7 @@
 
 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 84d4ca9..8dfca3e 100644
--- a/lib/AST/DeclarationName.cpp
+++ b/lib/AST/DeclarationName.cpp
@@ -194,7 +194,6 @@
 
   // Can't actually get here.
   llvm_unreachable("This should be unreachable!");
-  return Identifier;
 }
 
 bool DeclarationName::isDependentName() const {
@@ -340,7 +339,6 @@
   default:
     llvm_unreachable("Declaration name has no FETokenInfo");
   }
-  return 0;
 }
 
 void DeclarationName::setFETokenInfo(void *T) {
@@ -622,5 +620,4 @@
     return NameLoc;
   }
   llvm_unreachable("Unexpected declaration name kind");
-  return SourceLocation();
 }
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index ba191a8..6049f28 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -2503,8 +2503,6 @@
     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 2d4b070..2de72f3 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -389,7 +389,6 @@
 
   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 ab6ec4e..78f149c 100644
--- a/lib/AST/ItaniumMangle.cpp
+++ b/lib/AST/ItaniumMangle.cpp
@@ -1070,7 +1070,6 @@
   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 @@
 
   case DeclarationName::CXXUsingDirective:
     llvm_unreachable("Can't mangle a using directive name!");
-    break;
   }
 }
 
@@ -1513,7 +1511,6 @@
   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 fd90883..fd99ee1 100644
--- a/lib/AST/MicrosoftMangle.cpp
+++ b/lib/AST/MicrosoftMangle.cpp
@@ -333,15 +333,12 @@
     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 @@
     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 @@
     
   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 @@
   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 @@
   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 b780012..0c011a8 100644
--- a/lib/AST/TemplateBase.cpp
+++ b/lib/AST/TemplateBase.cpp
@@ -69,7 +69,6 @@
   switch (getKind()) {
   case Null:
     llvm_unreachable("Should not have a NULL template argument");
-    return false;
 
   case Type:
     return getAsType()->isDependentType();
@@ -108,7 +107,6 @@
   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 3848c2c..0f807e2 100644
--- a/lib/Analysis/FormatString.cpp
+++ b/lib/Analysis/FormatString.cpp
@@ -210,7 +210,6 @@
   switch (K) {
     case InvalidTy:
       llvm_unreachable("ArgTypeResult must be valid");
-      return true;
 
     case UnknownTy:
       return true;
@@ -313,7 +312,6 @@
   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 c246c3c..665263d 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1864,7 +1864,6 @@
   }
 
   llvm_unreachable("Unhandled ABIArgInfo::Kind");
-  return RValue::get(0);
 }
 
 /* VarArg handling */
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 04bf996..fed79db 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -291,16 +291,12 @@
   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 f3996c9..60ce322 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -1795,7 +1795,6 @@
     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 c321faf..28c60a0 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -320,7 +320,6 @@
   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 13c96d4..f353fa2 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -104,7 +104,6 @@
   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 2de13a4..1176eb1 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -781,9 +781,6 @@
       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 @@
     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 90e1232..264a714 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -154,7 +154,6 @@
   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 @@
     BinOp.Opcode = BO_Add;
     BinOp.E = E;
     return EmitOverflowCheckedBinOp(BinOp);
-    break;
   }
   llvm_unreachable("Unknown SignedOverflowBehaviorTy");
-  return 0;
 }
 
 llvm::Value *
@@ -2756,7 +2753,6 @@
   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 be574b3..1058886 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -1061,7 +1061,6 @@
   /// 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 3f986bd..bc34848 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -139,11 +139,9 @@
   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/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp
index 1a210fa..f936a9b 100644
--- a/lib/CodeGen/CGVTables.cpp
+++ b/lib/CodeGen/CGVTables.cpp
@@ -264,7 +264,6 @@
   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 @@
   }
   
   llvm_unreachable("Should always find a vcall offset offset!");
-  return CharUnits::Zero();
 }
 
 /// VCallAndVBaseOffsetBuilder - Class for building vcall and vbase offsets.
@@ -1362,7 +1360,6 @@
   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/lib/CodeGen/CodeGenAction.cpp b/lib/CodeGen/CodeGenAction.cpp
index 3251b76..f266ba9 100644
--- a/lib/CodeGen/CodeGenAction.cpp
+++ b/lib/CodeGen/CodeGenAction.cpp
@@ -276,7 +276,6 @@
   }
 
   llvm_unreachable("Invalid action!");
-  return 0;
 }
 
 ASTConsumer *CodeGenAction::CreateASTConsumer(CompilerInstance &CI,
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index 8742f59..3032f82 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/lib/CodeGen/CodeGenTypes.cpp
@@ -274,7 +274,6 @@
   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 02e6a3b..9debf5e 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -1893,7 +1893,6 @@
   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 a7feed1..52c0dbb 100644
--- a/lib/Driver/Action.cpp
+++ b/lib/Driver/Action.cpp
@@ -36,7 +36,6 @@
   }
 
   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 b7d8f68..ec9295d 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -1114,7 +1114,6 @@
   }
 
   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 cd93dd8..ee1963f 100644
--- a/lib/Driver/Option.cpp
+++ b/lib/Driver/Option.cpp
@@ -116,7 +116,6 @@
 
 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 @@
 
 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 @@
 
 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 c465e1d..b885eee 100644
--- a/lib/Driver/Phases.cpp
+++ b/lib/Driver/Phases.cpp
@@ -24,5 +24,4 @@
   }
 
   llvm_unreachable("Invalid phase id.");
-  return 0;
 }
diff --git a/lib/Index/ASTLocation.cpp b/lib/Index/ASTLocation.cpp
index 6746004..1a4f19d 100644
--- a/lib/Index/ASTLocation.cpp
+++ b/lib/Index/ASTLocation.cpp
@@ -61,7 +61,6 @@
 
   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 c575507..c029c58 100644
--- a/lib/Parse/ParseExprCXX.cpp
+++ b/lib/Parse/ParseExprCXX.cpp
@@ -30,7 +30,6 @@
     case tok::kw_static_cast:      return 4;
     default:
       llvm_unreachable("Unknown type for digraph error message.");
-      return -1;
   }
 }
 
@@ -784,7 +783,7 @@
   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 @@
     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 90fd7cd..64c72a1 100644
--- a/lib/Sema/SemaCXXScopeSpec.cpp
+++ b/lib/Sema/SemaCXXScopeSpec.cpp
@@ -138,7 +138,6 @@
   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 166e165..283f4fb 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -3401,7 +3401,6 @@
     
   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 da0fa3e..bddefb6 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2938,7 +2938,6 @@
   } // switch (Name.getKind())
 
   llvm_unreachable("Unknown name kind");
-  return DeclarationNameInfo();
 }
 
 static QualType getCoreType(QualType Ty) {
@@ -8375,7 +8374,6 @@
       }
 
       llvm_unreachable("found no user-declared constructors");
-      return;
     }
     break;
 
@@ -8460,7 +8458,7 @@
   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 34eb498..88c89f2 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -3206,7 +3206,6 @@
   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 0727bbd..23b128d 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -9978,7 +9978,6 @@
 
     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 582f153..4dd43c8 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -8942,7 +8942,6 @@
     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 3fb8df6..412d891 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1526,7 +1526,6 @@
   }
   }
   llvm_unreachable("Unreachable, bad result from BestViableFunction");
-  return true;
 }
 
 
@@ -2182,7 +2181,6 @@
 
   case ImplicitConversionSequence::EllipsisConversion:
     llvm_unreachable("Cannot perform an ellipsis conversion");
-    return Owned(From);
 
   case ImplicitConversionSequence::BadConversion:
     return ExprError();
@@ -2285,7 +2283,6 @@
 
   default:
     llvm_unreachable("Improper first standard conversion");
-    break;
   }
 
   // Perform the second implicit conversion
@@ -2525,7 +2522,6 @@
   case ICK_Qualification:
   case ICK_Num_Conversion_Kinds:
     llvm_unreachable("Improper second standard conversion");
-    break;
   }
 
   switch (SCS.Third) {
@@ -2551,7 +2547,6 @@
 
   default:
     llvm_unreachable("Improper third standard conversion");
-    break;
   }
 
   return Owned(From);
@@ -3561,7 +3556,6 @@
 
     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 7f42fb7..9a80222 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -6334,7 +6334,6 @@
   case OO_None:
   case NUM_OVERLOADED_OPERATORS:
     llvm_unreachable("Expected an overloaded operator");
-    break;
 
   case OO_New:
   case OO_Delete:
@@ -6343,7 +6342,6 @@
   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 c75e337..b30be82 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -1388,7 +1388,6 @@
         // 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 4f90a72..594b7b2 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -2683,7 +2683,6 @@
     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 @@
   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 @@
   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 @@
   }
 
   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 283cc57..5d5cdc5 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -1540,7 +1540,6 @@
   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 @@
   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 d440624..43db5cb 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -97,7 +97,6 @@
 Decl *
 TemplateDeclInstantiator::VisitTranslationUnitDecl(TranslationUnitDecl *D) {
   llvm_unreachable("Translation units cannot be instantiated");
-  return D;
 }
 
 Decl *
@@ -111,7 +110,6 @@
 Decl *
 TemplateDeclInstantiator::VisitNamespaceDecl(NamespaceDecl *D) {
   llvm_unreachable("Namespaces cannot be instantiated");
-  return D;
 }
 
 Decl *
@@ -702,7 +700,6 @@
 
 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 2b4a509..ad5d8b9 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -1760,7 +1760,7 @@
       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/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index 0c22c61..509c450 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -1729,7 +1729,6 @@
 
     default:
       llvm_unreachable("Invalid C++ named cast");
-      break;
     }
 
     return ExprError();
@@ -2682,7 +2681,6 @@
   }
 
   llvm_unreachable("Unknown name kind.");
-  return DeclarationNameInfo();
 }
 
 template<typename Derived>
@@ -8050,7 +8048,6 @@
 ExprResult
 TreeTransform<Derived>::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 4d92e31..f390929 100644
--- a/lib/Serialization/ASTReader.cpp
+++ b/lib/Serialization/ASTReader.cpp
@@ -4994,7 +4994,6 @@
   }
 
   llvm_unreachable("Unhandled template name kind!");
-  return TemplateName();
 }
 
 TemplateArgument
@@ -5034,7 +5033,6 @@
   }
 
   llvm_unreachable("Unhandled template argument kind!");
-  return TemplateArgument();
 }
 
 TemplateParameterList *
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index 38f5f49..32d8840 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -346,7 +346,6 @@
   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 @@
   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 5a5963c..ae273f3 100644
--- a/lib/Serialization/ASTWriterDecl.cpp
+++ b/lib/Serialization/ASTWriterDecl.cpp
@@ -296,7 +296,6 @@
   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 b87c9eb..6e73b60 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -1744,7 +1744,6 @@
     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 6a86042..e1705c6 100644
--- a/lib/StaticAnalyzer/Core/CoreEngine.cpp
+++ b/lib/StaticAnalyzer/Core/CoreEngine.cpp
@@ -327,7 +327,6 @@
     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/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp
index 5e38f2f..d982a69 100644
--- a/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -1031,7 +1031,6 @@
     }
 
     llvm_unreachable("No block with label.");
-    return;
   }
 
   if (isa<loc::ConcreteInt>(V) || isa<UndefinedVal>(V)) {
diff --git a/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/lib/StaticAnalyzer/Core/ExprEngineC.cpp
index 955684f..68ccc59 100644
--- a/lib/StaticAnalyzer/Core/ExprEngineC.cpp
+++ b/lib/StaticAnalyzer/Core/ExprEngineC.cpp
@@ -626,7 +626,6 @@
         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 18fbf83..6d435da 100644
--- a/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -892,7 +892,6 @@
 
   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/lib/StaticAnalyzer/Core/SVals.cpp b/lib/StaticAnalyzer/Core/SVals.cpp
index e32a3b0..b5980b9 100644
--- a/lib/StaticAnalyzer/Core/SVals.cpp
+++ b/lib/StaticAnalyzer/Core/SVals.cpp
@@ -370,6 +370,5 @@
     }
     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 830d70e..bd63ecf 100644
--- a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
+++ b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
@@ -348,7 +348,6 @@
         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 @@
         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 @@
     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 @@
   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 63550d4..48a6f4f 100644
--- a/lib/StaticAnalyzer/Core/Store.cpp
+++ b/lib/StaticAnalyzer/Core/Store.cpp
@@ -104,7 +104,6 @@
     case MemRegion::NonStaticGlobalSpaceRegionKind:
     case MemRegion::StaticGlobalSpaceRegionKind: {
       llvm_unreachable("Invalid region cast");
-      break;
     }
 
     case MemRegion::FunctionTextRegionKind:
@@ -204,7 +203,6 @@
   }
 
   llvm_unreachable("unreachable");
-  return 0;
 }
 
 
@@ -262,7 +260,6 @@
 
   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 32ad581..dc3a2fe 100644
--- a/lib/StaticAnalyzer/Core/SymbolManager.cpp
+++ b/lib/StaticAnalyzer/Core/SymbolManager.cpp
@@ -29,7 +29,6 @@
   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 cfebbfc..db71a76 100644
--- a/tools/libclang/CIndexDiagnostic.cpp
+++ b/tools/libclang/CIndexDiagnostic.cpp
@@ -106,7 +106,7 @@
 
   /* 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;