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/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 8255c12..e186bb6 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -23,8 +23,6 @@
 void CodeGenFunction::EmitDecl(const Decl &D) {
   switch (D.getKind()) {
   default: assert(0 && "Unknown decl kind!");
-  case Decl::FileVar:
-    assert(0 && "Should not see file-scope variables inside a function!");
   case Decl::ParmVar:
     assert(0 && "Parmdecls should not be in declstmts!");
   case Decl::Typedef:   // typedef int X;
@@ -36,8 +34,11 @@
     // None of these decls require codegen support.
     return;
     
-  case Decl::BlockVar:
-    return EmitBlockVarDecl(cast<BlockVarDecl>(D));
+  case Decl::Var:
+    if (cast<VarDecl>(D).isBlockVarDecl())
+      return EmitBlockVarDecl(cast<VarDecl>(D));
+    assert(0 && "Should not see file-scope variables inside a function!");
+  
   case Decl::EnumConstant:
     return EmitEnumConstantDecl(cast<EnumConstantDecl>(D));
   }
@@ -49,7 +50,7 @@
 
 /// EmitBlockVarDecl - This method handles emission of any variable declaration
 /// inside a function, including static vars etc.
-void CodeGenFunction::EmitBlockVarDecl(const BlockVarDecl &D) {
+void CodeGenFunction::EmitBlockVarDecl(const VarDecl &D) {
   switch (D.getStorageClass()) {
   case VarDecl::Static:
     return EmitStaticBlockVarDecl(D);
@@ -65,7 +66,7 @@
   }
 }
 
-void CodeGenFunction::EmitStaticBlockVarDecl(const BlockVarDecl &D) {
+void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) {
   QualType Ty = D.getType();
   assert(Ty->isConstantSizeType() && "VLAs can't be static");
   
@@ -99,7 +100,7 @@
 /// EmitLocalBlockVarDecl - Emit code and set up an entry in LocalDeclMap for a
 /// variable declaration with auto, register, or no storage class specifier.
 /// These turn into simple stack objects.
-void CodeGenFunction::EmitLocalBlockVarDecl(const BlockVarDecl &D) {
+void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
   QualType Ty = D.getType();
 
   llvm::Value *DeclPtr;