diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-10-06 20:59:48 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-10-06 20:59:48 +0000 |
commit | 39741cecde917affbcbdfb2942ff1a9eae8f3488 (patch) | |
tree | 3ec7857beb56b8befad86f8c7bce4b6f74996349 /lib/CodeGen/CGObjC.cpp | |
parent | de3b8fb02bd86a592fe5073020e6bdaf97902ffc (diff) |
Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when processing the Decl of an Objective-C foreach statement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57209 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | lib/CodeGen/CGObjC.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index c389adba58..9849fb61b6 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -342,9 +342,9 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S) if (const DeclStmt *SD = dyn_cast<DeclStmt>(S.getElement())) { EmitStmt(SD); - - ElementTy = cast<ValueDecl>(SD->getDecl())->getType(); - DeclAddress = LocalDeclMap[SD->getDecl()]; + const ScopedDecl* D = SD->getSolitaryDecl(); + ElementTy = cast<ValueDecl>(D)->getType(); + DeclAddress = LocalDeclMap[D]; } else { ElementTy = cast<Expr>(S.getElement())->getType(); DeclAddress = 0; |