summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.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
commit08899ff85dde961d36bf0c94d07ee3418905d536 (patch)
treef62f9495dbc4863310a91c87b36f3a17446beb8d /clang/lib/CodeGen/CGExprConstant.cpp
parent82b6673c44ee0153c5f252f38b95cb21396cc0b2 (diff)
downloadbcm5719-llvm-08899ff85dde961d36bf0c94d07ee3418905d536.tar.gz
bcm5719-llvm-08899ff85dde961d36bf0c94d07ee3418905d536.zip
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). llvm-svn: 49748
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 2ca71c31531..ace494c86a2 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -541,11 +541,13 @@ public:
ValueDecl *Decl = cast<DeclRefExpr>(E)->getDecl();
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(Decl))
return CGM.GetAddrOfFunctionDecl(FD, false);
- if (const FileVarDecl* VD = dyn_cast<FileVarDecl>(Decl))
- return CGM.GetAddrOfGlobalVar(VD, false);
- if (const BlockVarDecl* BVD = dyn_cast<BlockVarDecl>(Decl)) {
- assert(CGF && "Can't access static local vars without CGF");
- return CGF->GetAddrOfStaticLocalVar(BVD);
+ if (const VarDecl* VD = dyn_cast<VarDecl>(Decl)) {
+ if (VD->isFileVarDecl())
+ return CGM.GetAddrOfGlobalVar(VD, false);
+ else if (VD->isBlockVarDecl()) {
+ assert(CGF && "Can't access static local vars without CGF");
+ return CGF->GetAddrOfStaticLocalVar(VD);
+ }
}
break;
}
OpenPOWER on IntegriCloud