diff options
author | Steve Naroff <snaroff@apple.com> | 2008-04-15 22:42:06 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-04-15 22:42:06 +0000 |
commit | 248a753f6b670692523c99afaeb8fe98f7ae3ca7 (patch) | |
tree | f51ae4f62f1bdefaf28f672616ec7eaf4ff67f9a /lib/Sema/SemaStmt.cpp | |
parent | 4b0f81323b518429203051bbcd4864bbf4b000a9 (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/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 14b2fdf7d0..d8f213a973 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -521,10 +521,10 @@ Sema::ActOnForStmt(SourceLocation ForLoc, SourceLocation LParenLoc, // 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 @@ Sema::ActOnObjCForCollectionStmt(SourceLocation ForLoc, // 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, |