]> granicus.if.org Git - clang/commitdiff
Fix various minor issues find via unreachable code warnings, from
authorDouglas Gregor <dgregor@apple.com>
Wed, 2 Nov 2011 20:52:01 +0000 (20:52 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 2 Nov 2011 20:52:01 +0000 (20:52 +0000)
Ahmed Charles!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143569 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTImporter.cpp
lib/Basic/Targets.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Sema/SemaTemplate.cpp
lib/StaticAnalyzer/Core/PathDiagnostic.cpp

index e92b358ec74a4fa4f650576353c11c9d331f93bd..519d519a5ebb152faff53b3f65a6cef64c664656 100644 (file)
@@ -1774,8 +1774,8 @@ ASTNodeImporter::ImportDeclarationNameLoc(const DeclarationNameInfo &From,
     To.setNamedTypeInfo(Importer.Import(FromTInfo));
     return;
   }
-    llvm_unreachable("Unknown name kind.");
   }
+  llvm_unreachable("Unknown name kind.");
 }
 
 void ASTNodeImporter::ImportDeclContext(DeclContext *FromDC, bool ForceImport) {
index da32c93254de226e84424f642801a34452850efe..0df5ed2fabd03389d63e7fdf8bcbabc28d9f7ae7 100644 (file)
@@ -3077,6 +3077,8 @@ public:
                                      TargetInfo::ConstraintInfo &Info) const {
     switch (*Name) {
     default:
+      return false;
+        
     case 'r': // CPU registers.
     case 'd': // Equivalent to "r" unless generating MIPS16 code.
     case 'y': // Equivalent to "r", backwards compatibility only.
index 34ad608475867a56eb23f2b0bc8745b057790f97..b4982903997ce49b5d64e7ffdf16f308336ed8ad 100644 (file)
@@ -690,11 +690,12 @@ static void LangOptsToArgs(const LangOptions &Opts,
   case LangOptions::SOB_Undefined: break;
   case LangOptions::SOB_Defined:   Res.push_back("-fwrapv"); break;
   case LangOptions::SOB_Trapping:
-    Res.push_back("-ftrapv"); break;
+    Res.push_back("-ftrapv");
     if (!Opts.OverflowHandler.empty()) {
       Res.push_back("-ftrapv-handler");
       Res.push_back(Opts.OverflowHandler);
     }
+    break;
   }
   if (Opts.HeinousExtensions)
     Res.push_back("-fheinous-gnu-extensions");
index 41c62550e883ed5cd850ce70f61c72e939eab60f..9c14976f0ae8f365604ed3f90e4763d406dba3b6 100644 (file)
@@ -6632,10 +6632,6 @@ Sema::CheckTypenameType(ElaboratedTypeKeyword Keyword,
     Referenced = Result.getFoundDecl();
     break;
 
-
-    llvm_unreachable("unresolved using decl in non-dependent context");
-    return QualType();
-
   case LookupResult::FoundOverloaded:
     DiagID = diag::err_typename_nested_not_type;
     Referenced = *Result.begin();
index 1152b3fce920ef3058bb77462f275f3f66cbe95b..6c2f2ae46f2c0a76c7100ea00bf5e8871b762489 100644 (file)
@@ -193,9 +193,6 @@ PathDiagnosticLocation
   }
 
   return PathDiagnosticLocation(S, SMng, P.getLocationContext());
-
-  if (!S)
-    return PathDiagnosticLocation();
 }
 
 PathDiagnosticLocation