aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-04-15 22:42:06 +0000
committerSteve Naroff <snaroff@apple.com>2008-04-15 22:42:06 +0000
commit248a753f6b670692523c99afaeb8fe98f7ae3ca7 (patch)
treef51ae4f62f1bdefaf28f672616ec7eaf4ff67f9a /lib/CodeGen/CGDecl.cpp
parent4b0f81323b518429203051bbcd4864bbf4b000a9 (diff)
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
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r--lib/CodeGen/CGDecl.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 8255c12f01..e186bb69eb 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -23,8 +23,6 @@ using namespace CodeGen;
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 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
// 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 @@ void CodeGenFunction::EmitEnumConstantDecl(const EnumConstantDecl &D) {
/// 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::EmitBlockVarDecl(const BlockVarDecl &D) {
}
}
-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 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const BlockVarDecl &D) {
/// 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;