diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-03-18 22:33:24 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-03-18 22:33:24 +0000 |
commit | 38e24c782c17b6058bf61d635747bbde19fb1bc7 (patch) | |
tree | beb09e8aa66b92cfbc7ecb904fb34f8fb578dd61 /lib/Sema | |
parent | e530ad407af4a8904377592bfdb236acd320c6c2 (diff) |
objc: Implemented variables declared in class interface
whose sema decl is at the translation unit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67249 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/Sema.h | 3 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 13 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 38541ef96e..d84829a0c7 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -1986,7 +1986,8 @@ public: virtual void ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl, DeclTy **allMethods = 0, unsigned allNum = 0, - DeclTy **allProperties = 0, unsigned pNum = 0); + DeclTy **allProperties = 0, unsigned pNum = 0, + DeclTy **allTUVars = 0, unsigned tuvNum = 0); virtual DeclTy *ActOnProperty(Scope *S, SourceLocation AtLoc, FieldDeclarator &FD, ObjCDeclSpec &ODS, diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index fb74519b57..9314134161 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1233,7 +1233,9 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property, // always null. void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl, DeclTy **allMethods, unsigned allNum, - DeclTy **allProperties, unsigned pNum) { + DeclTy **allProperties, unsigned pNum, + DeclTy **allTUVars, + unsigned tuvNum) { Decl *ClassDecl = static_cast<Decl *>(classDecl); // FIXME: If we don't have a ClassDecl, we have an error. We should consider @@ -1337,6 +1339,15 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl, } } } + llvm::SmallVector<VarDecl*, 8> allTUVariables; + for (unsigned i = 0; i < tuvNum; i++) { + if (VarDecl *VD = dyn_cast<VarDecl>((Decl*)allTUVars[i])) + allTUVariables.push_back(VD); + } + if (!allTUVariables.empty() && isInterfaceDeclKind) { + ObjCContainerDecl *OCD = dyn_cast<ObjCContainerDecl>(ClassDecl); + OCD->setTUVarList(&allTUVariables[0], allTUVariables.size(), Context); + } } |