Revert various template unreachability code I committed accidentally.

r148774, r148775, r148776, r148777

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148780 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp
index 5f1d8cc..e2d1e8c 100644
--- a/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/lib/Sema/AnalysisBasedWarnings.cpp
@@ -782,7 +782,8 @@
     return;
 
   // For code in dependent contexts, we'll do this at instantiation time.
-  bool Dependent = cast<DeclContext>(D)->isDependentContext();
+  if (cast<DeclContext>(D)->isDependentContext())
+    return;
 
   if (Diags.hasErrorOccurred() || Diags.hasFatalErrorOccurred()) {
     // Flush out any possibly unreachable diagnostics.
@@ -825,7 +826,7 @@
   // Construct the analysis context with the specified CFG build options.
   
   // Emit delayed diagnostics.
-  if (!fscope->PossiblyUnreachableDiags.empty() && !Dependent) {
+  if (!fscope->PossiblyUnreachableDiags.empty()) {
     bool analyzed = false;
 
     // Register the expressions with the CFGBuilder.
@@ -873,7 +874,7 @@
   
   
   // Warning: check missing 'return'
-  if (P.enableCheckFallThrough && !Dependent) {
+  if (P.enableCheckFallThrough) {
     const CheckFallThroughDiagnostics &CD =
       (isa<BlockDecl>(D) ? CheckFallThroughDiagnostics::MakeForBlock()
                          : CheckFallThroughDiagnostics::MakeForFunction(D));
@@ -894,7 +895,7 @@
   }
 
   // Check for thread safety violations
-  if (P.enableThreadSafetyAnalysis && !Dependent) {
+  if (P.enableThreadSafetyAnalysis) {
     SourceLocation FL = AC.getDecl()->getLocation();
     thread_safety::ThreadSafetyReporter Reporter(S, FL);
     thread_safety::runThreadSafetyAnalysis(AC, Reporter);