diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-01-20 21:50:17 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-01-20 21:50:17 +0000 |
commit | 3026348bd4c13a0f83b59839f64065e0fcbea253 (patch) | |
tree | 03fea993d36918ffd37e05ee83d0db7370befc0c /lib/Analysis | |
parent | 18932a0f2a94a7813ec461d1118c39ecf8aa936f (diff) |
More dead code removal (using -Wunreachable-code)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/CFG.cpp | 1 | ||||
-rw-r--r-- | lib/Analysis/CocoaConventions.cpp | 3 | ||||
-rw-r--r-- | lib/Analysis/FormatString.cpp | 10 | ||||
-rw-r--r-- | lib/Analysis/ScanfFormatString.cpp | 4 |
4 files changed, 5 insertions, 13 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 4ccbf595a7..7b84710b59 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -3090,7 +3090,6 @@ CFGImplicitDtor::getDestructorDecl(ASTContext &astContext) const { return 0; } llvm_unreachable("getKind() returned bogus value"); - return 0; } bool CFGImplicitDtor::isNoReturn(ASTContext &astContext) const { diff --git a/lib/Analysis/CocoaConventions.cpp b/lib/Analysis/CocoaConventions.cpp index 0c1531da14..ee8a6efb35 100644 --- a/lib/Analysis/CocoaConventions.cpp +++ b/lib/Analysis/CocoaConventions.cpp @@ -58,7 +58,6 @@ cocoa::NamingConvention cocoa::deriveNamingConvention(Selector S, return CreateRule; } llvm_unreachable("unexpected naming convention"); - return NoConvention; } bool cocoa::isRefType(QualType RetTy, StringRef Prefix, @@ -176,6 +175,4 @@ bool coreFoundation::followsCreateRule(const FunctionDecl *fn) { // If we matched a lowercase character, it isn't the end of the // word. Keep scanning. } - - return false; } diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp index dcab03c3c0..207f77301b 100644 --- a/lib/Analysis/FormatString.cpp +++ b/lib/Analysis/FormatString.cpp @@ -340,9 +340,7 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const { return argTy->getAs<ObjCObjectPointerType>() != NULL; } - // FIXME: Should be unreachable, but Clang is currently emitting - // a warning. - return false; + llvm_unreachable("Invalid ArgTypeResult Kind!"); } QualType ArgTypeResult::getRepresentativeType(ASTContext &C) const { @@ -369,9 +367,7 @@ QualType ArgTypeResult::getRepresentativeType(ASTContext &C) const { } } - // FIXME: Should be unreachable, but Clang is currently emitting - // a warning. - return QualType(); + llvm_unreachable("Invalid ArgTypeResult Kind!"); } std::string ArgTypeResult::getRepresentativeTypeName(ASTContext &C) const { @@ -577,5 +573,5 @@ bool FormatSpecifier::hasValidLengthModifier() const { return false; } } - return false; + llvm_unreachable("Invalid LengthModifier Kind!"); } diff --git a/lib/Analysis/ScanfFormatString.cpp b/lib/Analysis/ScanfFormatString.cpp index d5a44cb8e0..38afd615c1 100644 --- a/lib/Analysis/ScanfFormatString.cpp +++ b/lib/Analysis/ScanfFormatString.cpp @@ -462,7 +462,7 @@ bool ScanfArgTypeResult::matchesType(ASTContext& C, QualType argTy) const { } } - return false; // Unreachable, but we still get a warning. + llvm_unreachable("Invalid ScanfArgTypeResult Kind!"); } QualType ScanfArgTypeResult::getRepresentativeType(ASTContext &C) const { @@ -479,7 +479,7 @@ QualType ScanfArgTypeResult::getRepresentativeType(ASTContext &C) const { return C.getPointerType(A.getRepresentativeType(C)); } - return QualType(); // Not reachable. + llvm_unreachable("Invalid ScanfArgTypeResult Kind!"); } std::string ScanfArgTypeResult::getRepresentativeTypeName(ASTContext& C) const { |