summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-03-18 22:33:24 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-03-18 22:33:24 +0000
commit3654e65adf856debf94ad901c0b519beaf263504 (patch)
treee7854c0a78fe13142f00d8797013dd28c567b2e0 /clang/lib/Sema/SemaDeclObjC.cpp
parent6c17bfd99b1c1b10c4a1f501227737c9239067e5 (diff)
downloadbcm5719-llvm-3654e65adf856debf94ad901c0b519beaf263504.tar.gz
bcm5719-llvm-3654e65adf856debf94ad901c0b519beaf263504.zip
objc: Implemented variables declared in class interface
whose sema decl is at the translation unit. llvm-svn: 67249
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index fb74519b57d..93141341615 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/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);
+ }
}
OpenPOWER on IntegriCloud