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 | 08899ff85dde961d36bf0c94d07ee3418905d536 (patch) | |
tree | f62f9495dbc4863310a91c87b36f3a17446beb8d /clang/lib/Sema/SemaStmt.cpp | |
parent | 82b6673c44ee0153c5f252f38b95cb21396cc0b2 (diff) | |
download | bcm5719-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/Sema/SemaStmt.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 14b2fdf7d0e..d8f213a973c 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/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, |