Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().

This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49748 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 14b2fdf..d8f213a 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -521,10 +521,10 @@
     // C99 6.8.5p3: The declaration part of a 'for' statement shall only declare
     // identifiers for objects having storage class 'auto' or 'register'.
     for (ScopedDecl *D = DS->getDecl(); D; D = D->getNextDeclarator()) {
-      BlockVarDecl *BVD = dyn_cast<BlockVarDecl>(D);
-      if (BVD && !BVD->hasLocalStorage())
-        BVD = 0;
-      if (BVD == 0)
+      VarDecl *VD = dyn_cast<VarDecl>(D);
+      if (VD && VD->isBlockVarDecl() && !VD->hasLocalStorage())
+        VD = 0;
+      if (VD == 0)
         Diag(dyn_cast<ScopedDecl>(D)->getLocation(), 
              diag::err_non_variable_decl_in_for);
       // FIXME: mark decl erroneous!
@@ -556,13 +556,12 @@
       // C99 6.8.5p3: The declaration part of a 'for' statement shall only declare
       // identifiers for objects having storage class 'auto' or 'register'.
       ScopedDecl *D = DS->getDecl();
-      BlockVarDecl *BVD = cast<BlockVarDecl>(D);
-      if (!BVD->hasLocalStorage())
-        return Diag(BVD->getLocation(), diag::err_non_variable_decl_in_for);
+      VarDecl *VD = cast<VarDecl>(D);
+      if (VD->isBlockVarDecl() && !VD->hasLocalStorage())
+        return Diag(VD->getLocation(), diag::err_non_variable_decl_in_for);
       if (D->getNextDeclarator())
         return Diag(D->getLocation(), diag::err_toomany_element_decls);
-    }
-    else
+    } else
       FirstType = static_cast<Expr*>(first)->getType();
     if (!isObjCObjectPointerType(FirstType))
         Diag(ForLoc, diag::err_selector_element_type,