From 289896d2f315348dc3560839be49a0f511aa1569 Mon Sep 17 00:00:00 2001 From: Ahmed Charles Date: Sun, 19 Feb 2012 11:57:29 +0000 Subject: [PATCH] Remove dead code. llvm-svn: 150919 --- clang/lib/AST/Type.cpp | 5 ----- clang/lib/CodeGen/CGException.cpp | 8 ++------ clang/lib/Sema/TreeTransform.h | 8 -------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index 6732c724c2bb..c58debbbd27b 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -2137,11 +2137,6 @@ static CachedProperties computeCachedProperties(const Type *T) { } llvm_unreachable("unhandled type class"); - - // C++ [basic.link]p8: - // Names not covered by these rules have no linkage. - NamedDecl::LinkageInfo LV(NoLinkage, DefaultVisibility, false); - return CachedProperties(LV, false); } /// \brief Determine the linkage of this type. diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index f90c71bb46d1..668dbaf70eff 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -1204,14 +1204,10 @@ static void emitCatchDispatchBlock(CodeGenFunction &CGF, if (nextIsEnd) { CGF.Builder.restoreIP(savedIP); return; - - // Otherwise we need to emit and continue at that block. - } else { - CGF.EmitBlock(nextBlock); } + // Otherwise we need to emit and continue at that block. + CGF.EmitBlock(nextBlock); } - - llvm_unreachable("fell out of loop!"); } void CodeGenFunction::popCatchScope() { diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 69e09e5ac3e6..8a47a37d1c6b 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -878,7 +878,6 @@ public: case LookupResult::FoundOverloaded: case LookupResult::FoundUnresolvedValue: llvm_unreachable("Tag lookup cannot find non-tags"); - return QualType(); case LookupResult::Ambiguous: // Let the LookupResult structure handle ambiguities. @@ -1783,8 +1782,6 @@ public: default: llvm_unreachable("Invalid C++ named cast"); } - - return ExprError(); } /// \brief Build a new C++ static_cast expression. @@ -2854,7 +2851,6 @@ TreeTransform::TransformTemplateName(CXXScopeSpec &SS, // These should be getting filtered out before they reach the AST. llvm_unreachable("overloaded function decl survived to here"); - return TemplateName(); } template @@ -3255,7 +3251,6 @@ TreeTransform::TransformType(TypeLocBuilder &TLB, TypeLoc T) { } llvm_unreachable("unhandled type loc!"); - return QualType(); } /// FIXME: By default, this routine adds type qualifiers only to types @@ -6737,7 +6732,6 @@ TreeTransform::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *E) { case OO_Array_New: case OO_Array_Delete: llvm_unreachable("new and delete operators cannot use CXXOperatorCallExpr"); - return ExprError(); case OO_Call: { // This is a call to an object's operator(). @@ -6774,12 +6768,10 @@ TreeTransform::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *E) { case OO_Conditional: llvm_unreachable("conditional operator is not actually overloadable"); - return ExprError(); case OO_None: case NUM_OVERLOADED_OPERATORS: llvm_unreachable("not an overloaded operator?"); - return ExprError(); } ExprResult Callee = getDerived().TransformExpr(E->getCallee());